Skip to content

workspace: Fix scrolling to active tab when pinned tabs are present#50538

Merged
MrSubidubi merged 2 commits intozed-industries:mainfrom
zharinov:fix/unpinned-tab-index
Mar 3, 2026
Merged

workspace: Fix scrolling to active tab when pinned tabs are present#50538
MrSubidubi merged 2 commits intozed-industries:mainfrom
zharinov:fix/unpinned-tab-index

Conversation

@zharinov
Copy link
Copy Markdown
Contributor

@zharinov zharinov commented Mar 2, 2026

When pinned tabs are present, activating an unpinned tab passed the absolute tab index to the scroll handle, which only contains unpinned tabs. This caused the scroll-into-view to silently fail.

Subtract pinned_tab_count from the index so it maps to the correct child in the unpinned tabs scroll container.

Release Notes:

  • Fixed tab bar not reliably scrolling to the active tab when pinned tabs are present.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 2, 2026
@zharinov
Copy link
Copy Markdown
Contributor Author

zharinov commented Mar 2, 2026

I wasn't sure if any of Bug bashers issues are available, so I found and fixed this one.

The original bug I was looking for is the rightmost tab flickering which sometimes shows up on conditions I can't tell exactly. Maybe this PR fixes it, maybe not 🤷‍♂️. But anyways, it's the bug too.

Reproduction: pin one tab and open many unpinned tabs, then navigate from the pinned tab with keyboard, forth and back. With this fix, the navigation will always scrool to the active tab.

@esthertrapadoux

@MrSubidubi MrSubidubi changed the title workspace: Fix scroll-to-tab index when pinned tabs are present workspace: Fix scrolling to active tab when pinned tabs are present Mar 3, 2026
Copy link
Copy Markdown
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

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

Nice find and good fix, very much appreciate you adding a test here. Thank you very much!

@MrSubidubi MrSubidubi merged commit 4392e3a into zed-industries:main Mar 3, 2026
30 checks passed
@MrSubidubi MrSubidubi self-assigned this Mar 3, 2026
tahayvr pushed a commit to tahayvr/zed that referenced this pull request Mar 4, 2026
…ed-industries#50538)

When pinned tabs are present, activating an unpinned tab passed the
absolute tab index to the scroll handle, which only contains unpinned
tabs. This caused the scroll-into-view to silently fail.

Subtract `pinned_tab_count` from the index so it maps to the correct
child in the unpinned tabs scroll container.

Release Notes:

- Fixed tab bar not reliably scrolling to the active tab when pinned
tabs are present.
wzulfikar pushed a commit to wzulfikar/zed that referenced this pull request Mar 4, 2026
…ed-industries#50538)

When pinned tabs are present, activating an unpinned tab passed the
absolute tab index to the scroll handle, which only contains unpinned
tabs. This caused the scroll-into-view to silently fail.

Subtract `pinned_tab_count` from the index so it maps to the correct
child in the unpinned tabs scroll container.

Release Notes:

- Fixed tab bar not reliably scrolling to the active tab when pinned
tabs are present.
@esthertrapadoux esthertrapadoux moved this to Shipped by the Guild in Zed Guild - The Board Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

Status: Shipped by the Guild

Development

Successfully merging this pull request may close these issues.

3 participants