2.3 KiB
0010 — Native TextKit2 prose editor (mode B)
Reading half superseded by ADR-0011 — apex HTML pipeline; the editing stance (TextKit2 mode B) stands.
The editor is a native NSTextView/TextKit2 surface presenting markdown source as calm writing (mode B: styled source, dimmed syntax, reading toggle), with presentation as a flat line-kind→attribute map — no third-party editor dependency. Decided from three throwaway spikes on the pinned calibration corpus (spike/codeedit/, spike/textkit2/, spike/blocks/ on spike/editor-presentation): TextKit2 delivers full typographic calm at the lowest cost, editing (undo, IME, selection) is native and free, and the Fix-Card anchor proof — exact-range quote highlight + stale-anchor alert with the web-proto wording — passes live on this substrate (2.4 ms anchor search on PERF-3k, ≤1.1 ms full-doc attribute load).
Considered Options
- CodeEditSourceEditor fork
0.15.8-helm(the presumptive leader, proven in Classis): anchor mechanics clean, but the substrate cannot reach typographic calm — one font size for everything, no paragraph spacing (EditorTheme/attributesForbuilds every run from a single base font), mid-word wraps at typographic apostrophes, and emphasis ghost-doubles colored spans (CATextLayer re-draw, unfixable from the API side). Museion takes no CodeEdit dependency; Classis keeps its fork pin, untouched. - SwiftUI block editor (mode C, live preview): best-in-class typography, but structural interaction ceilings — no cross-block selection, per-block undo only, split/merge outside any undo stack, and lists shatter into per-bullet blocks. Each solvable, none for free; it pays in interaction-model decisions where TextKit2 pays in already-written presentation code.
Consequences
- Typography stance: variable heading sizes and real paragraph spacing are required, and natively expressible — not a compromise to accept.
- Reading toggle renders block-aware: blank-line split, per-paragraph inline parse, headings fonted by level. A monolithic single-
Text.fullmarkdown dump flattens block structure — the anti-pattern. - Paper-grade polish is not a deferred phase; it is iterative practice, applied whenever the writing surface feels short of calm.