feat(microblog): add app token settings page and honest 5xx wording
The app 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. The new Settings → Micro.blog page writes the same `MicropubTokenStore` slot the sheet reads, with a status row read back from the Keychain after every write so a locked keychain fails visibly instead of claiming "stored". The sheet now names the stored token a send carries when its field is hidden. Micro.blog's errors arrive as HTML pages, never Micropub JSON, so `decodeFailure` fell through to a bare `HTTP 503` that said nothing about whose side it was on. Any 5xx without a JSON description now reads "unavailable on their side — retry in a few minutes"; a described 5xx keeps its description and a 4xx keeps the bare status. One decode covers create, publish, q=config, and media uploads. Docs: AGENTS.md bullets, CHANGELOG [Unreleased] Added/Fixed, and the devlog for this task plus the 0.1.2 release log.
This commit is contained in:
1 parent
9aa0314564
commit
6938826101
11 files changed
+272
-14
No files matched your search
@@ -7,8 +7,9 @@
|
||||
// sheet owns the whole two-step flow over the OPEN piece: Send as
|
||||
// Draft (h=entry, name, markdown content) → review on Micro.blog →
|
||||
// Publish (the post-status update against the piece's remembered
|
||||
// draft URL). The app token is entered here ONCE and lives in the
|
||||
// Keychain (G11; re-offered only on an auth failure). Refusals show
|
||||
// draft URL). The app token is entered here when none is saved and
|
||||
// lives in the Keychain (G11; re-offered only on an auth failure —
|
||||
// Settings → Micro.blog is the standing manager). Refusals show
|
||||
// inline with the buttons kept (ApplyAskSheet posture).
|
||||
//
|
||||
|
||||
@@ -60,6 +61,12 @@ struct MicropubPublishSheet: View {
|
||||
Text("From micro.blog → Account → App Tokens. Stored in your Keychain.")
|
||||
.font(.system(size: 11, design: DesignTokens.mono))
|
||||
.foregroundStyle(DesignTokens.muted)
|
||||
} else {
|
||||
// A stored token is in use — the field's absence alone
|
||||
// never said which token a send carries.
|
||||
Text("Sends with the app token in your Keychain — Settings → Micro.blog manages it.")
|
||||
.font(.system(size: 11, design: DesignTokens.mono))
|
||||
.foregroundStyle(DesignTokens.muted)
|
||||
}
|
||||
|
||||
if phase == .drafting || phase == .publishing {
|
||||
|
||||
Reference in new issue
Block a user