Skip to content

workspace: Fix tab reordering regression#46872

Merged
smitbarmase merged 2 commits intozed-industries:mainfrom
yaroslavrick:fix/fix-tabs-ordering
Jan 15, 2026
Merged

workspace: Fix tab reordering regression#46872
smitbarmase merged 2 commits intozed-industries:mainfrom
yaroslavrick:fix/fix-tabs-ordering

Conversation

@yaroslavrick
Copy link
Contributor

@yaroslavrick yaroslavrick commented Jan 15, 2026

Closes #46864
Initial PR: #46573

Summary

Fix a regression where dragging a tab onto another tab would place it at the end of the tab bar instead of at the target position.

The issue was in the on_drop handler: it used this.items.len() (evaluated at drop time) instead of the captured ix index (the position of the tab being dropped onto).

Release Notes:

  • Fixed tab reordering not working correctly when dragging tabs

Video after fix:

  • when 'show_pinned_tabs_in_separate_row' is false:
Screen.Recording.2026-01-15.at.09.29.38.mov
  • when 'show_pinned_tabs_in_separate_row' is true:
Screen.Recording.2026-01-15.at.09.30.18.mov

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 15, 2026
@zed-industries-bot
Copy link
Contributor

Messages
📖

This PR includes links to the following GitHub Issues: #46864
If this PR aims to close an issue, please include a Closes #ISSUE line at the top of the PR body.

Generated by 🚫 dangerJS against f14b815

@smitbarmase smitbarmase changed the title Fix tab reordering workspace: Fix tab reordering regression Jan 15, 2026
@smitbarmase smitbarmase merged commit b8c5f67 into zed-industries:main Jan 15, 2026
24 checks passed
@smitbarmase
Copy link
Member

/cherry-pick preview

github-actions bot pushed a commit that referenced this pull request Jan 15, 2026
Closes [#46864](#46864)
Initial PR: #46573

## Summary

Fix a regression where dragging a tab onto another tab would place it at
the end of the tab bar instead of at the target position.

The issue was in the `on_drop` handler: it used `this.items.len()`
(evaluated at drop time) instead of the captured `ix` index (the
position of the tab being dropped onto).

Release Notes:

- Fixed tab reordering not working correctly when dragging tabs

## Video after fix:

- when 'show_pinned_tabs_in_separate_row' is false:


https://github.com/user-attachments/assets/1ede0ce5-1161-4209-83f4-33a07572782a

- when 'show_pinned_tabs_in_separate_row' is true:


https://github.com/user-attachments/assets/d56c0e59-8372-41d4-973b-32a4895ca729

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
zed-zippy bot added a commit that referenced this pull request Jan 15, 2026
…view) (#46878)

Cherry-pick of #46872 to preview

----
Closes [#46864](#46864)
Initial PR: #46573

## Summary

Fix a regression where dragging a tab onto another tab would place it at
the end of the tab bar instead of at the target position.

The issue was in the `on_drop` handler: it used `this.items.len()`
(evaluated at drop time) instead of the captured `ix` index (the
position of the tab being dropped onto).

Release Notes:

- Fixed tab reordering not working correctly when dragging tabs

## Video after fix:

- when 'show_pinned_tabs_in_separate_row' is false:



https://github.com/user-attachments/assets/1ede0ce5-1161-4209-83f4-33a07572782a

- when 'show_pinned_tabs_in_separate_row' is true:



https://github.com/user-attachments/assets/d56c0e59-8372-41d4-973b-32a4895ca729

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>

Co-authored-by: Yaroslav Yenkala <yaroslavrick@gmail.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
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

None yet

Development

Successfully merging this pull request may close these issues.

0.220.0 broke tab reordering, moved tab always jumps to end (highly disruptive)

3 participants