Fix collapsed menu popover within available screen height - #37
Fix collapsed menu popover within available screen height#37Wolbyworld wants to merge 2 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df6e898a08
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .padding(.vertical, 14) | ||
| } | ||
| .frame(maxHeight: 420) | ||
| .frame(height: 420) |
There was a problem hiding this comment.
Allow the viewport to shrink on short displays
When the menu opens on a display or scaled resolution with less vertical space than the 420-point list plus the header and footer, this exact height cannot contract to the available area. Because only the list is scrollable, the bottom of the panel—including Edit, Login, and Quit—can then be clipped and unreachable; retain a nonzero minimum/ideal viewport while allowing it to shrink with the window.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c37abe7. The list now uses an explicit height capped by the visible height of the popover's own display, with space reserved for the header and footer. It also updates when the window changes screens or display parameters change.
The old version reproduced a 553-point panel in a 400-point height budget. The new layout passed six native-window cases with 3 and 20 rows at 553-, 400-, and 300-point budgets. At the smallest budget the panel was 273 points tall, and native scrolling reached the final row with Login, Edit, and Quit still visible. The normal menu also passed close/reopen and control-bounds checks. The universal Release build and focused review passed.
The PR description includes normal and constrained-height screenshots. Physical display/scaling and Dock changes remain manual checks in Tests/Popover-UAT.md.
On affected macOS versions, the menu opens with its controls and footer visible but the device list has zero height. This gives the scroll view an explicit viewport, capped by the visible height of the popover's own display, so both the list and footer fit.
The list uses up to 420 points. A 160-point allowance reserves the existing fixed header/footer and edge clearance. A small native view observes the window's screen and display-parameter changes to update the height budget. Application changes remain confined to
MenuBarView.swift; audio selection and microphone rules are unchanged.Screenshots
Before the fix and the current native menu on macOS 26.6.2:
Constrained-height test: a 300-point budget produces a 273-point panel. The 20-row fixture is scrolled to its last row; Login, Edit, and Quit remain visible. This uses the real views with test rows in an isolated native window, rather than changing the physical display resolution.
Validation
sh Tests/run-popover-layout-tests.sh: six cases passed, covering 3 and 20 rows with available heights of 553, 400, and 300 points. Actual panel heights were 526, 373, and 273 points.osascript Tests/popover-uat.applescript AudioPriorityBarCapped "MacBook Air Microphone": passed with a 420-point viewport, expected input present, visible top-level controls, and close/reopen behavior checked.osascript Tests/popover-uat.applescript PopoverLayoutTests --window-only "Test microphone 20": passed with a 140-point viewport. All top-level button frames were inside the constrained panel. Native scrolling to the final row was also checked.This addresses the short-display review comment. Physical display/scaling changes and Dock placement remain manual UAT cases in
Tests/Popover-UAT.md.Related: #35 and #33 propose other solutions to the same collapse. This is the isolated layout proposal split from closed #36; microphone automation remains separate in draft #38.