feat(prose): list shortcuts — S5 (#115)
CI / ci (push) Canceled after 0s

Markdown lists in the prose editor become structural: Tab/⇧Tab
indent/outdent the item under the caret (wrapped lines ride along,
caret follows), ⌥↑/⌥↓ move the item with its subtree among siblings.
Every structural edit is one range replacement — a single undo step
over the plain mode-B store (ADR-0010 stands).

List parents fold visually: a gutter chevron collapses children to
near-zero height with a rust ▸ and a "⋯ N" summary after the parent's
line. Folding is view state — the buffer never changes (ADR-0013's
posture carried to prose).

Field findings baked in: SwiftUI-hosted TextKit2 never calls
NSTextView.draw(_:) and every NSTextLayoutManager fragment query
returns empty, so the chrome renders offscreen into a layer-contents
image and geometry comes from firstRect(forCharacterRange:) (screen →
window → view). Includes the finish-audit round: sibling block-for-
block ⌥-move swap (was stealing the sibling's subtree), blank-line
indent dirt, fold-key dedupe, hidden-parent chevron filtering,
plain-click-only hit zone, no-parents raster skip.

Closes #115

[Generated by AI]
This commit is contained in:
AlexKucera committed 2026-10-19 12:31:35 +02:00
1 parent c0513aae85
commit c5c8749df4
12 files changed
+1142 -6

No files matched your search

+16
View File
@@ -129,4 +129,20 @@ nonisolated enum ProseTypography {
.foregroundColor: syntaxColor,
]
}
/// #115: fold-hidden lines. The buffer keeps every byte (mode B — folding
/// is rendering, never a text edit); hidden scopes style to near-zero
/// height so the lines vanish (spike-verified: 14pt line → ~0). The text
/// stays selectable/undoable underneath, and reading mode renders it.
nonisolated(unsafe) static let foldedAttributes: [NSAttributedString.Key: Any] = {
let style = NSMutableParagraphStyle()
style.lineHeightMultiple = 0.01
style.paragraphSpacing = 0
style.paragraphSpacingBefore = 0
return [
.font: NSFont.systemFont(ofSize: 0.1),
.foregroundColor: NSColor.clear,
.paragraphStyle: style,
]
}()
}