Review by Claude Fable (claude-fable-5-2) of b9285e5 — verdict: APPROVE AFTER FIXES. Read-only, plus two macOS NSTextContentStorage probes. No path found where break space, list markers or TK2 offsets reach the CRDT or export. Undo stays in the model. No observation loops.
Fix before merge:
- High
DocsPhonePages.swift:156,DocsPagedTextView.swift:378-385: any edit above the viewport invalidates layout from that paragraph to the end and lays out from the top through the screen. A peer typing on page 2 while you're on page 150 costs ~465 ms of main thread per peer key. Re-measure the edited paragraphs first, and skip the invalidation when the head, height and tail are unchanged. Add a p200h "peer key above the viewport" timing. - High (unconfirmed)
DocsPhonePages.swift:280-297:applyChanges()issuesstorage.edited(.editedAttributes…)with no marked-text check. During ja/zh composition, a break moving onto the paragraph being composed edits it mid-composition. Skip whilemarkedTextRange != niland run it when composition ends. Add a test.
Should fix:
- Medium
DocsWorkspace.swift:704-720:formatting/header.sheetOpenleak across Back, swipe, Delete, Discard and losing.writable. ••• presentations are likely dropped while the Format sheet is up. Reset inshowLibrary(), on disappear, on losing writable, and before each ••• action. Reapply suppression inattachon aneditorIdentitychange. - Medium (unconfirmed)
DocsPhoneHeader.swift:104-113: the hosted large title probably picks up a top safe-area inset under the bar. UsesafeAreaRegions = []. The same applies to the keyboard bar host; exercise the hardware-keyboard case for real. - Low
DocsPagedTextView.swift:405-414: the idle measuring loop has no no-progress exit (empty storage spins every 2 ms). - Low: the rename alert ignores a
commitRename()refusal (:725); a draft re-push after Back (:200, as on main); deadstorageinDocsPageTextContainer(DocsPaging.swift:75).
Note: the perf numbers are synchronous main-thread time, which is sound, but keys are injected via replaceCharacters with a stubbed edit hook, drawing is excluded, and idle chunks aren't counted. The AX3 share snapshot needs checking for 28 pt circle clipping now that fonts scale.
For Paul: per-paragraph breaks on iPhone and iPad mean page numbers no longer match the Mac or PDF, long paragraphs leave big gaps, and a paragraph taller than the page body runs over the gap.