Skip to content

fix(web): Fix auto-scroll issue in chat#2797

Merged
Aries-ckt merged 20 commits into
eosphoros-ai:mainfrom
WangzJi:fix/2796
Jul 9, 2025
Merged

fix(web): Fix auto-scroll issue in chat#2797
Aries-ckt merged 20 commits into
eosphoros-ai:mainfrom
WangzJi:fix/2796

Conversation

@WangzJi
Copy link
Copy Markdown
Contributor

@WangzJi WangzJi commented Jun 26, 2025

Description

Fixes #2796

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Snapshots:

Include snapshots for easier review.
Xnip2025-06-26_10-51-13
image

Checklist:

  • My code follows the style guidelines of this project
  • I have already rebased the commits and make the commit message conform to the project standard.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules

@github-actions github-actions Bot added fix Bug fixes web Module: web labels Jun 26, 2025
@WangzJi WangzJi changed the title fix(web): Fix auto-scroll issue in chat dashboard fix(web): Fix auto-scroll issue in chat dashboard Jun 26, 2025
@WangzJi
Copy link
Copy Markdown
Contributor Author

WangzJi commented Jun 27, 2025

@chenliang15405 @fangyinc
PTAL.

@chenliang15405
Copy link
Copy Markdown
Collaborator

chenliang15405 commented Jun 27, 2025

CleanShot 2025-06-27 at 16 44 32

hi @WangzJi , It seems that a little problem with viewing the historical messages. it can't scroll. would you fix it?

@WangzJi
Copy link
Copy Markdown
Contributor Author

WangzJi commented Jun 27, 2025

Thanks for pointing it out! I’ll look into it and get it fixed.

@WangzJi WangzJi marked this pull request as draft June 27, 2025 09:24
WangzJi added 4 commits June 27, 2025 21:02
… scroll

- Fix timing issues in state reset for new messages
- Reset scroll tracking states immediately instead of delayed reset
- Ensure streaming content scrolling works consistently after new messages
- Set proper height baseline for accurate content change detection
- Prevent race conditions between user scroll detection and auto-scroll
@WangzJi WangzJi marked this pull request as ready for review June 30, 2025 02:55
@WangzJi
Copy link
Copy Markdown
Contributor Author

WangzJi commented Jun 30, 2025

@chenliang15405
I think I’ve fixed it. PTAL.

@WangzJi WangzJi marked this pull request as draft June 30, 2025 09:48
@WangzJi WangzJi marked this pull request as ready for review June 30, 2025 09:49
@WangzJi WangzJi marked this pull request as draft June 30, 2025 10:16
WangzJi added 2 commits June 30, 2025 20:11
- Implement MutationObserver for real-time DOM change detection
- Add triple-layer scroll guarantee: height detection + force check + backup timer
- Optimize architecture: separate scroll logic between container and content components
- Add intelligent user experience: respect manual scrolling with 100px threshold
- Fix second message scroll failure and streaming mode timeout issues
- Support both new chat mode and dashboard mode scenarios
@WangzJi WangzJi marked this pull request as ready for review June 30, 2025 12:13
@WangzJi
Copy link
Copy Markdown
Contributor Author

WangzJi commented Jun 30, 2025

g2

@WangzJi WangzJi marked this pull request as draft July 1, 2025 02:07
@WangzJi WangzJi marked this pull request as ready for review July 1, 2025 03:07
@WangzJi
Copy link
Copy Markdown
Contributor Author

WangzJi commented Jul 2, 2025

@chenliang15405 @fangyinc
Is there anything else I need to do regarding this PR?

Comment thread web/new-components/chat/ChatContentContainer.tsx Outdated
@chenliang15405
Copy link
Copy Markdown
Collaborator

666babfcf0bb7dcc76af562eb4edefe2
Smooth" can cause the animation at the bottom of the page not pretty good

WangzJi added 5 commits July 2, 2025 20:42
- Fix memory leak in ChatContentContainer by properly managing requestAnimationFrame
- Fix scroll control issue in chat_dashboard mode where user scroll was ignored during streaming
- Optimize performance by reducing unnecessary useEffect triggers
- Remove global scrollBehavior CSS to avoid conflicts
- Update Chinese comments to English
- Improve scroll consistency across different chat modes
@WangzJi WangzJi requested a review from chenliang15405 July 3, 2025 06:18
@WangzJi WangzJi changed the title fix(web): Fix auto-scroll issue in chat dashboard fix(web): Fix auto-scroll issue in chat Jul 3, 2025
Comment thread web/components/chat/completion.tsx Outdated
chenliang15405
chenliang15405 previously approved these changes Jul 4, 2025
Copy link
Copy Markdown
Collaborator

@chenliang15405 chenliang15405 left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread web/new-components/chat/input/ChatInputPanel.tsx
Copy link
Copy Markdown
Collaborator

@chenliang15405 chenliang15405 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Collaborator

@Aries-ckt Aries-ckt left a comment

Choose a reason for hiding this comment

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

r+

@Aries-ckt Aries-ckt merged commit 3f60470 into eosphoros-ai:main Jul 9, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fixes web Module: web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [Web] Chat Auto-scroll

3 participants