Skip to content

Fix collapsed menu popover within available screen height - #37

Closed
Wolbyworld wants to merge 2 commits into
tobi:mainfrom
Wolbyworld:fix/menu-popover-height
Closed

Fix collapsed menu popover within available screen height#37
Wolbyworld wants to merge 2 commits into
tobi:mainfrom
Wolbyworld:fix/menu-popover-height

Conversation

@Wolbyworld

@Wolbyworld Wolbyworld commented Sep 5, 2026

Copy link
Copy Markdown

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:

Before: collapsed list Current menu on a normal display
Original menu with the device list collapsed Current menu with device rows and footer visible

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.

Short panel showing test microphone 20 and the footer

Validation

  • Universal arm64/x86_64 Release build passed.
  • The original collapsed layout reproduced a zero-height list.
  • The previous fixed-height version stayed 553 points tall when its native window was constrained to 400 points, reproducing the review concern.
  • 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.
  • Focused review of the correction completed with no actionable findings.

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T18:18:30.721586Z df6e898 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

@Wolbyworld Wolbyworld changed the title Fix collapsed menu popover with an explicit list viewport Fix collapsed menu popover within available screen height Sep 5, 2026
@Wolbyworld Wolbyworld closed this Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant