Editable TextKit 2 spike !7

merged merged by cmc on 2026-10-05 01:03 UTC · krz/orgstar:phase1-editing-spike into main

Discussion

cmc

Adds OrgPresentation, OrgEditorAppKit and the OrgstarSpike app, with a plan that records the spike's findings.

  • Folding through NSTextContentManagerDelegate.shouldEnumerate; ellipsis on folded headings; caret moved across folds; copy, accessibility and save see folded text.
  • Every storage edit goes through DocumentState.apply; the restyle covers the elements around the edit in the innermost section, on both the old and the new tree.
  • Tests drive a real NSTextView offscreen: folding, caret, copy across folds, IME, undo, styling, accessibility, save, and a differential restyle test (10,500 random edits over seven seeds match a fresh full styling).
  • 22 new tests; all 159 pass. (!6 said 157; the total then was 137.)

Typing p95: 5.8 ms on 1.5 MB, 3.4 ms on 0.86 MB. Not yet within the gates: a blank line in a 1.2 MB top-level section (256 ms, reparse scope) and open time (parse + style 437 ms for 1.5 MB). Both go to the performance plan. A manual VoiceOver pass is listed in the plan.