Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

fix(desktop): proper scroll after closing sticky accordion#16510

Open
neriousy wants to merge 7 commits intoanomalyco:devfrom
neriousy:fix/sticky-accordion-scroll-issue
Open

fix(desktop): proper scroll after closing sticky accordion#16510
neriousy wants to merge 7 commits intoanomalyco:devfrom
neriousy:fix/sticky-accordion-scroll-issue

Conversation

@neriousy
Copy link
Contributor

@neriousy neriousy commented Mar 7, 2026

Issue for this PR

Closes #16407

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

neriousy added 4 commits March 7, 2026 00:01
# Conflicts:
#	packages/ui/src/components/message-part.tsx
#	packages/ui/src/components/session-turn.tsx
@neriousy neriousy requested a review from adamdotdevin as a code owner March 7, 2026 19:41
Copilot AI review requested due to automatic review settings March 7, 2026 19:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 StickyAccordionHeader to forward a ref so callers can track header elements.
  • Adopted the new pinned onChange handling in SessionReview and in tool accordions within message-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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hiding file diffs makes scroll behave weirdly (app / desktop)

2 participants