From 0908384e4e7c8efff208c988e69bdd934e60af5a Mon Sep 17 00:00:00 2001 From: Nick Wolff Date: Fri, 25 Sep 2026 13:25:25 -0400 Subject: [PATCH] fix(palette): stop clipping the palette shadow - Widen the panel margin so the shadow fades out before the edge - Derive the margin from the shadow radius and offset --- App/CommandPalette/CommandPaletteController.swift | 7 +++++-- App/UI/CommandPaletteView.swift | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/App/CommandPalette/CommandPaletteController.swift b/App/CommandPalette/CommandPaletteController.swift index 8d848b2..8e3a2fd 100644 --- a/App/CommandPalette/CommandPaletteController.swift +++ b/App/CommandPalette/CommandPaletteController.swift @@ -22,8 +22,11 @@ enum PaletteMetrics { static let listPadding: CGFloat = 6 /// Transparent room around the glass for its SwiftUI shadow. The window /// shadow can't be used: it is cut from the panel's rectangle, not the - /// rounded glass. - static let shadowMargin: CGFloat = 32 + /// rounded glass. The blur fades out about 2× its radius past the glass, + /// plus the offset; anything smaller clips it to a hard, square edge. + static let shadowRadius: CGFloat = 16 + static let shadowY: CGFloat = 8 + static let shadowMargin: CGFloat = 3 * shadowRadius + shadowY static let maxListHeight: CGFloat = 8 * rowHeight + 2 * headerHeight + 2 * listPadding static func listHeight(for items: [PaletteItem], connecting: Bool = false) -> CGFloat { diff --git a/App/UI/CommandPaletteView.swift b/App/UI/CommandPaletteView.swift index acfbfde..f5b78a2 100644 --- a/App/UI/CommandPaletteView.swift +++ b/App/UI/CommandPaletteView.swift @@ -43,7 +43,7 @@ struct CommandPaletteView: View { .frame(width: PaletteMetrics.width) .containerShape(PaletteMetrics.panelShape) .glassSurface(in: PaletteMetrics.panelShape) - .shadow(color: .black.opacity(0.25), radius: 16, y: 8) + .shadow(color: .black.opacity(0.25), radius: PaletteMetrics.shadowRadius, y: PaletteMetrics.shadowY) .padding(PaletteMetrics.shadowMargin) .onAppear { fieldFocused = true } .onChange(of: controller.isPresented) { _, presented in