Fix "New group with tab" offered on a tab already in a group (#13073)
Description
Fixes #13073. In the vertical-tabs per-tab right-click menu, tab_group_menu_items in app/src/tab.rs pushed "New group with tab" unconditionally. As a result it was offered even on a tab that is already inside a group — right next to the correct "Remove from group". Creating a new group from a tab that's already grouped is meaningless.
Fix: gate the entry on the tab not already being in a group, mirroring how the sibling "Remove from group" entry is gated on group_id.is_some(). The inclusion logic for all three group entries is factored into a small pure helper, tab_group_menu_entry_flags, so it can be unit-tested without standing up a full TabData + feature-flag harness.
Linked Issue
#13073
- [x] The linked issue is labeled
ready-to-specorready-to-implement. - [x] Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).
Testing
-
Added regression tests in
app/src/tab_tests.rs:grouped_tab_hides_new_group_and_offers_remove— a grouped tab no longer offers "New group with tab" and does offer "Remove from group".ungrouped_tab_offers_new_group_and_hides_remove— an ungrouped tab still offers "New group with tab" and never "Remove from group".move_to_group_only_shown_when_other_groups_exist— guards the existing "Move to group" behavior.
-
cargo fmtclean;cargo clippy -p warp --lib --features grouped_tabs -- -D warningsclean; the three new tests pass. -
Manual
computer_useUI verification on a local build (--features grouped_tabs, vertical tabs enabled): reproduced the bug, applied the fix, and re-checked the running app (see before/after below). -
[x] I have manually tested my changes locally
Screenshots / Videos
Before — a tab nested under New Group still offers "New group with tab" (right next to "Remove from group"):

After — the same grouped tab's menu now starts with "Remove from group"; "New group with tab" is gone. Ungrouped tabs still show "New group with tab" + "Move to group":

Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode
Co-Authored-By: Warp [email protected]
@warp-dev-github-integration[bot]
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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
Thanks for the review. Addressed the feedback: the PR description now embeds before/after screenshots of the grouped-tab context menu (taken via computer_use on a local --features grouped_tabs build) demonstrating the change end to end — before, a grouped tab still offered "New group with tab"; after, that entry is gone while ungrouped tabs are unchanged.
/oz-review
@zachbai IMO this is intended product behavior. Other platforms like chrome allow you to pull a tab from one group into its own. I think maybe just gating this option for the case where the tab is the only member of a group would be better.
Good call @johnturcoo — updated the fix to match. "New group with tab" is now hidden only when the tab is the sole member of its group (where it would be a no-op). A tab that shares a group with other tabs still gets "New group with tab" so it can be pulled out into its own new group (Chrome-style), and ungrouped tabs are unchanged. Pushed the change with regression tests for the sole-member, multi-member, and ungrouped cases, and verified all three on a local build (screenshots in the PR description).
/oz-review