Fix new-session "+" dropdown alignment when Tabs Panel is on the right#9492
Fix new-session "+" dropdown alignment when Tabs Panel is on the right#9492R3flector wants to merge 2 commits intowarpdotdev:masterfrom
Conversation
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.
|
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 |
|
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 Powered by Oz |
There was a problem hiding this comment.
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
harryalbert
left a comment
There was a problem hiding this comment.
Thank you for fixing this! Implementation looks good, just had one nit
| /// 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( |
There was a problem hiding this comment.
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
|
@R3flector you'll also have to sign the cla (from this comment above) for us to merge this PR |
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. WithWindowBySizeclamping, 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/TopLeftvsBottomRight/TopRight):BottomLeft → TopLeft(menu opens to the right — original layout, unchanged).BottomRight → TopRight(menu opens to the left — fixes the bug).The mapping is extracted into
Workspace::vertical_tabs_dropdown_anchorsnext to the existingtabs_panel_sidehelper 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 → TopLeftregardless 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
test_vertical_tabs_dropdown_anchors_match_panel_sideinapp/src/workspace/view_test.rsasserts the anchor pair for bothPanelPosition::LeftandPanelPosition::Right.cargo fmt --all -- --checkclean,cargo clippy -p warp --all-targets --tests --features gui -- -D warningsclean,cargo test -p warp --features gui --lib workspace::view104 passed including the new test.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.