feat(microblog): show Micro.blog publish status
The publish sheet flipped a draft live and remembered nothing, so nothing on disk said a piece was out and the library could not show it. A successful Publish now stamps `micropub_published` in the piece's frontmatter; the row and the sheet read `published <date>` or `draft on Micro.blog`, and a published piece's menu opens the live post. Sending a piece again no longer creates a second post: a piece that remembers its post updates it in place (name and content only, so categories set on Micro.blog survive). An image whose bytes are unchanged rides its earlier upload through a per-piece memo. When Micro.blog answers 404 the piece forgets both keys and the sheet offers a fresh draft; a clear that cannot land says so instead of claiming the link is gone. Museion's micropub keys are dropped at the import boundary. An imported `micropub_url` passes the format gate and would aim the in-place update at one of the writer's own posts under their token, so the keys are treated like `origin`: ours to set, never a foreign file's to carry in. Publish is model-owned and trust-gates its URL before anything is stamped. Tests read recorded requests through an optional accessor: an out-of-range subscript after a failed count expectation trapped the hosted runner and reported every queued test as crashed. +16 tests net (17 new pins in MicropubStatusTests, one retired whose premise the in-place design voids); every new pin was watched fail on its own guard. Rail 752/752; SwiftFormat and SwiftLint clean. Reviews: standards + spec during the build, then a three-reviewer finish audit. Docs: AGENTS.md bullets and learnings, GLOSSARY terms, CHANGELOG [Unreleased], README, and the devlog. Closes #206
This commit is contained in:
1 parent
6938826101
commit
6aa31a419a
21 files changed
+1151
-225
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:** 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
|
||||
|
||||
- **library:** **Reveal in Finder** and **Copy Path** on every piece row — the library column's menu and the Archive pane's (#205) — one shared `FinderHandOffButtons` fragment in the workspace chrome over a model-resolved path: `PostsModel.fileURL(for:)` answers the piece's `post.md` through the one `PostStore.folder(of:home:)` resolver against the watched Home (never the scan snapshot), and a vanished piece answers nil so both entries no-op instead of revealing a stale path. Reveal selects the file in Finder; Copy Path puts the POSIX path on the pasteboard (Finder's own form; the pasteboard is cleared first). Library placement sits between Move to Archive and the destructive Trash behind a divider; the Archive menu appends after Convert. +3 tests (projects/ resolve, archive/ resolve, vanished → nil), flip-verified — bypassing the resolver reddens exactly the vanished and archive pins. Suite 735
|
||||
|
||||
Reference in new issue
Block a user