Skip to content

fix: chat auto-follow overscroll causing bottom shake during inline stream updates#1700

Merged
zerob13 merged 3 commits into
devfrom
copilot/bugfix-ui-message-update-shake
May 29, 2026
Merged

fix: chat auto-follow overscroll causing bottom shake during inline stream updates#1700
zerob13 merged 3 commits into
devfrom
copilot/bugfix-ui-message-update-shake

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 28, 2026

When assistant output streams into an existing bottom-near message, the chat viewport could overshoot and create transient extra scrollable space, causing visible “shake” at the bottom edge. This PR tightens bottom-follow math so incremental same-line updates stay pinned without scrollbar jitter.

  • Root-cause correction: bottom-follow target

    • Updated ChatPage auto-scroll to use the real max scroll offset (scrollHeight - clientHeight) instead of assigning scrollHeight directly.
    • Prevents overscroll-like behavior during rapid stream revisions near the bottom.
  • Behavioral guardrail: focused regression test

    • Added a ChatPage test that simulates near-bottom streaming growth and asserts the resulting scrollTop equals the computed max offset.
// before
el.scrollTop = nextScrollHeight

// after
el.scrollTop = Math.max(nextScrollHeight - el.clientHeight, 0)

Copilot AI linked an issue May 28, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix UI message update causing bottom overflow Fix chat auto-follow overscroll causing bottom shake during inline stream updates May 28, 2026
Copilot AI requested a review from zhangmo8 May 28, 2026 12:59
@zhangmo8 zhangmo8 marked this pull request as ready for review May 29, 2026 00:03
@zerob13 zerob13 changed the title Fix chat auto-follow overscroll causing bottom shake during inline stream updates fix: chat auto-follow overscroll causing bottom shake during inline stream updates May 29, 2026
@zerob13 zerob13 merged commit 81252ee into dev May 29, 2026
3 checks passed
@zhangmo8 zhangmo8 deleted the copilot/bugfix-ui-message-update-shake branch May 29, 2026 05:44
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.

[BUG] ui: message update shake

3 participants