Skip to content

fix(ui): make the macOS 26 menu bar popup fill opaque so its shadow hugs a solid panel#652

Merged
FuJacob merged 3 commits into
mainfrom
fix/popup-shadow-coverage-646
Jun 9, 2026
Merged

fix(ui): make the macOS 26 menu bar popup fill opaque so its shadow hugs a solid panel#652
FuJacob merged 3 commits into
mainfrom
fix/popup-shadow-coverage-646

Conversation

@FuJacob

@FuJacob FuJacob commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

On macOS 26 the menu bar popup's drop shadow detaches from the panel (equivalently, the fill looks like it does not stretch to the popup's edges), worst on a light background. This draws the popup fill as an opaque rounded layer so the system shadow hugs a solid panel. Fixes the recurring #646, which is the same defect as #492.

Validation

Root-caused and verified on macOS 26 (Tahoe, Darwin 25.x) by inspecting the live MenuBarExtra(.window) backing window and its layer tree:

  • Before: the popup background is a translucent Liquid Glass CABackdropLayer; there is no full-size opaque layer anywhere in the tree. The popover window is isOpaque=false with a clear background, so the desktop bleeds through and the system shadow (cast around the full rounded frame) detaches. containerBackground(_, for: .window) routes any value, including an opaque Color, through that glass backdrop, which is why Fix translucent menu bar popup background on macOS 26 #566's material-to-color swap changed nothing.
  • After: a full-size opaque layer (bgAlpha=1.0, cornerRadius=16 continuous, frame {{0,0},{340,329.5}}) now backs the window, matching the native shape exactly and reaching all four edges (so no Fix menu bar popup double border #403 double-border regression).
  • Captured the popover together with its shadow in both light and dark appearance: a solid opaque rounded panel with the shadow hugging the corners and no bleed-through. (Screenshots captured locally; happy to attach.)
swiftlint lint --quiet
# no violations in MenuBarView.swift

xcodebuild -project Cotabby.xcodeproj -scheme Cotabby -destination 'platform=macOS' build \
  -derivedDataPath build/DerivedData
# ** BUILD SUCCEEDED **

Linked issues

Fixes #646
Refs #492, #566, #403

Risk / rollout notes

  • macOS 26 only. The macOS 15 to pre-26 branch (the .windowBackground material) and the macOS 14 fallback are unchanged.
  • The popup on macOS 26 is now a solid opaque window-colored panel (no Liquid Glass vibrancy behind the menu). That matches the stated intent of Fix translucent menu bar popup background on macOS 26 #566 and is what the bug asks for, since the translucency was the defect.
  • The fill corner radius is pinned to the native value measured on macOS 26 (16pt continuous). If a future macOS changes the system popover radius, the fill corner would need the same update. Worst case there is a small corner mismatch, not a return of the desktop bleed-through.

Greptile Summary

Fixes a recurring macOS 26 menu bar popup shadow issue by replacing containerBackground(_, for: .window) with a plain SwiftUI .background layer carrying an opaque RoundedRectangle. On macOS 26, containerBackground routes through the system's Liquid Glass CABackdropLayer, making even an opaque Color translucent; using .background bypasses that path and produces a fully opaque fill. The macOS 15–25 and macOS 14 code paths are not touched.

  • macOS 26+ branch: switched from containerBackground(Color(nsColor: .windowBackgroundColor), for: .window) to content.background { RoundedRectangle(cornerRadius: ..., style: .continuous).fill(...) }, producing the opaque layer that the system shadow can hug.
  • Named constant added: macOS26PopoverCornerRadius = 16 (a measured system value) is extracted as a private static let with a doc-comment explaining why it exists and what breaks if it drifts.

Confidence Score: 5/5

Safe to merge; the change is narrowly scoped to the macOS 26 branch of a single modifier, and the previous feedback about extracting the magic constant has been addressed.

The fix is a small, well-bounded substitution in one platform branch. The author verified it with live layer-tree inspection and confirmed the opaque layer reaches all four window edges. The macOS 15–25 and macOS 14 paths are untouched.

No files require special attention.

Important Files Changed

Filename Overview
Cotabby/UI/MenuBarView.swift Replaces containerBackground(Color, for: .window) with a plain .background { RoundedRectangle } for macOS 26+; extracts the corner radius to a named constant; macOS 15 and 14 paths are unchanged.

Reviews (2): Last reviewed commit: "refactor(ui): name the macOS 26 popover ..." | Re-trigger Greptile

…ugs a solid panel

On macOS 26 Liquid Glass, containerBackground(_, for: .window) is composited through a translucent glass backdrop (CABackdropLayer), so the opaque Color passed by #566 was still rendered see-through. The non-opaque popover window let the desktop bleed through and the native shadow detached from the content on light backgrounds, reopening #492 as #646.

Draw the fill as ordinary content instead: an opaque window-colored rounded rectangle matching the native 16pt continuous corner, behind the menu. It renders as a real opaque layer the system shadow can hug. Verified on macOS 26 via layer inspection (a full-size opaque corner-16 layer now backs the window) and by capturing the popover in light and dark mode.

Fixes #646
Comment thread Cotabby/UI/MenuBarView.swift Outdated
FuJacob added 2 commits June 9, 2026 00:14
Addresses Greptile feedback: extract the measured 16pt radius into
macOS26PopoverCornerRadius so the coupling to the system popover shape is
documented and future OS changes are a one-line update.
@FuJacob FuJacob merged commit e9306d2 into main Jun 9, 2026
4 checks passed
@FuJacob FuJacob deleted the fix/popup-shadow-coverage-646 branch June 9, 2026 07:16
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.

[Bug] Wrong shadow around popup after fix #566

1 participant