Skip to content

Keep large-document navigation local and anchor upward scrolling - #461

Merged
simonbs merged 2 commits into
mainfrom
codex/destination-local-layout
Oct 27, 2026
Merged

simonbs merged 2 commits into
mainfrom
codex/destination-local-layout

Conversation

@simonbs

@simonbs simonbs commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Jumping to a distant line or range previously typeset every preceding line, blocking the editor on large documents. Navigation now measures the destination and a viewport-sized neighborhood while leaving unrelated heights estimated.

Preserve an overlapping visible line when measuring wrapped predecessors, applying height and scroll-offset corrections in the same layout transaction, including programmatic scrolling. Recover from overestimated wrapped tails before rendering, and use line-local coordinates for viewport typesetting. Prepare destination syntax colors and font metrics before calculating its scroll position so the first frame does not flash unhighlighted text or shift after highlighting.

Add nine navigation regressions covering distant jumps, wrapped interiors and ranges, anchored upward scrolling with contiguous fragment coverage, shrinking height estimates, token-font metrics, unwrapped horizontal reveal, and wrapping-mode changes. The example app can load a local fixture with Top/Bottom controls and timing logs; reproduction and simulator observations are in Example/NavigationTesting.md. No fixture or recordings are included.

Validation:

  • Full framework simulator suite: 287 tests passed, followed by the final affected navigation/highlighting group: 17 tests passed. A separate affected navigation/caret/gutter group also passed after the height-recovery fix.
  • SwiftLint and git diff checks passed; Release Example build succeeded.
  • Isolated iPhone 17 Pro / iOS 27.2 simulator, supplied 26,141,343-byte JSON (11,352 lines; longest line 58,901 bytes): cold EOF navigation/layout measured 14.34 ms wrapped and 96.92 ms unwrapped. Single-run timings exclude initial parsing.
  • Real slow drags, upward flings, reverse scrolling, Top/Bottom jumps, wrapping toggle, and Go to Line exercised. Inspected recordings showed filled viewports and colored first destination frames without observed layout discontinuities.

Limits: initial document parsing is unchanged, and a single exceptionally long logical line still requires sequential typesetting within that line. Scrollbar estimates can refine as more content is measured. Physical-device timing, interactive rotation, and scrolling with the full software keyboard were not verified; simulator captures are not a universal no-glitch guarantee.

@simonbs
simonbs merged commit df9b56f into main Oct 27, 2026
9 checks passed
@simonbs
simonbs deleted the codex/destination-local-layout branch October 27, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant