[PR #11676] fix(app): scroll review tab into view when clicked while overflowed #13891

Open
opened 2026-02-16 18:18:43 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11676

State: open
Merged: No


closes #11674

What does this PR do?

  • Scrolls the clicked tab in review section into view when it's partially hidden on the right (accounting for the sticky "add" button)
  • No animation - instant scroll for better UX, consistent with behavior when clicked on tab that is partially hidden on the left

Before:

https://github.com/user-attachments/assets/5247e114-67ec-4a2b-b392-66d6f6388be2

After:

https://github.com/user-attachments/assets/e271c560-00a4-4c45-8bf8-a64e90f12f40

Changes:

  • session-sortable-tab.tsx: Added click handler to scroll file tabs
  • session.tsx: Added click handler to context tab + data attribute to sticky button
  • utils/dom.ts: Extracted scrollTabIntoView() function for DRY code

Testing:

  • test suite (e2e local) - no regression
  • Manual testing:
    1. Open multiple file tabs until they overflow
    2. Click on a tab that's partially hidden on the right
    3. Verify it scrolls into view instantly, close button is accessible
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11676 **State:** open **Merged:** No --- closes #11674 ### What does this PR do? - Scrolls the clicked tab in review section into view when it's partially hidden on the right (accounting for the sticky "add" button) - No animation - instant scroll for better UX, consistent with behavior when clicked on tab that is partially hidden on the left ## Before: https://github.com/user-attachments/assets/5247e114-67ec-4a2b-b392-66d6f6388be2 ## After: https://github.com/user-attachments/assets/e271c560-00a4-4c45-8bf8-a64e90f12f40 **Changes:** - `session-sortable-tab.tsx`: Added click handler to scroll file tabs - `session.tsx`: Added click handler to context tab + data attribute to sticky button - `utils/dom.ts`: Extracted `scrollTabIntoView()` function for DRY code **Testing:** - test suite (e2e local) - no regression - Manual testing: 1. Open multiple file tabs until they overflow 2. Click on a tab that's partially hidden on the right 3. Verify it scrolls into view instantly, close button is accessible
yindo added the pull-request label 2026-02-16 18:18:43 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13891