From b00328674542c42c35058069122fd6e63ce2ffb4 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Thu, 2 Jul 2026 12:49:07 -0700 Subject: [PATCH] Fix macOS 27 UI issues (#814) * Fix janky macOS 27 glass appearance. * Fix janky macOS 27 glass appearance on multiline view too --- Sources/Secretive/Views/Views/CopyableView.swift | 10 +++++++--- Sources/Secretive/Views/Views/MultilineInfoView.swift | 11 +++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Sources/Secretive/Views/Views/CopyableView.swift b/Sources/Secretive/Views/Views/CopyableView.swift index 8765972..652882d 100644 --- a/Sources/Secretive/Views/Views/CopyableView.swift +++ b/Sources/Secretive/Views/Views/CopyableView.swift @@ -163,8 +163,7 @@ fileprivate struct BackgroundViewModifier: ViewModifier { } else { if #available(macOS 26.0, *) { content - // Very thin opacity lets user hover anywhere over the view, glassEffect doesn't allow. - .background(.white.opacity(0.01), in: RoundedRectangle(cornerRadius: 15)) + .contentShape(RoundedRectangle(cornerRadius: 15)) .glassEffect(.regular.tint(backgroundColor(interactionState: interactionState)), in: RoundedRectangle(cornerRadius: 15)) .mask(RoundedRectangle(cornerRadius: 15)) .shadow(color: .black.opacity(0.1), radius: 5) @@ -179,7 +178,12 @@ fileprivate struct BackgroundViewModifier: ViewModifier { func backgroundColor(interactionState: InteractionState) -> Color { guard appearsActive else { return Color.clear } if #available(macOS 26.0, *) { - let base = colorScheme == .dark ? Color(white: 0.2) : Color(white: 1) + let base: Color + if #available(macOS 27.0, *) { + base = .clear + } else { + base = colorScheme == .dark ? Color(white: 0.2) : Color(white: 1) + } switch interactionState { case .normal: return base diff --git a/Sources/Secretive/Views/Views/MultilineInfoView.swift b/Sources/Secretive/Views/Views/MultilineInfoView.swift index 396f29e..5bca064 100644 --- a/Sources/Secretive/Views/Views/MultilineInfoView.swift +++ b/Sources/Secretive/Views/Views/MultilineInfoView.swift @@ -53,7 +53,6 @@ struct MultilineInfoView: View { } } .safeAreaPadding(20) - ._background(interactionState: interactionStateIndex == item.offset ? interactionState : .normal, cornerRadius: 0) .onHover { hovering in withAnimation { guard item.element.action != nil else { return } @@ -117,8 +116,7 @@ fileprivate struct BackgroundViewModifier: ViewModifier { func body(content: Content) -> some View { if #available(macOS 26.0, *) { content - // Very thin opacity lets user hover anywhere over the view, glassEffect doesn't allow. - .background(.white.opacity(0.01), in: RoundedRectangle(cornerRadius: 15)) + .contentShape(RoundedRectangle(cornerRadius: cornerRadius)) .glassEffect(.regular.tint(backgroundColor(interactionState: interactionState)), in: RoundedRectangle(cornerRadius: cornerRadius)) .mask(RoundedRectangle(cornerRadius: cornerRadius)) .shadow(color: .black.opacity(0.1), radius: 5) @@ -132,7 +130,12 @@ fileprivate struct BackgroundViewModifier: ViewModifier { func backgroundColor(interactionState: InteractionState) -> Color { guard appearsActive else { return Color.clear } if #available(macOS 26.0, *) { - let base = colorScheme == .dark ? Color(white: 0.2) : Color(white: 1) + let base: Color + if #available(macOS 27.0, *) { + base = .clear + } else { + base = colorScheme == .dark ? Color(white: 0.2) : Color(white: 1) + } switch interactionState { case .normal: return base