Repository navigation
cmux-next agent pane: don't snap a small scroll-up back to the latest row - #16498
Conversation
Red: at the latest row of 200 rows, shrinking the viewport from 600 to 400 leaves scrollTop at 8400 against a new end of 8600, so the latest row's last 200px fall below the fold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RYQHfug1ZVQDp4eWgwVUtD
A shorter viewport doesn't move or clamp the offset, so the at-latest check against the new client height read a reader at the latest row as scrolled up. An offset that hasn't moved since it was recorded now keeps the recorded at-latest state. Green: bun test src/agent-session/ passes 146 of 146. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RYQHfug1ZVQDp4eWgwVUtD
…horter The fake viewport now reports scrollHeight. Red: at the latest row, scrolling up 10.75px and then having the latest row draw 10px shorter before the scroll event leaves the reader 0.75px above the new end. The clamp check's 1px tolerance reads that as a clamp and snaps to 8474 instead of keeping 8473.25. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RYQHfug1ZVQDp4eWgwVUtD
The clamp check allowed 1px under the layout's fractional end, to cover the browser rounding scrollHeight. That also caught a reader who had scrolled up within 1px of a new end that a row below had just shortened, and snapped them back to the latest row. A clamped offset lands exactly on scrollHeight - clientHeight, so the check now compares with that and allows half a pixel. Green: bun test src/agent-session/ passes 147 of 147. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RYQHfug1ZVQDp4eWgwVUtD
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
…snapback # Conflicts: # Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/Resources/agent-pane/index.html # webviews/src/agent-session/acpmux/App.tsx # webviews/src/agent-session/acpmux/transcript.test.tsx
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
|
Subagent review at e72c736: LGTM.
|
If a reader at the latest row of the agent pane scrolls up slightly while a row below finishes drawing shorter, they now stay where they scrolled. Until now the transcript could snap them back to the latest row.
The anchor effect detects when the browser has clamped the scroll offset after the content shrank. Before this change it treated any offset within 1px of the layout's fractional end as clamped, because the browser rounds
scrollHeight. That 1px also caught a real scroll-up of U when the shrink S satisfied S < U ≤ S + 1. A clamped offset lands exactly on the scroller's own end,scrollHeight - clientHeight, so the check now compares against that with a 0.5px allowance. This is a follow-up from the #16491 review.Stacked on #16497 (same layout effect). Once that merges, this branch takes feat-cmux-next and the diff narrows to the two commits below.
Validation
cd webviews && bun test src/agent-session/a small scroll-up at the latest row survives a row below drawing shorterfails. The reader scrolls up 10.75px, then the latest row draws 10px shorter. The view snaps to the new end, 8474, instead of staying at 8473.25. The fake viewport now reportsscrollHeight.bunx tsc --noEmit -p .andoxlint --deny-warningsare clean, andbuild-agent-pane-web.sh --checksays the bundle is current.Not checked in a running app. The test's fake viewport assumes a clamp lands exactly on
scrollHeight - clientHeight. WebKit keeps element scroll positions on whole pixels, so that should hold, but nobody has checked it live.Changelog
none (cmux-next is unreleased)
🤖 Generated with Claude Code
https://claude.ai/code/session_01RYQHfug1ZVQDp4eWgwVUtD
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes the agent pane snapping a small scroll-up back to the latest row when a row below draws shorter, and keeps the latest row in view when the viewport shrinks.
Bug Fixes
feat-cmux-nextchanges to keep this branch current.Written for commit e72c736. Summary will update on new commits.