Repository navigation
fix(ui): keep card menus whole at the window edge, fold active forwards (#610) - #612
Merged
Merged
Conversation
…ds (#610) A card's "more options" menu opened under its button and was given only the height left below it. On a card near the bottom of the window that left a sliver showing one entry, or nothing at all. The menu was already moved sideways to fit the window; it is now moved vertically the same way, through the same helper, so it slides up until every entry is visible. Hosts, keys, snippets, rules, members and known hosts share this menu and all get the fix. The terminal status bar menu opens upward and had the mirror problem in the top pane of a split: it shrank to the space above the pointer. It goes through the same fit now and is pushed down instead. Where there is room it still ends at the pointer. On the Port Forwarding page the "Active session forwards" header folds the host cards away, so a host with many detected ports no longer pushes the saved rules off the page. The choice is kept on the device. The header keeps the host count and tunnel total, and shows an error count when a forward failed so a folded section cannot hide it.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #610
Problem
max-heightset to the space left below it. On a card near the bottom of the window only one entry showed (the reporter's rule menu shows just "Edit"), and with the button at the very edge the height went negative.ContextMenualready fitted itself horizontally; it never did vertically.Fix
ContextMenu: the root menu's top goes through the sameuseFittedStarthelper as its left edge and as submenus, so it slides up until it fits.max-heightis the window height minus margins, and accounts for UI scale.useFittedStarttakes anendsAtAnchorflag. Where there is room the upward menu still ends at the pointer.ActiveTunnelsSection: the section header toggles the cards, using thecollapsed/onTogglesupportSectionHeaderalready had. The state lives inuiStore(activeTunnelsCollapsed), persisted on the device and not synced.Every card menu goes through
ContextMenu(hosts, keys, snippets, rules, members, known hosts), so the one change covers them all.Other floating surfaces checked
PickerSurface(form selects, snippet and notes menus): already flips above the anchor when less than 150px is left below. Unchanged.PanelActionsMenu(edit panel header): has its own unclamped menu shell, but its trigger always sits at the top of the panel. Left as is; moving it ontoContextMenuchanges its alignment and deserves its own change.Cons
topafter a measurement rather than bybottom. The correction happens in a layout effect, before paint.Tests
ContextMenu.test.tsx: a menu opened low is shifted up and keeps full height; an upward menu ends at the pointer when there is room; an upward menu opened high is pushed down.ActiveTunnelsSection.test.tsx(renamed from.identity.test.tsx, which it outgrew): the header folds and unfolds the cards and keeps the totals; a folded section stays folded on the next render; a folded section still shows the error count; no error count without a failure.vitestoncomponents/shared,components/port_forwarding,components/terminal,stores: 153 files, 985 tests pass.tsc --noEmit: clean.