Skip to content

Keep revision continuity off focus the reader scrolled away from - #2311

Merged
max-sixty merged 2 commits into
mainfrom
continuity-focus-in-view
Oct 10, 2026
Merged

max-sixty merged 2 commits into
mainfrom
continuity-focus-in-view

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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. 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 asks focusedInView, as does restoreView's fallback to the focused region.
  • restoreEditingContinuity puts 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, 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.

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 an lf-diff outlet 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 by scroll: false; neither has a reproduction.

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 from 227px to 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. The thread-reading and user-place runtime tests pass.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits October 10, 2026 14:27
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]>
@max-sixty
max-sixty merged commit 0e498d8 into main Oct 10, 2026
6 checks passed
@max-sixty
max-sixty deleted the continuity-focus-in-view branch October 10, 2026 23:20
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