Skip to content

tab: Scroll a clicked tab into view with the next one peeking - #3419

Merged
madcodelife merged 2 commits into
mainfrom
tab-click-reveal
Oct 8, 2026
Merged

madcodelife merged 2 commits into
mainfrom
tab-click-reveal

Conversation

@madcodelife

@madcodelife madcodelife commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Description

When a TabBar overflows, clicking a partially hidden tab selects it but leaves it clipped, so there is no way to keep moving through the strip except by scrolling manually.

Clicking a tab (or picking it from the overflow menu) now scrolls it into view with part of the neighboring tab showing, animated with the same spring as the selection indicator. This also works when track_scroll is not used.

As agreed in #3021, only a click does this: changing the selection, the tabs or the layout still leaves the offset where the user put it, and a wheel or trackpad scroll during the animation takes over immediately. Reduced motion skips the animation.

Screenshot

Before After
tabs-before.mp4
tabs-after.mp4

How to Test

Run cargo run -- tabs, add tabs in Dynamic Tabs until the bar overflows, then click the clipped tabs at either edge.

Checklist

  • I have read the CONTRIBUTING document and followed the guidelines.
  • Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate.
  • Passed cargo run for story tests related to the changes.
  • Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)

@madcodelife
madcodelife merged commit 02daace into main Oct 8, 2026
16 checks passed
@madcodelife
madcodelife deleted the tab-click-reveal branch October 8, 2026 14:39
linruohan pushed a commit to linruohan/gpui-component that referenced this pull request Oct 9, 2026
…idge#3419)

## Description

When a `TabBar` overflows, clicking a partially hidden tab selects it
but leaves it clipped, so there is no way to keep moving through the
strip except by scrolling manually.

Clicking a tab (or picking it from the overflow menu) now scrolls it
into view with part of the neighboring tab showing, animated with the
same spring as the selection indicator. This also works when
`track_scroll` is not used.

As agreed in longbridge#3021, only a click does this: changing the selection, the
tabs or the layout still leaves the offset where the user put it, and a
wheel or trackpad scroll during the animation takes over immediately.
Reduced motion skips the animation.

## Screenshot

| Before | After |
| ------ | ----- |
|
https://github.com/user-attachments/assets/5e189ca9-9a28-446f-ba70-dc229400c5f4
|
https://github.com/user-attachments/assets/1ca955cb-f3fe-4cd3-97c9-b50848d70735
|

## How to Test

Run `cargo run -- tabs`, add tabs in **Dynamic Tabs** until the bar
overflows, then click the clipped tabs at either edge.

## Checklist

- [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and
followed the guidelines.
- [x] Reviewed the changes in this PR and confirmed AI generated code
(If any) is accurate.
- [x] Passed `cargo run` for story tests related to the changes.
- [ ] Tested macOS, Windows and Linux platforms performance (if the
change is platform-specific)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant