Skip to content

Keep turn rows keyed and scroll requests distinct in the virtual lists - #482

Merged
benschac merged 1 commit into
mainfrom
viewer/virtual-lists-review-fixes
Dec 1, 2026
Merged

benschac merged 1 commit into
mainfrom
viewer/virtual-lists-review-fixes

Conversation

@benschac

@benschac benschac commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Fixes what Codex's first review of #481 found:

  • Session rows are keyed by turn ID, so a focused tool button stays on its turn when the rendered window changes. Codex reproduced the focus jumping from turn 8 to turn 99 in Chromium.
  • The turn scroll request count is now its own field, turnScrollRequest, which is never reset. Before, clearing the ask on link navigation reset the ID to 1, and a list still in the page ignored the repeat.
  • Opening the code view clears the pending ask, so a turn asked for in an earlier visit is not scrolled to again.
  • Event and revision rows set value to their place in the whole list, so the numbers don't restart at 1 as rows leave the page.

Tests

  • A second link to the same turn makes request 2. The test fails if clearing the link resets the counter.
  • Reopening the code view after a hunk-mark ask renders the top of the session, not the old turn. The test fails without the clear in codeOn.

Review by Codex, round 2 (open, not fixed)

  • [P2] update.ts turnHighlighted: when a deep link names both a diff file and a turn in a session that is already cached, ReceivedPatch applies the link again and bumps turnScrollRequest. The list then scrolls back to the turn even if the reader has scrolled away while the diff loaded. Suggested fix: keep the request ID when the same pending link resolves again, and issue a new ID only for a new navigation or a different target. I stopped at two rounds, so this is left to the owner.

🤖 Generated with Claude Code

benschac commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner Author

benschac commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner Author

Merge activity

  • Dec 1, 5:00 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Dec 1, 5:03 PM UTC: Graphite rebased this pull request as part of a merge.
  • Dec 1, 5:03 PM UTC: @benschac merged this pull request with Graphite.

@benschac
benschac changed the base branch from viewer/virtual-lists to graphite-base/482 December 1, 2026 17:01
@benschac
benschac changed the base branch from graphite-base/482 to main December 1, 2026 17:01
Review of #481 found four problems the virtualized lists brought in:

- Session rows were not keyed by turn ID, so a focused tool button could
  move to another turn when the rendered window changed.
- Clearing the turn scroll on a link reset its request ID to 1, which a
  list still in the page ignored. The request count is now its own field,
  turnScrollRequest, and is never reset.
- A turn asked for in one visit to the code view was scrolled to again
  when the code view opened later. Opening the code view clears the ask.
- Ordered lists renumbered from 1 as rows left the page. Event and
  revision rows now carry their place in the whole list as value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@benschac
benschac force-pushed the viewer/virtual-lists-review-fixes branch from 02f5b93 to 418a7da Compare December 1, 2026 17:02
@benschac
benschac merged commit 04d15cd into main Dec 1, 2026
2 checks passed
benschac added a commit that referenced this pull request Dec 1, 2026
When a pending link resolves again because its patch or session arrived,
every step is applied again, and the turn step asked the session's turn
list to scroll once more. With a cached session the list had already
scrolled to the turn, so the second ask pulled the pane back to it even if
the reader had moved while the diff loaded. A link resolved again now keeps
turnScrollRequest when it names the same turn: the list waits for the turn,
so the first ask is enough. Found by Codex's second review of #482.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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