feat(outline): mixed-content open guard — S7 (#111)
CI / ci (push) Canceled after 0s

Opening a type: outline piece whose body parses with dropped prose
(paragraph lines between bullets) now asks before the outliner mounts:
Open in Prose (default, nothing drops), Open as Outline (explicit
consent to save normalization), or Cancel. The detector shares the
parser's item definition, the ask presents over an empty editor so
nothing can normalize on save before the choice, and the prose answer
rides a routing override that dies with the next open.

Audit round pinned the lifecycle: reselect of the open piece is a
no-op (an armed debounce must never flush mid-ask), and a draft or
guest staged during the ask displaces it without being destroyed.

Closes #111

[Generated by AI]
This commit is contained in:
AlexKucera committed 2026-10-15 18:31:26 +02:00
1 parent c23ee0f62f
commit 0b172f73ef
12 files changed
+440 -17

No files matched your search

+17 -2
View File
@@ -102,13 +102,28 @@ struct PostsPaneView: View {
// #109: outline routing — the scan's type when the list knows the
// piece, plus the just-saved-draft afterglow (the posts list lags
// one rescan; without the flag the fresh outline flashes prose).
// #111 (S7): the guard's Prose answer overrides to prose (same
// lag window); the guard hold never reaches here (no session).
PostEditorView(
session: session,
draftText: nil,
outline: model.lastDraftWasOutline
|| model.posts.first(where: { $0.id == session.postID })?.type == .outline,
outline: session.postID != model.proseOverridePostID
&& (model.lastDraftWasOutline
|| model.posts.first(where: { $0.id == session.postID })?.type == .outline),
)
.id(session.postID ?? "post")
} else if model.outlineGuardPieceID != nil {
// #111 (S7): the guard ask is up — empty editor, nothing
// editable until the choice lands.
VStack(spacing: 10) {
Image(systemName: "list.bullet")
.font(.largeTitle)
.foregroundStyle(DesignTokens.muted)
Text("This outline has lines the outliner can't show.")
.font(.callout)
.foregroundStyle(DesignTokens.muted)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
} else {
VStack(spacing: 10) {
Image(systemName: "square.and.pencil")