Skip to content

fix(web): stop chat jitter when opening citations at the bottom#1406

Draft
brendan-kellam wants to merge 2 commits into
mainfrom
brendan/sou-1486-chat-jitters-when-opening-citations-at-bottom-4767
Draft

fix(web): stop chat jitter when opening citations at the bottom#1406
brendan-kellam wants to merge 2 commits into
mainfrom
brendan/sou-1486-chat-jitters-when-opening-citations-at-bottom-4767

Conversation

@brendan-kellam

Copy link
Copy Markdown
Contributor

Fixes SOU-1486

Clicking a citation while scrolled to the bottom of a chat caused the view to jitter vertically (repeatedly, on every click).

The chat scroll container uses useStickToBottom. While the user is at (or within ~70px of) the bottom, the hook keeps the container anchored to the bottom and re-asserts that position whenever content resizes or scrolls. Selecting a citation kicks off a scrollIntoView (in chatThreadListItem.tsx) to reveal/center the reference, and useStickToBottom fights that scroll by yanking back to the bottom. The two compete for the scroll position for a frame or two on each click, which is the jitter. It only reproduces "at the bottom" because that's the only state where the stick-to-bottom lock is engaged.

Fix: release the stick-to-bottom lock (stopScroll()) when a citation reference is selected, so the reveal scroll can settle without a fight. This is the same state the hook enters when the user scrolls up manually, and it matches the intent of the interaction (you're now inspecting a citation, not following streaming output). Sending a new message re-engages auto-scroll as before.

When the chat is stuck to the bottom, selecting a citation triggers a
scroll-into-view that fights useStickToBottom's auto-scroll, causing the
view to jitter. Release the stick-to-bottom lock on citation selection so
the reveal scroll can settle.

Generated with [Linear](https://linear.app/sourcebot/issue/SOU-1486/chat-jitters-when-opening-citations-at-bottom#agent-session-fbed4bdc)

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dc84336b-4e1f-41b6-bf1e-a7a22e34f32a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch brendan/sou-1486-chat-jitters-when-opening-citations-at-bottom-4767

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

Comment @coderabbitai help to get the list of available commands.

Generated with [Linear](https://linear.app/sourcebot/issue/SOU-1486/chat-jitters-when-opening-citations-at-bottom#agent-session-fbed4bdc)

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
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