Skip to content

fix(desktop): only auto-scroll when user is near the bottom#41

Open
JackyCufe wants to merge 1 commit into
OrionStarAI:opensourcefrom
JackyCufe:fix/desktop-smart-auto-scroll
Open

fix(desktop): only auto-scroll when user is near the bottom#41
JackyCufe wants to merge 1 commit into
OrionStarAI:opensourcefrom
JackyCufe:fix/desktop-smart-auto-scroll

Conversation

@JackyCufe

@JackyCufe JackyCufe commented Jun 29, 2026

Copy link
Copy Markdown

Problem

ChatPane unconditionally called scrollIntoView on every transcript change, yanking the user back to the bottom while they were reading history. This made it impossible to scroll up and review earlier messages while the AI was still responding.

Fix

Track scroll position with a ref (atBottomRef). The auto-scroll effect now only fires when the user is within 80px of the bottom. If they have scrolled up to read history, new streaming content is appended without pulling them back down.

Sending a new message always resets to bottom — the user own action implies they want to see the response.

Verification

  • AI streaming response auto-scrolls when user is at bottom
  • Scrolling up during AI response — view stays put, no yank back
  • Sending a new message — view jumps to bottom
  • Scrolling back to bottom — auto-scroll resumes

Files Changed

  • packages/desktop/src/renderer/src/components/panes/ChatPane.tsx (+38, -2)

ChatPane unconditionally called scrollIntoView on every transcript change,
yanking the user back to the bottom while they were reading history.

Track scroll position with a ref: if the user is within 80px of the bottom,
auto-scroll on new content; otherwise leave them where they are. Sending a
new message always resets to bottom (the user's own action implies they
want to see the response).
@JackyCufe JackyCufe force-pushed the fix/desktop-smart-auto-scroll branch from 4bae0be to b23ac46 Compare June 29, 2026 07:33
@JackyCufe JackyCufe changed the title fix(desktop): only auto-scroll chat when user is near the bottom fix(desktop): only auto-scroll when user is near the bottom Jun 29, 2026
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