Add explicit unarchive; stop silently drafting archived posts on any update #72
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source: Audit section 2.3.
Spec:
specs/post.alliumtransitions include archived→draft and archived→published; nothing says updates auto-demote archived posts.bDS2:
../bDS2/lib/bds/posts.exhasunarchive_post/1(~line 381): archived→draft withrestore_content_for_unarchive(DB content if present, else read body from file, else ""). Plain updates to archived posts do NOT change status.Current behaviour (RuDS):
crates/bds-core/src/engine/post.rsupdate_posttreats Archived like Published: any update flips Archived→Draft (with file-content reload). There is no explicit unarchive function or UI action (grepunarchive— no hits).Task:
unarchive_postto engine/post.rs mirroring bDS2 (status→draft, content restored, updated_at bumped, FTS+embedding sync, domain event).update_post(updates keep archived status, per bDS2).specs/post.alliumif needed and validate withallium.Acceptance: Tests for unarchive (content restored from file for previously-published posts) and for update-keeps-archived. UI action reachable.
Implemented in
1c04087. Plain updates now keep archived posts archived in both the core update engine and the desktop preview/autosave path. Added bDS2-compatible unarchive_post: it accepts only Archived, restores existing database content or the published file body (empty fallback), moves to Draft, bumps updated_at, refreshes FTS and embeddings, and emits exactly one typed update event. Archive now also matches bDS2 by leaving a published body in the file instead of copying it into the database, while refreshing the same indexes/event state. Added a localized canonical-post Unarchive header action that saves pending archived edits first, reloads the restored body/status, and reports success; Archive is not exposed in the native macOS menu, so no menu intercept/catalog change was applicable. Localized the touched status badge in all five UI catalogs, updated post.allium and README, and added core, preview/autosave, desktop-action, and domain-event regression coverage. Allium check/analyse, formatting, cargo machete, cargo build --workspace, cargo test --workspace, cargo bundle-macos, and real inspection of the exact release app bundle all pass.