Skip to content

Conversation

@joshka-oai
Copy link
Collaborator

Mouse/trackpad scrolling in tui2 applies deltas in visual lines, but the transcript scroll state was anchored only to CellLine entries.

When a 1-line scroll landed on the synthetic inter-cell Spacer row (inserted between non-continuation cells), TranscriptScroll::anchor_for would skip that row and snap back to the adjacent cell line. That makes the resolved top offset unchanged for small/coalesced scroll deltas, so scrolling appears to get stuck right before certain cells (commonly user prompts and command output cells).

Fix this by making spacer rows a first-class scroll anchor:

  • Add TranscriptScroll::ScrolledSpacerBeforeCell and resolve it back to the spacer row index when present.
  • Update anchor_for/scrolled_by to preserve spacers instead of skipping them.
  • Treat the new variant as "already anchored" in lock_transcript_scroll_to_current_view.

Tests:

  • cargo test -p codex-tui2

Base automatically changed from joshka/tui2-transcript-view-cache to main January 3, 2026 19:44
@joshka-oai joshka-oai enabled auto-merge (squash) January 3, 2026 19:45
Mouse/trackpad scrolling in tui2 applies deltas in visual lines, but the transcript
scroll state was anchored only to CellLine entries.

When a 1-line scroll landed on the synthetic inter-cell Spacer row (inserted
between non-continuation cells), `TranscriptScroll::anchor_for` would skip that
row and snap back to the adjacent cell line. That makes the resolved top offset
unchanged for small/coalesced scroll deltas, so scrolling appears to get stuck
right before certain cells (commonly user prompts and command output cells).

Fix this by making spacer rows a first-class scroll anchor:
- Add `TranscriptScroll::ScrolledSpacerBeforeCell` and resolve it back to the
  spacer row index when present.
- Update `anchor_for`/`scrolled_by` to preserve spacers instead of skipping them.
- Treat the new variant as "already anchored" in
  `lock_transcript_scroll_to_current_view`.

Tests:
- cargo test -p codex-tui2
@joshka-oai joshka-oai force-pushed the joshka/fix-scroll-stickiness branch from 59f5970 to cfd41fc Compare January 3, 2026 20:11
@joshka-oai joshka-oai merged commit 279283f into main Jan 3, 2026
26 checks passed
@joshka-oai joshka-oai deleted the joshka/fix-scroll-stickiness branch January 3, 2026 20:26
@github-actions github-actions bot locked and limited conversation to collaborators Jan 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants