fix: playground does not scroll down to the latest user message upon sending (Regression)#12006
fix: playground does not scroll down to the latest user message upon sending (Regression)#12006deon-sanchez wants to merge 2 commits intomainfrom
Conversation
WalkthroughThe change refactors the stick-to-bottom scrolling mechanism in the sliding container component by introducing a managed instance via the useStickToBottom hook. An effect automatically scrolls to the bottom when chat messages are added, and the StickToBottom component receives the instance through props instead of inline configuration attributes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 4❌ Failed checks (1 error, 3 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (40.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #12006 +/- ##
=======================================
Coverage 37.32% 37.33%
=======================================
Files 1592 1592
Lines 78279 78294 +15
Branches 11824 11826 +2
=======================================
+ Hits 29216 29228 +12
- Misses 47442 47446 +4
+ Partials 1621 1620 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Add custom event 'langflow-scroll-to-bottom' to force SafariScrollFix back into sticky mode when user sends a new message. This ensures the chat scrolls to bottom even if user had scrolled up, fixing behavior where Safari's scroll fix would remain disengaged after manual scrolling.
This pull request improves the chat scrolling behavior in the
FlowPageSlidingContainerContentcomponent by ensuring the chat view automatically scrolls to the bottom whenever a new message is sent, even if the user has previously scrolled up. The implementation uses theuseStickToBottomhook for better scroll management and refactors how theStickToBottomcomponent is configured.Chat scrolling improvements:
useStickToBottomhook and its instance to manage scroll behavior, replacing direct prop usage on theStickToBottomcomponent.StickToBottomcomponent to use the createdstickyInstanceinstead of passingresizeandinitialprops directly, centralizing scroll control.Summary by CodeRabbit