Set animated as true by default in maintainScrollAtEnd#382
Set animated as true by default in maintainScrollAtEnd#382skrtdev wants to merge 1 commit intoLegendApp:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request changes the default animation behavior for the maintainScrollAtEnd feature by modifying the animated parameter passed to doMaintainScrollAtEnd from false to true across all call sites. The goal is to provide a smoother user experience with animated scrolling when maintaining scroll position at the end of a list (e.g., in chat interfaces).
Key Changes:
- Changed the
animatedparameter fromfalsetotruein all three calls todoMaintainScrollAtEnd - This affects scroll behavior during item layout changes, container layout updates, and data changes
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/core/updateItemSize.ts | Updated doMaintainScrollAtEnd call to use animated: true when item sizes change |
| src/core/handleLayout.ts | Updated doMaintainScrollAtEnd call to use animated: true during layout changes |
| src/core/checkResetContainers.ts | Updated doMaintainScrollAtEnd call to use animated: true when data changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (shouldMaintainScrollAtEnd) { | ||
| if (maintainScrollAtEnd === true || (maintainScrollAtEnd as MaintainScrollAtEndOptions).onItemLayout) { | ||
| doMaintainScrollAtEnd(ctx, state, false); | ||
| doMaintainScrollAtEnd(ctx, state, true); |
There was a problem hiding this comment.
The PR description mentions "this should be decided by the user," but the MaintainScrollAtEndOptions interface does not include an animated property. Users currently have no way to control whether the scroll animation is enabled or disabled when maintainScrollAtEnd is triggered. Consider adding an animated?: boolean property to the MaintainScrollAtEndOptions interface to allow users to override the default behavior.
I think that this should be decided by the user, but the default should be true as well