Skip to content

feat: add scroll-to-bottom control for chat sessions - #65

Closed
oa1mgo wants to merge 1 commit into
agegr:mainfrom
oa1mgo:fix/issue-59-scroll-to-bottom
Closed

oa1mgo wants to merge 1 commit into
agegr:mainfrom
oa1mgo:fix/issue-59-scroll-to-bottom

Conversation

@oa1mgo

@oa1mgo oa1mgo commented Jun 8, 2026 •

Copy link
Copy Markdown

Summary

Fixes #59.

This PR updates the chat scroll behavior so the view no longer jumps to the bottom after a response completes when the user has scrolled away from the latest message.

It also keeps the chat pinned to the latest message when new or streaming content arrives while the user is already at the bottom.

It adds a lightweight scroll-to-latest control that appears when the user is away from the bottom of the conversation, and removes the previous running-state bottom spacer that pushed the message list upward while the agent was active.

Changes

  • Track whether the chat viewport is near the bottom before auto-scrolling
  • Preserve the user's reading position while an agent response is streaming or completing
  • Keep the chat pinned to the latest message when new or streaming content arrives while the user is already at the bottom
  • Remove the running-state bottom spacer and last-user-message scroll anchoring
  • Add a centered scroll-to-bottom button for returning to the latest message
  • Hide the button naturally once the viewport reaches the bottom

Testing

  • node_modules/.bin/tsc --noEmit
  • npm run lint
  • Manually verified the scroll button appears, scrolls smoothly to the latest message, does not flicker on click, and preserves bottom auto-follow for new messages

@oa1mgo
oa1mgo marked this pull request as ready for review June 8, 2026 17:01
@oa1mgo
oa1mgo force-pushed the fix/issue-59-scroll-to-bottom branch from 9aa4c3c to 322b518 Compare June 8, 2026 17:31
@oa1mgo
oa1mgo force-pushed the fix/issue-59-scroll-to-bottom branch from 322b518 to 48791d6 Compare June 8, 2026 17:40
cnbattle added a commit to cnbattle/pi-web that referenced this pull request Jun 23, 2026
…upstream

PR agegr#83: fix extension/package tools available in pi-web new sessions
PR agegr#80: load extension models in web model selector
PR agegr#78: add ToolsConfig panel with individual tool toggles
PR agegr#65: add scroll-to-bottom control for chat sessions
PR agegr#75: add rehype-raw plugin to render HTML tables in markdown
PR agegr#76: fix stack overflow on large session files (+TTL cache)
@agegr

agegr commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Thanks for tackling #59.

I’m going to hold off on merging this PR as-is. The fix solves the jump-to-bottom problem, but it also removes the existing streaming-time bottom spacer and the behavior that anchors the latest user message near the top while the agent is responding. I’d like to keep that interaction model.

I’ll address this in a follow-up version with a smaller change: preserve the current streaming layout, but if the user has scrolled up to read earlier content, the chat should not jump to the latest message when the response finishes.

So I think the fix should be scoped to the completion-time auto-scroll, rather than replacing the existing streaming scroll behavior. Thanks again for the thoughtful work.

@agegr agegr closed this Jun 23, 2026
c-with pushed a commit to c-with/pi-web that referenced this pull request Sep 30, 2026
…dcodes

refactor: derive auth-provider login options from SDK data
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.

Avoid Auto-Scrolling to Bottom After Response Completion

2 participants