Add option to show pinned tabs in a separate row#46573
Add option to show pinned tabs in a separate row#46573mattermill merged 6 commits intozed-industries:mainfrom
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @yaroslavrick on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
Correct me if I'm wrong, but it looks like the failed test in CI is flaky:
It passes locally on my machine. I don't have permission to re-run the CI. @mattermill Could you please re-run it? |
|
Thank you so much, I will enable this as soon as tomorrow! See issue #5005 |
|
This may have broken tab reordering when not enabled - please see #46864 |
I will take a look at this |
Seems that I've found the roots of issue: here is this line: 10b2072#diff-f3e6f80bf80e98b614b1fba64a700fc347b10286412e005f363e52279a550244R2768
cc @mattermill |
| cx.listener(move |this, dragged_tab: &DraggedTab, window, cx| { | ||
| this.drag_split_direction = None; | ||
| this.handle_tab_drop(dragged_tab, ix, window, cx) | ||
| this.handle_tab_drop(dragged_tab, this.items.len(), window, cx) |
There was a problem hiding this comment.
Seems that I've found the roots of issue: here is this line: 10b2072#diff-f3e6f80bf80e98b614b1fba64a700fc347b10286412e005f363e52279a550244R2768
crates/workspace/src/pane.rs:2768
cc @mattermill
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>
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>
…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>
|
Hey @yaroslavrick, caught this bug: #46926 |

Problem:
When working with many
pinned tabs, they consume significant horizontal space in the tab bar, leaving less room for unpinned (active working) tabs, especially on small screens. This creates a poor user experience as users must constantly scroll to find their working tabs, or the tabs become too narrow to read file names.Solution:
Added a new opt-in setting
tab_bar.show_pinned_tabs_in_separate_rowthat displays pinned and unpinned tabs in two separate rows:Top row: Pinned tabs with navigation buttons and tab bar controls
Bottom row: Unpinned (working) tabs with full horizontal space
when pinned and not pinned tabs we show 2 rows:
This is a well-established UX pattern used in many popular IDEs including JetBrains products (IntelliJ IDEA, WebStorm, PyCharm, RubyMine), Visual Studio, and Eclipse.
The two-row layout only appears when both pinned AND unpinned tabs exist. If only one type is present, a single row is displayed:
Important - Default Behavior Preserved:
render_single_row_tab_barmethod, while the new two-row layout lives inrender_two_row_tab_bar. Both methods share common components (configure_tab_bar_start,configure_tab_bar_end,render_unpinned_tabs_container,render_tab_bar_drop_target) ensuring DRY code and consistent behavior.This implementation ensures zero risk to the existing user experience while providing an optional enhancement for users who prefer separated tab rows.
Configuration
Via Settings UI:
Via settings.json:
{ "tab_bar": { "show_pinned_tabs_in_separate_row": true } }Video of implemented feature:
720.mov
Tested:
Tested on: MacBook Pro M4, macOS 26.2
Release Notes:
tab_bar.show_pinned_tabs_in_separate_rowsetting to display pinned and unpinned tabs in separate rows, giving unpinned tabs full horizontal space