docs(adr): record verdict — native TextKit2 prose editor (ADR-0010)

Closes #55 on the map: TextKit2 mode B wins by the tie-breaker (calm >
effort > proven-elsewhere); variable heading sizes + paragraph spacing
required, reading toggle block-aware, anchor re-proof satisfied live.
CodeEdit exits Museion; Classis pin untouched. Paper-grade polish is
iterative practice, not a deferred phase. Spike artifacts stay on this
branch for reference.

[Generated by AI]
This commit is contained in:
AlexKucera committed 2026-10-01 15:52:17 +02:00
1 parent 986f435762
commit 2bd5169322
5 files changed
+73 -1

No files matched your search

@@ -0,0 +1,14 @@
# 0010 — Native TextKit2 prose editor (mode B)
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`/`attributesFor` builds 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` `.full` markdown 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.