Support multi tab selection in vertical tabs#12200
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 shift-click range selection for vertical tabs by tracking transient range-selection state on tabs, introducing a workspace action to select the active-to-clicked range, wiring modifier-aware row clicks, and extending Hoverable with click modifiers. The PR includes visual evidence, and no approved spec context was available for implementation comparison.
Concerns
- No blocking correctness, security, or spec-drift concerns found in the annotated diff.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
From a product perspective, we we allow shift-select we probably also need to support ctrl-select |
|
Decided to go with command click here rather than ctrl click, as this is what google chrome tabs and apple finder uses. |
Description
Adds shift-click range selection and cmd-click multi tab select to the vertical tabs sidebar. Clicking a tab while holding shift selects every tab between the currently active tab and the clicked tab, and renders an accent highlight on the selected range. Clicking a tab while holding command, individual selects this tab and renders an accent highlight. Clicking a tab without shift (or starting a drag, switching panes, etc.) clears the selection.
Further actions that allow creating groups from these selected tabs, moving/removing these tabs to/from a group will be supported in a follow up PR.
NOTE: UI is not polished here, and is going to be updated in a follow up PR.
How it works
Added a new
ClickWithModifiersHandlerhandler to differentiate regular click from shift clicks and command clicks (would love some eyes on this). In the vertical tabs pane, when an element is shift clicked, we dispatch a newon_click_with_modifiersaction rather than setting focus to this tab/pane via a regular click. This sets a new flag on all tabs and panes within the given range (from current active tab to new element that is shift-clicked) to identify that this tab/pane is now selected as part of a range. A similar situation occurs for a command click, but marks the clicked tab as selected individually. This is cleared on next click, or drag action. If there is a group within the range, it is automatically expanded.Rendering logic is updated so that tabs/panes are highlighted when they are part of a multi select (with an edge case for panes so that there is differentiation between hover and selected). Helper functions are added to
app/src/workspace/view/tab_grouping.rsto support range selection actions, this is where all existing tab grouping logic is going to be ported to. Shift click is gated behind a feature flag so that behavior remains unchanged when it is off.Linked Issue
https://linear.app/warpdotdev/issue/APP-4642/shift-click-range-group-selection
Testing
./script/runScreenshots / Videos
Demo video
This video displays shift clicking a range of tabs, in both tab and pane view. It is cleared when another tab is selected or a drag begins. Also shows groups auto expanding when they are within a shift click range.
It also displays command clicking individual tabs to show they are also marked as selected.