warp icon indicating copy to clipboard operation
warp copied to clipboard

Fix "New group with tab" offered on a tab already in a group (#13073)

Open warp-agent-staging opened this issue 5 months ago • 3 comments

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-spec or ready-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 fmt clean; cargo clippy -p warp --lib --features grouped_tabs -- -D warnings clean; the three new tests pass.

  • Manual computer_use UI 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"):

Before: grouped tab context menu incorrectly offers New group with tab

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":

After: grouped tab context menu no longer offers New group with tab

Agent Mode

  • [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Co-Authored-By: Warp [email protected]

warp-agent-staging avatar Jun 26 '26 07:06 warp-agent-staging

@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

warp-for-oss[bot] avatar Jun 26 '26 07:06 warp-for-oss[bot]

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.

warp-agent-staging avatar Jun 26 '26 07:06 warp-agent-staging

/oz-review

warp-agent-staging avatar Jun 26 '26 07:06 warp-agent-staging

@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.

johnturcoo avatar Jun 26 '26 14:06 johnturcoo

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).

warp-agent-staging avatar Jun 26 '26 15:06 warp-agent-staging

/oz-review

warp-agent-staging avatar Jun 26 '26 15:06 warp-agent-staging