Build S4: Convert to Post — in-place, transform choice at conversion #114

Closed
opened 2026-10-15 14:08:55 +02:00 by AlexKucera · 1 comment
Owner

Part of #110

Question

Build S4: Convert to Post — in-place, transform choice at conversion. A Convert to Post command on outline pieces: id, folder, pass state, origin kept; type frontmatter flips to post; body transforms once. At conversion the writer chooses the transform: (1) verbatim bullets — nested-bullet markdown becomes the post body unchanged; (2) headings ladder — a heading-depth mapping of the outline levels (root → ##, deeper levels step down to a floor, remainder stay bullets; exact ladder per build's simplest honest rule; # Title preamble stays above the body either way). Open session flush-first, re-route the editor to the prose surface, flip lastDraftWasOutline machinery the other way; scan reads the new type on rescan. One-way in v1 (Post → Outline is not built).

[Generated by AI]

Part of #110 ## Question **Build S4: Convert to Post — in-place, transform choice at conversion.** A Convert to Post command on outline pieces: id, folder, pass state, origin kept; `type` frontmatter flips to `post`; body transforms once. At conversion the writer chooses the transform: (1) verbatim bullets — nested-bullet markdown becomes the post body unchanged; (2) headings ladder — a heading-depth mapping of the outline levels (root → `##`, deeper levels step down to a floor, remainder stay bullets; exact ladder per build's simplest honest rule; `# Title` preamble stays above the body either way). Open session flush-first, re-route the editor to the prose surface, flip `lastDraftWasOutline` machinery the other way; scan reads the new type on rescan. One-way in v1 (Post → Outline is not built). [Generated by AI]
AlexKucera added the wayfinder:task label 2026-10-15 14:08:55 +02:00
AlexKucera self-assigned this 2026-10-16 15:00:06 +02:00
Author
Owner

LANDED in main @ c0513aa (2026-10-16).

What landed — Convert to Post on outline pieces (library row menu + Archive pane): id, folder, Pass State, origin kept; type flips to post; body transforms once. The ask (ConvertSheet, house pattern): Verbatim Bullets (default — lossless, body unchanged) or Headings (roots → ##, each level steps one heading down to the ###### floor, deeper levels stay bullets re-based flush; # Title preamble rides above either way). One-way in v1.

Flow — open session flushes first (flushOrAbort), convert reads disk, the piece reopens routed to prose via proseOverridePostID (lastDraftWasOutline's machinery reversed — the existing override slot, no new routing state). An unopened piece converts in place; archived pieces stay archived. Scan reads the new type on rescan.

Audit round (finish-audit, three reviewers) folded in before landing:

  • answer-time consent recheck — Headings aborts ("nothing was converted") when the body went lossy behind an unwarned ask (foreign write / late edit); staging derives the warning from session.text when the piece is open (disk lags the debounce)
  • unanswered #67 conflict now aborts every flush-first op (shared flushOrAbort seam — convert, rename, move, archive, restore); the alert stays answerable
  • rescan's #67 echo check gated by session identity — a same-id reopen no longer receives its predecessor's stale disk text as a conflict
  • a held #111 guard ask on the piece dies as a cancel when the piece converts

Verification — xcodebuild build + full test green (206 unit incl. 13 new pins + UI smoke); swiftlint 0 new; pin discrimination verified (guards flipped off → pins failed, restored). Record: docs/devlog/20261016-issue114-convert-to-post_log.md.

[Generated by AI]

LANDED in main @ c0513aa (2026-10-16). **What landed** — Convert to Post on outline pieces (library row menu + Archive pane): id, folder, Pass State, origin kept; `type` flips to `post`; body transforms once. The ask (`ConvertSheet`, house pattern): **Verbatim Bullets** (default — lossless, body unchanged) or **Headings** (roots → `##`, each level steps one heading down to the `######` floor, deeper levels stay bullets re-based flush; `# Title` preamble rides above either way). One-way in v1. **Flow** — open session flushes first (`flushOrAbort`), convert reads disk, the piece reopens routed to prose via `proseOverridePostID` (lastDraftWasOutline's machinery reversed — the existing override slot, no new routing state). An unopened piece converts in place; archived pieces stay archived. Scan reads the new type on rescan. **Audit round (finish-audit, three reviewers) folded in before landing:** - answer-time consent recheck — Headings aborts ("nothing was converted") when the body went lossy behind an unwarned ask (foreign write / late edit); staging derives the warning from `session.text` when the piece is open (disk lags the debounce) - unanswered #67 conflict now aborts every flush-first op (shared `flushOrAbort` seam — convert, rename, move, archive, restore); the alert stays answerable - rescan's #67 echo check gated by session identity — a same-id reopen no longer receives its predecessor's stale disk text as a conflict - a held #111 guard ask on the piece dies as a cancel when the piece converts **Verification** — `xcodebuild build` + full `test` green (206 unit incl. 13 new pins + UI smoke); swiftlint 0 new; pin discrimination verified (guards flipped off → pins failed, restored). Record: `docs/devlog/20261016-issue114-convert-to-post_log.md`. [Generated by AI]
Sign in to join this conversation.