Skip to content

test(app): read the tab-switch scroll regression as a reader would, at a loaded runner's speed - #4483

Merged
devswha merged 2 commits into
mainfrom
fix/tab-switch-scroll-main-red
Nov 22, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/tab-switch-scroll-main-red

Conversation

@devswha

@devswha devswha commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Summary

scripts/tab-switch-keeps-scroll-demo-regression.ts (added with #4155) failed main's CI run 45068560928 twice at its second-trip check ("a desktop: the second trip keeps the scroll offset (8471 → 8720)"); the next run on main passed. The app is not at fault; the script was timing-dependent:

  • It set scrollTop by hand, which the chat treats as no reader input. On a loaded runner the chat kept following its end, so the "reader" was really at the bottom (8471 = 9160 − 689). When the demo agent finished its turn, the chat followed the new end and the exact-offset check read 8720.
  • Under a 4x CPU throttle it fails 3 of 3 runs locally, on current main and on 00f9622 (before fix(chat): follow-ups from chat design pass review (#3458) #4472); unthrottled it passes.

Changes, script only:

  • f42e06d runs Chrome at a 4x CPU throttle, so the script fails on main as it did in CI.
  • b33a65a reads up with the wheel, waits for the list to stop moving and checks the reader is away from the end; keeps each pane's first answer so the finished turn does not grow the transcript above the reader; the second trip checks the same top row as the first return.

Validation

  • The script: 6 of 6 green before the commit, 3 of 3 on b33a65a (4x throttle).
  • bun run check fast on b33a65a: green.

Test-only: no app code changes.

🤖 Generated with Claude Code

devswha and others added 2 commits November 23, 2026 06:18
… speed

Main's browser lane failed this script twice at the second trip's scroll check
(8471 -> 8720) and it passed locally. With Chrome's CPU throttled 4x, as a
loaded runner is, it fails every time here too: the chat's rows above the
reader are measured after the place was read, the transcript grows by 188 to
249 px and the list keeps the reader's row by moving scrollTop, so the raw
offset differs although the same row is at the top.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ll checks

The regression set scrollTop by hand and dispatched a scroll event. ChatView
takes a scroll it saw no reader input for as the list's own, so on a loaded
runner the chat went on following its end: the "reader" was at the bottom
(8471 = 9160 - 689 in main's failing run), the demo's agent then finished its
turn, the chat followed the new end, and the second trip's exact scrollTop
check read 8720. The reader now scrolls up with the wheel, the place is read
once the list holds still and must be away from the end, the long history
keeps each pane's first answer (the finished turn repeated in every round grew
the transcript above the reader too), and the second trip checks the row the
reader left, as the first return does, instead of an exact scrollTop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Expanded the tab-switch scrolling regression demo to simulate reader scrolling and verify the visible transcript row after switching tabs.
    • Added checks for stable transcript dimensions and scrolling away from the end, including a second-trip check that does not require an identical scroll offset.

The regression demo now uses mouse-wheel input to scroll chat views, waits for scroll measurements to stabilize, and checks the visible top row after tab switches. It also repeats each pane’s first nonempty conversation response across 14 rounds and throttles CPU during the browser test.

Changes: Chat scroll retention regression

Layer / File(s) Summary
Set up and verify reader scrolling
scripts/tab-switch-keeps-scroll-demo-regression.ts
The test records the chat viewport height and repeats the first nonempty response for each pane. It uses wheel input and waits for stable scroll measurements before checking the reader’s position. After the second tab-switch trip, it verifies that the same top row remains visible instead of requiring the scroll offset to remain nearly unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

  • devswha/ovis#4155: This PR introduced the tab-switch scroll regression checks that this change updates.
  • devswha/ovis#4197: This PR defines how wheel input is treated as reader input, which the updated test uses.

Suggested reviewers: shunamxiao

Merge Risk: Minimal · up to b33a6

This updates a test script to make a tab-switch scroll regression check more reliable under load. It does not change app code, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the tab-switch scroll regression test is reworked to read as a reader would (wheel scrolling, stable-list waits) and to run at a loaded runner's speed (4x CPU throttle…
Description check Passed The description follows the template's Change and Validation sections. Change explains the CI failure (hand-set scrollTop not treated as reader input, 8471 to 8720 exact-offset check), the 4x CPU thro…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the tab-switch scroll regression test is reworked to read as a reader would (wheel scrolling, stable-list waits) and to run at a loaded runner's speed (4x CPU throttle). It is specific and matches the changeset, which only touches the test script.

Full details: Description check

Explanation

The description follows the template's Change and Validation sections. Change explains the CI failure (hand-set scrollTop not treated as reader input, 8471 to 8720 exact-offset check), the 4x CPU throttle, and the per-commit script changes. Validation lists the checks run (script runs, 6 of 6 and 3 of 3 under throttle, and bun run check fast). It does not state whether HTTP/WS contract-test coverage applies. It also does not mention the changelog.d/ entry the template references, though that may not be needed for a test-only change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4845dcd and b33a65a.

Files selected for processing: 1

  • scripts/tab-switch-keeps-scroll-demo-regression.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@devswha
devswha merged commit 86214b4 into main Nov 22, 2026
15 checks passed
@devswha

devswha commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head b33a65ad2. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit reviewed this head.

@devswha
devswha deleted the fix/tab-switch-scroll-main-red branch November 22, 2026 21:52
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