feat(outline): outline type + outliner — S3 (#109)
CI / ci (push) Canceled after 0s
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:
1 parent
e55747e7fe
commit
c23ee0f62f
21 files changed
+1809
-21
No files matched your search
@@ -32,6 +32,8 @@ struct PostEditorView: View {
|
||||
let draftText: String?
|
||||
var draftEdited: ((String) -> Void)?
|
||||
var draftSave: (() -> Void)?
|
||||
/// #109: render the outline editing surface instead of prose.
|
||||
var outline = false
|
||||
|
||||
@State private var closeObserver: AnyCancellable?
|
||||
@State private var toggleObserver: AnyCancellable?
|
||||
@@ -159,7 +161,17 @@ struct PostEditorView: View {
|
||||
|
||||
@ViewBuilder
|
||||
private var editingSurface: some View {
|
||||
if let session {
|
||||
if outline {
|
||||
// #109: the outliner — same session/draft duality as prose.
|
||||
// Draft mode keeps the mirror current via draftEdited so the
|
||||
// reading surface renders the serialized outline; the outline
|
||||
// view seeds from draftText once and owns the tree after.
|
||||
OutlineEditorView(
|
||||
session: session,
|
||||
onDraftEdit: session == nil ? { draftMirror = $0; draftEdited?($0) } : nil,
|
||||
draftText: session == nil ? draftText : nil,
|
||||
)
|
||||
} else if let session {
|
||||
ProseTextView(session: session, spellChecking: gate.spellChecking, focused: gate.isFocused, caretHint: flipBackCaret)
|
||||
} else {
|
||||
ProseTextView(draft: draftMirror, spellChecking: gate.spellChecking, focused: gate.isFocused, onEdit: { newText in
|
||||
|
||||
Reference in new issue
Block a user