From 59370115ceaff8eeec8a73553f76e8d7146040bf Mon Sep 17 00:00:00 2001 From: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com> Date: Sun, 8 Feb 2026 19:16:07 -0800 Subject: [PATCH] Fix pill visibility: always render, use opacity to hide NSHostingView with frame (0,0) won't layout SwiftUI content, so fittingSize always returns 0 when transitioning from EmptyView. Instead, always render the pill button and use opacity/frame(0) to hide when idle. This ensures the hosting view always has content to measure. --- Sources/Update/UpdatePill.swift | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Sources/Update/UpdatePill.swift b/Sources/Update/UpdatePill.swift index 4854e4bc..ace5eb9b 100644 --- a/Sources/Update/UpdatePill.swift +++ b/Sources/Update/UpdatePill.swift @@ -11,17 +11,18 @@ struct UpdatePill: View { var body: some View { let state = model.effectiveState - if !state.isIdle { - pillButton - .popover( - isPresented: $showPopover, - attachmentAnchor: .rect(.bounds), - arrowEdge: .top - ) { - UpdatePopoverView(model: model) - } - .transition(.opacity.combined(with: .scale(scale: 0.95))) - } + let visible = !state.isIdle + pillButton + .popover( + isPresented: $showPopover, + attachmentAnchor: .rect(.bounds), + arrowEdge: .top + ) { + UpdatePopoverView(model: model) + } + .opacity(visible ? 1 : 0) + .frame(width: visible ? nil : 0, height: visible ? nil : 0) + .clipped() } @ViewBuilder