Skip to content

fix(ui): keep the editor cross-highlight in view on large documents - #589

Merged
smunini merged 1 commit into
mainfrom
fix/editor-sync-reveal
Aug 19, 2026
Merged

fix(ui): keep the editor cross-highlight in view on large documents#589
smunini merged 1 commit into
mainfrom
fix/editor-sync-reveal

Conversation

@angela-helios

Copy link
Copy Markdown
Contributor

Manual-review follow-up to #573: the cross-highlight works, but on a large document the highlighted counterpart could sit far off screen — both editor panes grew with their content, the page scrolled, and the reveal that keeps the counterpart visible had no scrollbar of its own to move.

The fix

  • Both panes become viewport-bound scroll columns (70vh, own overflow) — a big resource scrolls inside its column, side by side, and the reveal always has somewhere to act. This also matches how the design treats the two views: parallel panels over one document, not one endless page.
  • The one missing reveal direction is wired: hovering a JSON line now brings the matched form row into its pane's viewport (row→JSON and the raw-mode caret already did this).

Tests

A new spec overflows both panes with a 40-identifier Patient and asserts both directions: hovering the deepest form row scrolls the JSON pane until the lit line sits inside its visible box, and hovering a deep JSON line scrolls the tree to the matched row. Writing it caught a real timing subtlety — leaving raw mode shows the previous fold view before the re-render lands, so the spec waits for the new document's rows (worth knowing for future editor specs).

Full hermetic suite: 141 passed.

With a big resource, both editor panes grew with their content and the page
scrolled instead — so the reveal that keeps the highlighted counterpart
visible had no scrollbar to move, and hovering a row lit JSON lines far off
screen (#573 follow-up). Both panes are now viewport-bound scroll columns
(70vh), each scrolling independently, and the one missing reveal direction is
wired: hovering a JSON line also brings the matched form row into its pane's
viewport. Covered by a spec that overflows both panes with a 40-identifier
Patient and asserts the counterpart lands inside the visible pane both ways.
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@smunini
smunini merged commit 23e6e86 into main Aug 19, 2026
21 checks passed
@smunini
smunini deleted the fix/editor-sync-reveal branch August 19, 2026 21:44
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.

2 participants