feat(microblog): set and create categories
A piece's `category:` frontmatter line now travels to Micro.blog: a first send carries the list beside title and content, and a re-send replaces the post's categories with exactly the piece's list — only when the piece has the line (opt-in by key; `[]` clears; no line leaves the blog's). Naming a category Micro.blog doesn't know creates it there, so there is no separate create step. The publish sheet gains a Categories field: a comma list with the system completion menu over the blog's own categories. The system replaces the whole field text with a completion, so the completion is the merge — a pick adds, a half-typed last word is replaced. The edit lands on the piece at the send (a failed write refuses with nothing on the wire); Publish with a pending edit applies it first and flips the post that send touched. The one-line codec lives in PostFrontmatter (line-bounded; backslashes and quotes escaped; a Set de-duplicates). Import keeps an imported `category:` line — the writer's classification, unlike the micropub bookkeeping keys. Reviewed twice (two-axis during the build, finish-audit after): the stale pending baseline after a failed step, the backslash round-trip, and the publish targeting the caller's possibly-stale URL were found and fixed before this commit. 39 of the 40 new or changed pins were watched fail on their own guard. Rail 791/791; SwiftFormat and SwiftLint clean. Docs: AGENTS.md bullets and learnings, the GLOSSARY term, CHANGELOG [Unreleased], PRD S6.1, the devlog, and the swift wiki (text completion is a whole-text contract). Closes #207
This commit is contained in:
1 parent
6aa31a419a
commit
6db4cf8cf1
18 files changed
+1629
-67
No files matched your search
@@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file. The format
|
||||
|
||||
### Added
|
||||
|
||||
- **publish:** Micro.blog categories travel (#207) — the piece's `category:` frontmatter line rides the send (one line, `category: [Tech, Notes]`; a bare `category: Essays` is one category). A first send carries the list beside the title and content; a re-send replaces the post's categories with exactly the piece's list — but only when the piece has the line at all (no line leaves whatever the blog has; an empty `category: []` clears them). Naming a category Micro.blog doesn't know creates it there, so there is no separate create step. The publish sheet has a **Categories** field: comma-separated, with the system completion menu over your blog's existing categories (fetched when the sheet opens; a failed fetch stays silent and a typed new name still works). Clicking any number of categories adds them all — the menu stays open — a half-typed word is replaced by the pick, and a name already in the field is never offered again. The edit lands on the piece when you send (Cancel/Done discard it); Publish with a pending category edit applies it first — to the post the piece remembers, never a stale address — and never publishes after a failed update. +39 tests (the wire contract, the codec incl. its backslash escaping, the model's write-then-send order and the sanitized name, the blog's category list, publish-applies-first and targeting the post the send touched, the sheet field's picks-add completion and menu, the import keeping the line), each seen red first. Suite 791
|
||||
|
||||
- **publish:** the library shows where each piece stands on Micro.blog (#206) — a published piece's row reads `published <date>` and its menu opens the live post; a sent-but-unpublished one reads `draft on Micro.blog`. Publish is remembered now (`micropub_published` stamped in the piece's frontmatter — the sheet used to flip the draft and forget, so nothing on disk ever said a piece was out). Sending a piece again no longer duplicates it: a piece that remembers its post updates that post in place (same URL — a draft refreshes for review, a published piece edits live via **Update Live Post**), and an image whose bytes haven't changed rides its earlier upload instead of uploading a second copy (a per-piece `.museion-uploads.json` memo keyed by content hash). When Micro.blog answers 404 — the post was deleted there — the piece forgets the dead link and the sheet offers a fresh draft instead of failing forever. A file brought in by Import carries no Micro.blog memory: its `micropub_url`/`micropub_published` lines are dropped at the boundary, so a file from someone else can never aim a send at one of your existing posts. Pieces published before this build read as drafts until their next Publish (or the `micropub_published` key is added to the frontmatter by hand — `yyyy-MM-dd'T'HH:mm:ss`, local time). The row's micro-label shows the status in origin's place (the 178pt row cannot hold both); VoiceOver reads both.
|
||||
|
||||
- **settings:** **Micro.blog** page in Settings — the app token's home (unticketed; owner report 2026-12-04) — the token could only be entered in the publish sheet, and that field came back only after a 401/403, so a saved token had no standing way to be replaced or removed (a 503 left the writer stuck with whatever was stored). The new sidebar destination, after Provider Keys, writes the SAME login-keychain slot the sheet reads (`MicropubTokenStore`): a status row under the field (✓ Token saved in your Keychain / No token saved), a Save field that replaces the stored token, and a Remove button while one is stored. `saved` is read back from the Keychain after every write instead of assumed — a locked keychain fails the save and the status row says so rather than claiming "stored". The publish sheet picks up a Settings-saved token unchanged, and names it when it sends with the stored one (the field's absence alone never said which token a send carried). No new pins (a view over the already-pinned token store; the repo pins pure seams, not SwiftUI). Suite 736
|
||||
|
||||
Reference in new issue
Block a user