Maintain scroll position on container resize - #10944
Merged
Merged
Conversation
…tainer resize Replace the custom event approach for resuming auto-scroll when the permission dock disappears. Instead, observe the scroll container's dimensions directly via createResizeObserver in the auto-scroll hook, eliminating the coupling between ChatView and MessageList through window events. The scroll ref is now tracked in the store to enable resize observation alongside the existing content observer.
imanolmzd-svg
enabled auto-merge (squash)
June 5, 2026 10:46
iscekic
approved these changes
Jun 5, 2026
t7tran
pushed a commit
to t7tran/kilocode
that referenced
this pull request
Aug 14, 2026
…tainer resize (Kilo-Org#10944) Replace the custom event approach for resuming auto-scroll when the permission dock disappears. Instead, observe the scroll container's dimensions directly via createResizeObserver in the auto-scroll hook, eliminating the coupling between ChatView and MessageList through window events. The scroll ref is now tracked in the store to enable resize observation alongside the existing content observer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #10741
Why
If the user had intentionally scrolled up before approving or rejecting a permission, handling that permission could unexpectedly move them to the bottom.
Implementation
Replace the custom event approach for resuming auto-scroll when the permission dock disappears.
Instead, observe the scroll container's dimensions directly via createResizeObserver in the auto-scroll hook, eliminating the coupling between ChatView and MessageList through window events. The scroll ref is now tracked in the store to enable resize observation alongside the existing content observer.
Screenshots / Video
Before
before-permission-scroll-fix.mov
After
after-permission-scroll-fix.mov
Testing