Skip to content

Rely on Virtuoso's onAtBottomStateChange for scroll locking#17728

Open
colin-grant-work wants to merge 2 commits into
masterfrom
feature/simpler-scroll-to-bottom
Open

Rely on Virtuoso's onAtBottomStateChange for scroll locking#17728
colin-grant-work wants to merge 2 commits into
masterfrom
feature/simpler-scroll-to-bottom

Conversation

@colin-grant-work

Copy link
Copy Markdown
Contributor

What it does

Simplifies the scroll lock mechanisms implemented for the AI chat view to depend on Virtuoso's own onAtBottomStateChanged callback mechanism. In testing, this seems to reduce scroll jiggle and be more reliable than the current implementation.

How to test

  1. In a chat with some content...
  2. Scrolling to the bottom of the chat should make the 'scroll to bottom' button disappear.
  3. Scrolling more than 30px from the bottom should make the 'scroll to bottom' appear.
  4. Adding content (user messages, agent responses) while at the bottom should result in the content at bottom being visible - i.e. scroll is locked to bottom.
  5. Adding content when not at the bottom should result in no scrolling - the visible content should be unchanged.
  6. Neither adding content while at bottom nor scrolling near the bottom should produce jiggles in scroll position.

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

@CamilleLetavernier CamilleLetavernier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Colin! The changes look good to me and seem to work fine so far.

The loss of directional check may have one downside: it can be difficult in some cases to get unstuck from the bottom, since you need to reach the 30px threshold to trigger scroll-lock (so it can be a bit tricky for slow scroll events while the LLM is still talking). But if this means the overall scroll behavior is more reliable and stable, then this is a reasonable trade-off.

@github-project-automation github-project-automation Bot moved this from Waiting on reviewers to Needs merge in PR Backlog Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs merge

Development

Successfully merging this pull request may close these issues.

2 participants