Commit b24fce3
authored
Support multi select grouping actions for vertical tabs (#12229)
## Description
Adds group operations to the vertical tabs multi-selection from [the
previous PR](#12200). 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:
- Moving to group is possible if there is another group available for at
least one of the selected tabs (ie Group 1 contains members A,B,C, tab
list contains A,B,C,D. Selecting all 4 tabs allows move to group 1,
since tab D can be moved to group 1).
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 `selected` tab, otherwise the
regular single-tab menu appears. Right click on a tab or pane branches
on `is_in_multi_tab_selection` to 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
<!--
How did you test this change? What automated tests did you add? If you
didn't add any new tests, what's your justification for not adding any?
Manual testing is required for changes that can be manually tested, and
almost all changes can be manually tested. If your change can be
manually tested, please include screenshots or a screen recording that
show it working end to end.
You can run the app locally using `./script/run` - see WARP.md for more
details on how to get set up.
-->
- [x] I have manually tested my changes locally with `./script/run`
### Screenshots / Videos
[Demo
video](https://www.loom.com/share/adbfa7c9fd794863995655316c4cdc4b)
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 menu1 parent a44fbf1 commit b24fce3
4 files changed
Lines changed: 551 additions & 97 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
156 | 163 | | |
157 | 164 | | |
158 | 165 | | |
| |||
195 | 202 | | |
196 | 203 | | |
197 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
198 | 216 | | |
199 | 217 | | |
200 | 218 | | |
| |||
841 | 859 | | |
842 | 860 | | |
843 | 861 | | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
844 | 865 | | |
845 | 866 | | |
846 | 867 | | |
| |||
907 | 928 | | |
908 | 929 | | |
909 | 930 | | |
| 931 | + | |
910 | 932 | | |
911 | 933 | | |
912 | 934 | | |
| |||
1023 | 1045 | | |
1024 | 1046 | | |
1025 | 1047 | | |
| 1048 | + | |
1026 | 1049 | | |
1027 | 1050 | | |
1028 | 1051 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
988 | 988 | | |
989 | 989 | | |
990 | 990 | | |
| 991 | + | |
| 992 | + | |
991 | 993 | | |
992 | 994 | | |
993 | 995 | | |
| |||
3245 | 3247 | | |
3246 | 3248 | | |
3247 | 3249 | | |
| 3250 | + | |
3248 | 3251 | | |
3249 | 3252 | | |
3250 | 3253 | | |
| |||
9341 | 9344 | | |
9342 | 9345 | | |
9343 | 9346 | | |
| 9347 | + | |
9344 | 9348 | | |
9345 | 9349 | | |
9346 | 9350 | | |
| |||
9458 | 9462 | | |
9459 | 9463 | | |
9460 | 9464 | | |
9461 | | - | |
9462 | | - | |
9463 | | - | |
9464 | | - | |
9465 | | - | |
9466 | | - | |
9467 | | - | |
9468 | | - | |
9469 | | - | |
9470 | | - | |
9471 | | - | |
9472 | | - | |
9473 | | - | |
9474 | | - | |
9475 | | - | |
9476 | | - | |
9477 | | - | |
9478 | | - | |
9479 | | - | |
9480 | | - | |
9481 | | - | |
9482 | | - | |
9483 | | - | |
9484 | | - | |
9485 | | - | |
9486 | | - | |
9487 | | - | |
9488 | | - | |
9489 | | - | |
9490 | | - | |
9491 | | - | |
9492 | | - | |
9493 | | - | |
9494 | | - | |
9495 | | - | |
9496 | | - | |
9497 | | - | |
9498 | | - | |
9499 | | - | |
9500 | | - | |
9501 | | - | |
9502 | | - | |
9503 | 9465 | | |
| 9466 | + | |
9504 | 9467 | | |
9505 | | - | |
| 9468 | + | |
| 9469 | + | |
| 9470 | + | |
| 9471 | + | |
9506 | 9472 | | |
9507 | | - | |
| 9473 | + | |
9508 | 9474 | | |
9509 | 9475 | | |
9510 | 9476 | | |
| |||
9528 | 9494 | | |
9529 | 9495 | | |
9530 | 9496 | | |
9531 | | - | |
| 9497 | + | |
| 9498 | + | |
| 9499 | + | |
| 9500 | + | |
| 9501 | + | |
| 9502 | + | |
| 9503 | + | |
9532 | 9504 | | |
9533 | 9505 | | |
9534 | 9506 | | |
| |||
9565 | 9537 | | |
9566 | 9538 | | |
9567 | 9539 | | |
| 9540 | + | |
| 9541 | + | |
| 9542 | + | |
| 9543 | + | |
| 9544 | + | |
| 9545 | + | |
| 9546 | + | |
| 9547 | + | |
| 9548 | + | |
| 9549 | + | |
| 9550 | + | |
| 9551 | + | |
| 9552 | + | |
| 9553 | + | |
| 9554 | + | |
| 9555 | + | |
| 9556 | + | |
| 9557 | + | |
| 9558 | + | |
| 9559 | + | |
| 9560 | + | |
| 9561 | + | |
| 9562 | + | |
| 9563 | + | |
| 9564 | + | |
| 9565 | + | |
| 9566 | + | |
| 9567 | + | |
| 9568 | + | |
| 9569 | + | |
| 9570 | + | |
| 9571 | + | |
| 9572 | + | |
| 9573 | + | |
| 9574 | + | |
| 9575 | + | |
| 9576 | + | |
| 9577 | + | |
| 9578 | + | |
| 9579 | + | |
| 9580 | + | |
| 9581 | + | |
9568 | 9582 | | |
9569 | 9583 | | |
9570 | 9584 | | |
9571 | 9585 | | |
9572 | 9586 | | |
9573 | 9587 | | |
9574 | 9588 | | |
9575 | | - | |
9576 | | - | |
| 9589 | + | |
| 9590 | + | |
9577 | 9591 | | |
9578 | 9592 | | |
| 9593 | + | |
9579 | 9594 | | |
9580 | 9595 | | |
9581 | 9596 | | |
| |||
22646 | 22661 | | |
22647 | 22662 | | |
22648 | 22663 | | |
| 22664 | + | |
| 22665 | + | |
| 22666 | + | |
22649 | 22667 | | |
22650 | 22668 | | |
22651 | 22669 | | |
| |||
22675 | 22693 | | |
22676 | 22694 | | |
22677 | 22695 | | |
| 22696 | + | |
| 22697 | + | |
| 22698 | + | |
| 22699 | + | |
| 22700 | + | |
| 22701 | + | |
22678 | 22702 | | |
22679 | 22703 | | |
22680 | 22704 | | |
| |||
25267 | 25291 | | |
25268 | 25292 | | |
25269 | 25293 | | |
25270 | | - | |
25271 | | - | |
25272 | | - | |
25273 | | - | |
25274 | | - | |
25275 | | - | |
25276 | | - | |
25277 | | - | |
| 25294 | + | |
| 25295 | + | |
| 25296 | + | |
25278 | 25297 | | |
25279 | | - | |
25280 | | - | |
25281 | | - | |
25282 | | - | |
25283 | | - | |
25284 | | - | |
25285 | | - | |
25286 | | - | |
25287 | | - | |
25288 | | - | |
25289 | | - | |
25290 | | - | |
25291 | | - | |
25292 | | - | |
25293 | | - | |
25294 | | - | |
25295 | | - | |
25296 | | - | |
| 25298 | + | |
| 25299 | + | |
| 25300 | + | |
| 25301 | + | |
| 25302 | + | |
| 25303 | + | |
| 25304 | + | |
| 25305 | + | |
| 25306 | + | |
| 25307 | + | |
| 25308 | + | |
| 25309 | + | |
| 25310 | + | |
| 25311 | + | |
| 25312 | + | |
| 25313 | + | |
| 25314 | + | |
| 25315 | + | |
| 25316 | + | |
| 25317 | + | |
25297 | 25318 | | |
25298 | | - | |
25299 | | - | |
25300 | | - | |
25301 | | - | |
25302 | | - | |
25303 | | - | |
25304 | | - | |
25305 | | - | |
25306 | | - | |
25307 | | - | |
25308 | | - | |
| 25319 | + | |
25309 | 25320 | | |
25310 | 25321 | | |
25311 | 25322 | | |
| |||
0 commit comments