fix(web-ui): stop animating programmatic transcript scrolls - #959
Open
time-attack wants to merge 2 commits into
Open
fix(web-ui): stop animating programmatic transcript scrolls#959time-attack wants to merge 2 commits into
time-attack wants to merge 2 commits into
Conversation
The transcript scroller had scroll-behavior: smooth, so every programmatic scroll-to-bottom animated. When a run ended with a pending approval the transcript redrew and re-stuck to the bottom, and because the scroller started at the top the browser animated the entire way down. Smooth scrolling only affects programmatic scrolls, never user input, so drop it and delete the three sites that toggled the style off and back on to work around it.
Both earlier-messages loaders captured scrollTop and scrollHeight, rebuilt the transcript, then re-derived scrollTop from the height delta with the same inline block. Review flagged the pair as drift-prone once the smooth scroll workaround was gone. One helper now holds the anchor and returns the restore step; the layout test asserts both paths go through it instead of counting copies.
Collaborator
Author
|
Independent review pass (code-review, medium, eight angles) on the first commit found no correctness issues. Two cleanups it raised are applied in the follow-up commit:
Confirmed root cause from the altitude angle: Left as pre-existing and out of scope: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a run ended with a pending approval, the web-ui transcript visibly scrolled from the top of the conversation all the way to the bottom as an animation.
The transcript scroller (
.chat-scroll) hadscroll-behavior: smooth. That property only affects programmatic scrolls (assigningscrollTop), never wheel or trackpad input. Every redraw that re-sticks the transcript to the bottom therefore animated, and when the scroller had been rebuilt at the top the animation covered the whole conversation.Change
scroll-behavior: smoothfrom.chat-scroll.style.scrollBehaviortoautoand back to dodge the animation (forced scroll-to-bottom, and both pagination anchor adjustments). They are now plainscrollTopwrites.scrollBehaviorjuggling inchat.ts, and still asserts both pagination anchors exist.Net: 5 insertions, 20 deletions.
Demo
Behavior-only change: the after state renders pixel-identical to before, the difference is that scroll-to-bottom is now instant instead of animated. No screenshot can show it, so none attached. To see it: open a long conversation, trigger a run that ends in an approval, and observe the transcript snaps to the pending approval instead of animating from the top.
Verification
plugins/web-ui:layout-thrash,tab-switch-scroll-snap,pane-approval-overflowtests pass.plugins/web-uitypecheck passes; eslint clean on changed files.Not in this PR
The screenshot that prompted this also asked for an "allow always" option on security-screen quarantine releases. Those are deliberately once-only in the orchestrator (server-side guard plus tests). The existing knob is the
security-postureadmin resource (dangerousdisables content screening). Left unchanged here.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.