feat(outline): outline type + outliner — S3 (#109)
CI / ci (push) Canceled after 0s

Dedicated block surface (ADR-0013, #105 variant B): OutlineTree
parses/serializes plain nested-bullet markdown leniently and
normalizes on save; the outliner promotes one NSTextView over the
focused row with LogSeq-style keys (Tab/⇧Tab, ⌥↑/⌥↓ subtree move,
↑/↓ hop, ⇧↑/⇧↓ block selection, ⌘↑/⌥↓ fold, Enter split), folds
session-scoped by runtime node UUID. New Outline ⇧⌘N stages a
type: outline draft through the existing autosave/conflict
machinery; reading renders the serialized markdown unchanged.

Outline rows use the body face at its natural line box — the prose
CSS-1.8 lineHeightMultiple grew the focused row and detached the
bullet (test-pinned). Finish-audit fixes included: paste-multiline
sanitizing at setText, dead Enter disjunct, dead Row.path.

Closes #109
This commit is contained in:
AlexKucera committed 2026-10-15 13:09:31 +02:00
1 parent e55747e7fe
commit c23ee0f62f
21 files changed
+1809 -21

No files matched your search

+14 -3
View File
@@ -88,16 +88,27 @@ struct PostsPaneView: View {
draftSave: {
model.saveDraft(home: home)
},
outline: draft.type == .outline,
)
.id("draft")
// #109: identity = "draft" + mountID — remounts per staged
// draft (the outliner seeds once per mount).
.id("draft-\(draft.mountID.uuidString)")
} else if let external = model.externalSession {
// #92: the guest slot — an external file in the editor column;
// one at a time, transient per launch.
PostEditorView(session: external, draftText: nil)
.id(external.fileURL?.absoluteString ?? "external")
} else if let session = model.session, session.postID == model.selectedPostID {
PostEditorView(session: session, draftText: nil)
.id(session.postID ?? "post")
// #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).
PostEditorView(
session: session,
draftText: nil,
outline: model.lastDraftWasOutline
|| model.posts.first(where: { $0.id == session.postID })?.type == .outline,
)
.id(session.postID ?? "post")
} else {
VStack(spacing: 10) {
Image(systemName: "square.and.pencil")