fix(desktop): proper scroll after closing sticky accordion#16510
Open
neriousy wants to merge 7 commits intoanomalyco:devfrom
Open
fix(desktop): proper scroll after closing sticky accordion#16510neriousy wants to merge 7 commits intoanomalyco:devfrom
neriousy wants to merge 7 commits intoanomalyco:devfrom
Conversation
# Conflicts: # packages/ui/src/components/message-part.tsx # packages/ui/src/components/session-turn.tsx
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes scroll “jump” when closing a sticky accordion by pinning the scroll container to the closing header’s previous viewport position, and wires this behavior into the desktop diff accordions.
Changes:
- Added a sticky-accordion utility (
pinSticky*) to preserve scroll position across accordion open/close. - Updated
StickyAccordionHeaderto forward arefso callers can track header elements. - Adopted the new pinned onChange handling in
SessionReviewand in tool accordions withinmessage-part.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ui/src/components/sticky-accordion.ts | New utilities to pin scroll position during accordion state changes. |
| packages/ui/src/components/sticky-accordion-header.tsx | Adds ref forwarding + prop splitting to support pinning logic. |
| packages/ui/src/components/session-review.tsx | Tracks header refs and uses pinStickyAccordionChange for diff accordion changes. |
| packages/ui/src/components/message-part.tsx | Applies pinned accordion change handling to tool accordions; introduces unused imports/component that should be cleaned up. |
| packages/app/src/hooks/use-providers.ts | Formatting-only change (blank line). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6 tasks
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.
Issue for this PR
Closes #16407
Type of change
What does this PR do?
When closing a sticky accordion proper scroll is maintained
How did you verify your code works?
Open file diff
Scroll down
Close file diff
Screenshots / recordings
2026-03-07.00-08-01.mp4
Checklist
If you do not follow this template your PR will be automatically rejected.