Repository navigation
Studio: open a long chat at its latest message on Chromium - #17351
Merged
Merged
Conversation
A distant row (distant-rows.ts) skipped or released while the chat is pinned to its bottom can move scrollTop up with scrollHeight unchanged by the scroll event. The autoscroll hook read that as the reader scrolling up and detached, so a 200-turn chat opened up to 23,000 px above its last message in about half the loads and chat switches. The hook now watches the distant attribute and treats such a move at a pinned bottom, with no key or pointer behind it, as a clamp.
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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
On Chromium (Chrome, Edge, the Windows app's WebView2), opening a long chat often lands far above its latest message: 4,000 to 23,000 px up, and it stays there. On main, in a Playwright harness with a 200-turn chat, 3 to 6 of 10 fresh loads and 3 to 4 of 10 switches from the sidebar ended up off the bottom; with the CPU throttled 4x, 6 of 18. WebKit was not affected (0 of 60).
Nothing in the page scrolls the thread when it happens (no input, no programmatic scroll). While older messages mount, the autoscroll hook holds the chat at its bottom. Then Chromium moves
scrollTopup by about 259 px whilescrollHeightreads unchanged at the scroll event: a row thatdistant-rows.ts(#16986) skips or releases (data-row-distant) at the bottom clamps the scroll position. The hook reads an upward move from the bottom with no height change as the user scrolling up and stops following, and every later batch of mounted messages keeps that offset.Forcing
content-visibility: visibleon message rows alone removes it (0 of 8); doing the same for code fences, reasoning or maths, or turning off smooth scroll, scroll anchoring or composer focus does not.Change
use-intent-aware-autoscroll.tsxonly:data-row-distant; a record for it marks that rows toggled since the last scroll event.Results
Same harness (production build, no input sent, distance from the bottom 5 s after all rows mounted), 200-turn chat, then sidebar switches to a 150-turn chat and back. Main ran twice as an A/A control:
Chromium, 2 rotated rounds of 5 per arm. An earlier run with 10 loads per arm, also on WebKit (Mac UA) and with a 4x CPU throttle, read the same way: main 14 and 10 of 30 off, this PR 0 of 30; throttled main 6 of 18, this PR 0 of 18; WebKit 0 everywhere.
Tests
tests/chat-autoscroll-shrink-intent.test.ts: new test for the row toggle case;tests/desktop-webkit-paths.test.tsupdated for the observer signature. The related autoscroll suites (81 tests) pass;tsc --noEmitclean.