Repository navigation
Keep revision continuity off focus the reader scrolled away from - #2311
Merged
Merged
Conversation
Two revision-continuity readers in `version.js` still took raw focus as the user's place. #2285 gave that rule one owner, `focusedInView()`: a focused control marks where the user is only while it is in front of them. - `activeReadingRegion` ranked the focused region first. Where regions share the page scroller, the active one's reading restores that scroller, so focus left in a pane the reader had scrolled past took them back to it. Two panes in flow at 390px, a textarea focused in the first, the reader wheeled into the second: a revision adding five paragraphs sent the paragraph they read from 227px to 3056px. It now asks `focusedInView`, as does `restoreView`'s fallback to the focused region. - `restoreEditingContinuity` re-lands focus in a reply box a revision replaced through the ordinary Thread route, which scrolls the box into view. A reader who wrote in the first of 40 threads in the Threads panel and scrolled the list to 790px was returned to 0 by a fresh-document revision. Continuity now records whether the box was in view, and `replyDestination`, `openPageThread` and `showThread` take `scroll: false`, which presents and focuses the box while moving no scroller and taking no trip. Focus and words still return to the new box. Margin-card and widget-seat replies did not move the page in the same reproduction, since their routes land without page travel. Testing: - `test_executable_revision_keeps_a_reader_who_scrolled_away_from_their_reply` is new; without the change the list ends at 0 instead of 790. - `test_a_revision_keeps_the_pane_read_over_a_pane_holding_offscreen_focus` is new; without the change the paragraph moves 227px -> 3056px. - 41 neighbouring browser tests (executable revisions, reading places, postures, live revisions, primary reader replacement) pass; `test_a_live_revision_reorders_the_page_and_ask_inventory_together` fails identically on the base. thread-reading and user-place runtime tests pass. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two revision-continuity readers in
version.jsstill took raw focus as the user's place. #2285 gave that rule one owner,focusedInView(): a focused control marks where the user is only while it is in front of them.activeReadingRegionranked the focused region first. Where regions share the page scroller, the active one's reading restores that scroller, so focus left in a pane the reader had scrolled past took them back to it. With two panes in flow at 390px, a textarea focused in the first, and the reader scrolled on into the second, a revision adding five paragraphs moved the paragraph they read from 227px to 3056px. It now asksfocusedInView, as doesrestoreView's fallback to the focused region.restoreEditingContinuityputs focus back in a reply box that a revision replaced, through the ordinary Thread route, which scrolls the box into view. A reader who wrote in the first of 40 threads in the Threads panel and scrolled the list to 790px was returned to 0 by a fresh-document revision. Continuity now records whether the box was in view, andreplyDestination,openPageThreadandshowThreadtakescroll: false, which presents and focuses the box while moving no scroller and taking no trip. Focus and words still return to the new box. Margin-card and widget-seat replies did not move the page in the same reproduction, since their routes land without page travel.Not changed:
holdReply, which re-lands a reply box that an in-document repaint replaced, still scrolls by default. Its likeliest case, a reply in anlf-diffoutlet that a data update replaces after the reader scrolled away, left the reader's paragraph in place when tried, so it has no failing case yet. Reveals that run before the box is shown (opening a tab, clearing a Threads filter) are not governed byscroll: false; neither has a reproduction.Testing:
test_executable_revision_keeps_a_reader_who_scrolled_away_from_their_replyis new; without the change the list ends at 0 instead of 790.test_a_revision_keeps_the_pane_read_over_a_pane_holding_offscreen_focusis new; without the change the paragraph moves from 227px to 3056px.test_a_live_revision_reorders_the_page_and_ask_inventory_togetherfails identically on the base. The thread-reading and user-place runtime tests pass.