Skip to content

Fix new-session "+" dropdown alignment when Tabs Panel is on the right#9492

Open
R3flector wants to merge 2 commits intowarpdotdev:masterfrom
R3flector:r3flector/fix-tabs-panel-add-menu-right-side
Open

Fix new-session "+" dropdown alignment when Tabs Panel is on the right#9492
R3flector wants to merge 2 commits intowarpdotdev:masterfrom
R3flector:r3flector/fix-tabs-panel-add-menu-right-side

Conversation

@R3flector
Copy link
Copy Markdown

Description

Fixes #9485.

The "+" (new session) dropdown next to the vertical-tabs panel was hardcoded to anchor BottomLeft → TopLeft (view.rs), so when the user moved the Tabs Panel to the right side of the toolbar via "Edit toolbar" the menu tried to expand to the right of the "+" button — which sits at the right edge of the window. With WindowBySize clamping, the menu was squashed into a narrow vertical strip of icons hugging the right edge of the window (see screenshots in #9485).

This change makes the dropdown's anchor mirror the side the tabs panel is on, matching the same pattern already used for the per-tab kebab menu later in this file (Self::tabs_panel_side(...) + BottomLeft/TopLeft vs BottomRight/TopRight):

  • Tabs Panel on left: BottomLeft → TopLeft (menu opens to the right — original layout, unchanged).
  • Tabs Panel on right: BottomRight → TopRight (menu opens to the left — fixes the bug).

The mapping is extracted into Workspace::vertical_tabs_dropdown_anchors next to the existing tabs_panel_side helper to keep the call site readable and unit-testable.

Out of scope (follow-up)

In the same render method, the "tab config" chip near the "+" button is anchored MiddleRight → TopLeft regardless of side and almost certainly has the same overflow problem when the panel is on the right. Keeping this PR focused on the menu reported in #9485 — happy to file a follow-up issue once this lands.

Testing

  • New unit test test_vertical_tabs_dropdown_anchors_match_panel_side in app/src/workspace/view_test.rs asserts the anchor pair for both PanelPosition::Left and PanelPosition::Right.
  • Manually verified on Linux (CachyOS) on a local build:
  • Local checks: cargo fmt --all -- --check clean, cargo clippy -p warp --all-targets --tests --features gui -- -D warnings clean, cargo test -p warp --features gui --lib workspace::view 104 passed including the new test.

Agent Mode

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

Changelog Entries for Stable

CHANGELOG-BUG-FIX: Fix new-session "+" dropdown alignment when the Tabs Panel is placed on the right side of the header toolbar.

The "+" dropdown next to the vertical-tabs panel was hardcoded to anchor
its top-left to the button's bottom-left, so when the user moved the
Tabs Panel to the right side of the toolbar via "Edit toolbar" the menu
tried to expand to the right of the "+" button — which sits at the
right edge of the window. With WindowBySize clamping, the menu was
squashed into a narrow vertical strip of icons hugging the right edge
(see screenshots in warpdotdev#9485).

Mirror the anchor by the panel side, matching the pattern already used
for the per-tab kebab menu in the same file. The Left case keeps the
original BottomLeft → TopLeft layout; the Right case uses
BottomRight → TopRight so the menu opens inward and stays inside the
window.

Extract the mapping into Workspace::vertical_tabs_dropdown_anchors next
to the existing tabs_panel_side helper, with a unit test covering both
sides.

Fixes warpdotdev#9485

CHANGELOG-BUG-FIX: Fix new-session "+" dropdown alignment when the Tabs Panel is placed on the right side of the header toolbar.
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @R3flector on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 29, 2026

@R3flector

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I reviewed this pull request and requested human review from: @zachbai. I left feedback as a comment so a maintainer can approve.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@harryalbert harryalbert self-assigned this Apr 29, 2026
@harryalbert harryalbert self-requested a review April 29, 2026 21:04
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR updates the vertical-tabs new-session dropdown to mirror its anchor based on the tabs panel side, so the menu opens inward when the panel is on the right. It also adds a focused regression test for the left and right anchor mappings.

Concerns

  • No blocking concerns found in the changed lines.

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

@oz-for-oss oz-for-oss Bot requested a review from zachbai April 29, 2026 21:06
Copy link
Copy Markdown
Contributor

@harryalbert harryalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this! Implementation looks good, just had one nit

Comment thread app/src/workspace/view.rs
/// Anchors for the new-session "+" dropdown shown next to the vertical-tabs
/// "+" button. The menu always expands inward from the tabs-panel side, so
/// it stays inside the window regardless of which side the panel is on.
fn vertical_tabs_dropdown_anchors(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, but I think we can just inline this function instead of making it separate (and get rid of the test below). IMO if the test is just testing that the pure function outputs what we've coded, it's not too necessary

@harryalbert
Copy link
Copy Markdown
Contributor

@R3flector you'll also have to sign the cla (from this comment above) for us to merge this PR

@harryalbert harryalbert removed the request for review from zachbai April 29, 2026 21:08
@cla-bot cla-bot Bot added the cla-signed label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tabs Panel button renders broken when moved to the right side of the toolbar

2 participants