Skip to content

Fix menu popover collapsing on macOS 26 and sluggish drag-to-reorder - #35

Open
CamilleGuillory wants to merge 1 commit into
tobi:mainfrom
CamilleGuillory:fix/menubar-macos26-rendering-and-drag
Open

Fix menu popover collapsing on macOS 26 and sluggish drag-to-reorder#35
CamilleGuillory wants to merge 1 commit into
tobi:mainfrom
CamilleGuillory:fix/menubar-macos26-rendering-and-drag

Conversation

@CamilleGuillory

Copy link
Copy Markdown

Two bug fixes

1. Popover collapses to header + footer on macOS 26 (Tahoe)

On macOS 26 a ScrollView reports a 0 ideal height, so the maxHeight on the ScrollView clamps the fit-to-content MenuBarExtra window down to just the header and footer — the device list is invisible.

Fix: drop the maxHeight from the ScrollView and size the outer VStack to its content instead, capping the window height so a long list scrolls rather than running off-screen:

.fixedSize(horizontal: false, vertical: true)
.frame(maxHeight: 650)

2. Drag-to-reorder trigger requires overshooting

calculateTarget had a dead-zone plus an off-by-one that meant you had to drag ~1.5 rows before a reorder registered — dragging a row squarely over its neighbour did nothing.

Fix: flip as soon as the dragged centre crosses a neighbour's midpoint ((offset / pitch).rounded()), with a +1 for downward inserts.

Testing

Built and run on macOS 26. The device list renders at full height and scrolls when long; dragging a row over the adjacent one reorders immediately.

On macOS 26 a ScrollView reports a 0 ideal height, so the plain
maxHeight frame on the device-list ScrollView let the fit-to-content
MenuBarExtra window collapse to just its header and footer — no devices
were visible. Size the window to its content (fixedSize vertically) with
a maxHeight cap so a long list scrolls instead of collapsing or running
off-screen.

Also make drag-to-reorder trigger as soon as the dragged row crosses a
neighbour's midpoint, instead of needing a ~1.5-row overshoot before the
move registered.
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