Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions apps/native/Sources/VisionNativeUI/Components/VisionCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import AppKit
import SwiftUI
import VisionNativeCore

/// The web `<Card>` surface (`card-material premium-frame rounded-card`, plus `glass-thin`, or
/// `glass-regular` under Full effects: index.css; components/ui/card.tsx): the material gradient,
/// The web `<Card>` surface (`card-material premium-frame rounded-card glass-regular`: index.css;
/// components/ui/card.tsx, whose `glass-thin` without Full effects the Swift app does not switch to): the material gradient,
/// the `--border`/0.7 frame, the embossed inset edge (a top highlight and, in light mode, a bottom
/// hairline) and the soft drop shadow. Print reports keep a flat white card with a hairline.
///
Expand Down Expand Up @@ -43,12 +43,15 @@ struct VisionCardBackground: View {
let palette = theme.palette
let dark = theme.isDark
let lifted = interactive && hovering
// card.tsx: `fullEffects ? "glass-regular" : "glass-thin"`.
let material = (fullEffects ? GlassMaterialSpec.regular : GlassMaterialSpec.thin).appearance(isDark: dark)
// card.tsx switches `glass-thin` to `glass-regular` under Full effects, which changes the
// card's colour. The Swift app keeps one card colour whatever the profile (Tor,
// 2026-11-14): `glass-regular`, the look of the default Standard tier with Full effects
// on auto. Full effects still raises the hover highlight below.
let material = GlassMaterialSpec.regular.appearance(isDark: dark)
// `.premium-frame` sets `--border`/0.7, but in dark mode `.dark .glass-regular` (two
// classes) outranks it with `--glass-border`/0.08; the hover frame outranks both.
let restingFrame: Color =
fullEffects && dark && !opaque
dark && !opaque
? Color(token: palette.color(material.border.color), opacity: material.border.alpha)
: theme.border.opacity(0.7)
// `.premium-frame-interactive:hover` frame: `--primary` at 0.4, dark 0.5.
Expand Down
23 changes: 9 additions & 14 deletions apps/native/Sources/VisionNativeUI/ShellGlassViews.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ struct SidebarGlassBackground: View {
if visualEffects == .reduced || reduceTransparency {
Color(token: glass.sidebarTop)
} else {
VibrancyBackground(
material: .sidebar,
blendingMode: visualEffects == .enhanced ? .behindWindow : .withinWindow)
// Within the window on every tier (Tor, 2026-11-14: colours stay the same across
// performance profiles in the Swift app): desktop vibrancy behind the window let the
// wallpaper tint the sidebar on Enhanced only.
VibrancyBackground(material: .sidebar, blendingMode: .withinWindow)
// No second blur pass over the vibrancy, Full effects or not: the desktop rail
// filters with saturate alone (`.app-sidebar.glass-chrome`, index.css phase D),
// which SwiftUI cannot apply to a backdrop.
Expand All @@ -80,22 +81,16 @@ struct SidebarGlassBackground: View {
}
}

/// The detail column is opaque in Standard and Reduced. Enhanced opts into desktop
/// vibrancy, tinted with the page's background; Reduce Transparency always wins.
/// The detail column: the opaque page background under the aurora on every tier. The web's
/// Enhanced tier lets the desktop show through (`html.electron-mac.vibrancy body` at 0.72); the
/// Swift app keeps one background colour across performance profiles (Tor, 2026-11-14), so
/// the tiers differ only in their effects.
struct DetailGlassBackground: View {
@Environment(\.visionTheme) var theme
@Environment(\.visionVisualEffects) private var visualEffects
@Environment(\.accessibilityReduceTransparency) private var reduceTransparency

var body: some View {
let glass = theme.glass
ZStack {
if visualEffects == .enhanced && !reduceTransparency {
VibrancyBackground(material: .underWindowBackground, blendingMode: .behindWindow)
Color(token: glass.detailTint, opacity: glass.detailTintOpacity)
} else {
Color(token: glass.detailTint)
}
Color(token: theme.glass.detailTint)
AuroraCanvas()
}
.ignoresSafeArea()
Expand Down
Loading