Support multi select grouping actions for vertical tabs#12229
Conversation
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds multi-tab context-menu actions for vertical tabs, including creating a group from the current selection, moving selected tabs into an existing group, and removing selected tabs from a shared group. The attached Loom video satisfies the repository visual-evidence requirement, and no approved spec context was available for spec drift validation.
Concerns
- Opening a regular pane/tab context menu from outside an active multi-selection clears the selection flags but does not clear
show_tab_selection_right_click_menu. Because the selection menu reusestab_right_click_menu, stale selection-menu state can leave both menu flags set and render/update the shared menu in multiple places. The same cleanup should be applied anywhere another context menu replaces the multi-selection menu.
Verdict
Found: 0 critical, 2 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| if !any_flagged { | ||
| return Vec::new(); | ||
| } | ||
| // Otherwise, the active tab must always be part of the multi tab selection. |
There was a problem hiding this comment.
This might be contentious with the following user story:
- I have 5 tabs, 1 active
- I'm just organizing my tabs and moving some to its own group with cmd-click
- My active tab is not one of the ones I want to move
| target: VerticalTabsPaneContextMenuTarget::ActivePane(active_pane_context_menu_target), | ||
| position, | ||
| }); | ||
| let anchor = TabContextMenuAnchor::Pointer(position); |
There was a problem hiding this comment.
nit: we can maybe extract to a "on_right_click" handler if they're identical
70ac813 to
c606da6
Compare
cc95d6b to
fa86d68
Compare
Description
Adds group operations to the vertical tabs multi-selection from the previous PR. When the user has multiple tabs selected (via shift-click or cmd-click), right-clicking any selected tab opens a new multi-tab menu with three actions: Create group from tabs, Move to group, and Remove from group.
Create group from tabs turns the selection into a new tab group at the top of the tab list. Move to group folds the selection into an existing group, anchored at the group's first member so the group doesn't visually move. Remove from group is available only when every selected tab shares the same group; the removed tabs land just below the group's remaining members, or in the same position if no remaining members existing.
NOTE: UI is not polished here and is going to be updated in a follow up PR.
How it works
Added new workspace actions for creating group, moving to group and removing from group when several tabs are selected. Helper functions containing the logic can be found in
app/src/workspace/view/tab_grouping.rs. Important note:All other behavior for these actions should be as expected. Empty groups are deleted after any of these actions.
Added two new actions for clearing all selected tabs, and for toggling the multi-tab selection right click menu, which displays the "Move to group", "Remove from group" and "Create group from tabs" options. This menu is displayed on right click of a
selectedtab, otherwise the regular single-tab menu appears. Right click on a tab or pane branches onis_in_multi_tab_selectionto determine which menu to display.The "move to group" sidecar menu is now used for both the single-tab menu as well as the multi-tab selection menu, rendering is extracted into a shared function
add_move_to_group_sidecar_overlay.The only other thing to note here: Since we support cmd + click to select any individual tab, the active tab is always assumed to be selected when any other member is selected, but is only marked as selected for a range selection. This is important when determining which menu to display when right clicking the active tab, without needing to do additional bookkeeping on every cmd + click that toggles selected tabs.
Linked Issue
https://linear.app/warpdotdev/issue/APP-4661/group-creation-from-multi-select-for-vertical-tabs
Testing
./script/runScreenshots / Videos
Demo video
This demo video shows a mix of shift + click range selection, cmd + click individual tab selection and a mix of different actions from the multi tab selection menu