Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

feat(appearance): Liquid Glass becomes a theme choice with a computed chrome tint

iceclatterWT4d6a4d9fc341
diff --git a/src/core/settings-store.ts b/src/core/settings-store.ts
index 90de7d882..f8a2cc61b 100644
--- a/src/core/settings-store.ts
+++ b/src/core/settings-store.ts
@@ -91,6 +91,11 @@ function mergeSettings(saved: Partial<Settings> | null | undefined): Settings {
}
// Keep the mirror in lockstep with the resolved mode so an older build still honors the choice.
merged.vanillaLaunchDefault = merged.agentLaunchMode === "subscription";
+ // Pre-release switch that became the "Liquid Glass" appearance; honoured once so a tester's
+ // choice carries over, and only where the appearance still followed the terminal.
+ const legacyGlass = (saved as { glassTerminals?: unknown } | null | undefined)?.glassTerminals;
+ if (legacyGlass === true && merged.appTheme === "auto") merged.appTheme = "liquid-glass";
+ delete (merged as { glassTerminals?: unknown }).glassTerminals;
return merged;
}
diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx
index 6b0dc83c9..bd1f5ebb8 100644
--- a/src/renderer/App.tsx
+++ b/src/renderer/App.tsx
@@ -19,6 +19,8 @@ import { resolveUiScale } from '../shared/ui-scale'
import { resolveTabBarHeight } from '../shared/window-chrome-metrics'
import { useAppTheme } from './state/useAppTheme'
import { installWindowActivityOnDocument } from './lib/windowActivity'
+import { glassChromeAlpha, parseCssColor } from './lib/glassContrast'
+import { isLiquidGlass } from './lib/appTheme'
export default function App() {
// Apply the terminal-rendering setting to the two GPU coordinators, live. 'auto' is
@@ -72,6 +74,32 @@ export default function App() {
document.documentElement.dataset.theme = appTheme
}, [appTheme])
+ // Liquid Glass (Settings → Appearance). `data-nt-glass` switches the chrome rules in styles.css
+ // on, and `--glass-chrome-bg` is the ONE fill every glass chrome surface uses: the resolved
+ // `--panel` at the alpha that keeps the resolved `--text` at 4.5:1 over any backdrop
+ // (`glassChromeAlpha`). Read from the computed tokens rather than re-typed here, so the palette
+ // stays the one source of truth; declared after the data-theme effect, so it reads the tokens
+ // of the theme that effect just applied. An unparseable token leaves the chrome opaque.
+ const liquidGlass = isLiquidGlass(useSettings((s) => s.settings.appTheme))
+ useEffect(() => {
+ const root = document.documentElement
+ if (!liquidGlass) {
+ delete root.dataset.ntGlass
+ root.style.removeProperty('--glass-chrome-bg')
+ return
+ }
+ const css = getComputedStyle(root)
+ const text = css.getPropertyValue('--text').trim()
+ const panel = css.getPropertyValue('--panel').trim()
+ const alpha = glassChromeAlpha(text, panel)
+ const rgb = parseCssColor(panel)?.rgb
+ root.style.setProperty(
+ '--glass-chrome-bg',
+ alpha !== null && rgb ? `rgba(${rgb.join(', ')}, ${alpha.toFixed(3)})` : panel
+ )
+ root.dataset.ntGlass = 'on'
+ }, [liquidGlass, appTheme])
+
// Apply the UI scale as page zoom (issue #299 — 4K readability; the why-page-zoom write-up
// lives in shared/ui-scale.ts). Gated on `hydrated` so boot doesn't flash-reset a scaled window
// to the 100% default before settings.json has been read — Electron restores the zoom it
diff --git a/src/renderer/components/settings/sections/AppearanceSection.tsx b/src/renderer/components/settings/sections/AppearanceSection.tsx
index 1c0984252..5cafcc512 100644
--- a/src/renderer/components/settings/sections/AppearanceSection.tsx
+++ b/src/renderer/components/settings/sections/AppearanceSection.tsx
@@ -1,6 +1,8 @@
import { useEffect, useState } from 'react'
import { useSettings } from '../../../state/settings'
+import { isLiquidGlass } from '@renderer/lib/appTheme'
import {
+ defaultWallpaper,
GRADIENT_WALLPAPERS,
NO_WALLPAPER,
normalizeWallpaper,
@@ -37,7 +39,7 @@ import { APPEARANCE_RESET_KEYS } from '@renderer/lib/settingsReset'
const ROWS = {
appTheme: {
title: 'Appearance',
- keywords: ['appearance', 'theme', 'light', 'dark', 'mode', 'colour', 'color', 'chrome']
+ keywords: ['appearance', 'theme', 'light', 'dark', 'mode', 'colour', 'color', 'chrome', 'liquid', 'glass', 'blur', 'translucent', 'frosted']
},
uiScale: {
title: 'UI scale',
@@ -52,10 +54,6 @@ const ROWS = {
title: 'Desktop wallpaper',
keywords: ['wallpaper', 'background', 'desktop', 'image', 'picture', 'gradient', 'sonoma', 'canvas']
},
- glassTerminals: {
- title: 'Glass terminals',
- keywords: ['glass', 'liquid', 'blur', 'translucent', 'transparent', 'frosted', 'terminal']
- },
windowTitle: {
title: 'Window title',
keywords: [
@@ -334,8 +332,19 @@ export function AppearanceSection({ isActive }: { isActive: boolean }): React.JS
const hiddenHeaderButtons = useSettings((s) => s.settings.hiddenHeaderButtons)
const showResumeCard = useSettings((s) => s.settings.showResumeCard)
const windowTitleActiveSession = useSettings((s) => s.settings.windowTitleActiveSession)
- const glassTerminals = useSettings((s) => s.settings.glassTerminals)
const update = useSettings((s) => s.update)
+ // Glass over plain black reads as a dark theme with smudges, so choosing Liquid Glass with no
+ // wallpaper also picks one. Only when there is none: a wallpaper the user chose is never
+ // replaced, and re-checked after the (possibly slow, first-run thumbnail) stills listing.
+ const chooseAppTheme = async (v: typeof appTheme): Promise<void> => {
+ update({ appTheme: v })
+ if (!isLiquidGlass(v)) return
+ const hasWallpaper = () =>
+ normalizeWallpaper(useSettings.getState().settings.desktopWallpaper).kind !== 'none'
+ if (hasWallpaper()) return
+ const stills = await window.nodeTerminal.wallpaper.listStills().catch(() => [])
+ if (!hasWallpaper()) update({ desktopWallpaper: defaultWallpaper(stills) })
+ }
return (
<SettingsSection
id="appearance"
@@ -346,16 +355,21 @@ export function AppearanceSection({ isActive }: { isActive: boolean }): React.JS
<SearchableRow {...ROWS.appTheme}>
<FieldRow
label="Appearance"
- description="Follow terminal theme uses the colour theme you picked in Settings → Terminal, so a light terminal isn't framed by a dark window."
+ description={
+ "Follow terminal uses the colour theme you picked in Settings → Terminal, so a light terminal isn't framed by a dark window. " +
+ 'Liquid Glass follows it too, and turns nodes, the tab bar, dock, menus, sidebar, dialogs and this page into frosted glass over the desktop wallpaper (one is picked for you if none is set); terminal windows drop their colour accents. ' +
+ 'Tints keep regular text at 4.5:1 contrast whatever is behind it (a Solarized Light terminal is already below that and stays opaque); secondary text and coloured output such as red or blue can fade over bright parts of the wallpaper.'
+ }
control={
<SegmentedPill
value={appTheme}
options={[
{ value: 'auto', label: 'Follow terminal' },
{ value: 'dark', label: 'Dark' },
- { value: 'light', label: 'Light' }
+ { value: 'light', label: 'Light' },
+ { value: 'liquid-glass', label: 'Liquid Glass' }
]}
- onChange={(v) => update({ appTheme: v })}
+ onChange={(v) => void chooseAppTheme(v)}
ariaLabel="Appearance"
/>
}
@@ -395,19 +409,6 @@ export function AppearanceSection({ isActive }: { isActive: boolean }): React.JS
<SearchableRow {...ROWS.wallpaper}>
<WallpaperPicker />
</SearchableRow>
- <SearchableRow {...ROWS.glassTerminals}>
- <FieldRow
- label="Glass terminals"
- description="Terminal nodes become frosted glass over the wallpaper or canvas. Their tint is set per terminal theme so regular text keeps at least 4.5:1 contrast whatever is behind it (Solarized Light is already below that and stays opaque). Coloured output such as red or blue can fade over bright parts of the wallpaper. Terminal nodes only."
- control={
- <Switch
- checked={glassTerminals === true}
- onChange={(v) => update({ glassTerminals: v })}
- ariaLabel="Glass terminals"
- />
- }
- />
- </SearchableRow>
<SearchableRow {...ROWS.windowTitle}>
<FieldRow
label="Show active session in window title"
diff --git a/src/renderer/lib/appTheme.test.ts b/src/renderer/lib/appTheme.test.ts
index 38076ad1f..0a0fd47c7 100644
--- a/src/renderer/lib/appTheme.test.ts
+++ b/src/renderer/lib/appTheme.test.ts
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest'
-import { resolveAppTheme, type AppThemePref } from './appTheme'
+import { isLiquidGlass, resolveAppTheme, type AppThemePref } from './appTheme'
describe('resolveAppTheme', () => {
it('follows the terminal theme on auto', () => {
@@ -19,3 +19,14 @@ describe('resolveAppTheme', () => {
expect(resolveAppTheme(undefined as unknown as AppThemePref, false)).toBe('dark')
})
})
+
+describe('Liquid Glass appearance', () => {
+ it('follows the terminal theme for its light/dark base, like auto', () => {
+ expect(resolveAppTheme('liquid-glass', true)).toBe('dark')
+ expect(resolveAppTheme('liquid-glass', false)).toBe('light')
+ })
+ it('is on only for the liquid-glass value', () => {
+ expect(isLiquidGlass('liquid-glass')).toBe(true)
+ for (const v of ['auto', 'dark', 'light', undefined, true]) expect(isLiquidGlass(v)).toBe(false)
+ })
+})
diff --git a/src/renderer/lib/appTheme.ts b/src/renderer/lib/appTheme.ts
index 7124212f7..c7e775730 100644
--- a/src/renderer/lib/appTheme.ts
+++ b/src/renderer/lib/appTheme.ts
@@ -1,5 +1,11 @@
/** What the app chrome follows. `auto` takes it from the terminal colour theme. */
-export type AppThemePref = 'auto' | 'dark' | 'light'
+export type AppThemePref = 'auto' | 'dark' | 'light' | 'liquid-glass'
+
+/** Is the Liquid Glass appearance on? It is a theme choice whose light/dark base follows the
+ * terminal theme, exactly like `auto`. */
+export function isLiquidGlass(pref: unknown): boolean {
+ return pref === 'liquid-glass'
+}
/** What actually gets rendered. */
export type ResolvedAppTheme = 'dark' | 'light'
@@ -19,7 +25,7 @@ export type ResolvedAppTheme = 'dark' | 'light'
export function resolveAppTheme(pref: AppThemePref, terminalThemeIsDark: boolean): ResolvedAppTheme {
if (pref === 'light') return 'light'
if (pref === 'dark') return 'dark'
- if (pref !== 'auto') return 'dark'
+ if (pref !== 'auto' && pref !== 'liquid-glass') return 'dark'
return terminalThemeIsDark ? 'dark' : 'light'
}
diff --git a/src/renderer/lib/glassContrast.test.ts b/src/renderer/lib/glassContrast.test.ts
index 5a5c99564..ac1db97ef 100644
--- a/src/renderer/lib/glassContrast.test.ts
+++ b/src/renderer/lib/glassContrast.test.ts
@@ -1,3 +1,5 @@
+import { readFileSync } from 'node:fs'
+import { join } from 'node:path'
import { describe, expect, it } from 'vitest'
import { TERMINAL_THEMES } from '../terminal/themes'
import {
@@ -6,6 +8,9 @@ import {
composite,
contrastRatio,
glassTintAlpha,
+ chromeContrast,
+ glassChromeAlpha,
+ parseCssColor,
parseHex,
worstContrast
} from './glassContrast'
@@ -85,3 +90,46 @@ describe('glassTintAlpha', () => {
expect(glassTintAlpha('nope', '#000000')).toBe(GLASS_ALPHA_MAX)
})
})
+
+describe('glassChromeAlpha (Liquid Glass chrome, both app themes)', () => {
+ // Read the real tokens, so a palette change re-proves the guarantee instead of drifting past it.
+ const CSS = readFileSync(join(__dirname, '../styles.css'), 'utf8').replace(/\r\n/g, '\n')
+ function block(selector: string): string {
+ const start = CSS.indexOf(`${selector} {`)
+ return CSS.slice(start, CSS.indexOf('\n}', start))
+ }
+ function token(body: string, name: string): string | undefined {
+ return new RegExp(`\\n\\s*${name}:\\s*([^;]+);`).exec(body)?.[1].trim()
+ }
+ const dark = block(':root')
+ const light = block(":root[data-theme='light']")
+ const resolve = (theme: string, name: string): string => {
+ const raw = token(theme, name) ?? token(dark, name)!
+ const tint = token(theme, '--tint-rgb') ?? token(dark, '--tint-rgb')!
+ return raw.replace('var(--tint-rgb)', tint)
+ }
+
+ it.each([
+ ['dark', dark],
+ ['light', light]
+ ])('%s: --text on the glass --panel keeps 4.5:1 over a fine grey sweep, below opaque', (_n, theme) => {
+ const text = parseCssColor(resolve(theme, '--text'))!
+ const panel = parseCssColor(resolve(theme, '--panel'))!.rgb
+ const a = glassChromeAlpha(resolve(theme, '--text'), resolve(theme, '--panel'))!
+ expect(a).toBeGreaterThanOrEqual(GLASS_ALPHA_MIN)
+ expect(a).toBeLessThan(1)
+ for (let v = 0; v <= 255; v++) {
+ expect(chromeContrast(text, panel, a, [v, v, v])).toBeGreaterThanOrEqual(4.5)
+ }
+ for (const b of [[255, 0, 0], [0, 255, 0], [0, 0, 255], [255, 255, 0], [0, 255, 255], [255, 0, 255]] as const) {
+ expect(chromeContrast(text, panel, a, b)).toBeGreaterThanOrEqual(4.5)
+ }
+ })
+
+ it('parses the colour forms the tokens use', () => {
+ expect(parseCssColor('rgba(58, 48, 38, 0.85)')).toEqual({ rgb: [58, 48, 38], alpha: 0.85 })
+ expect(parseCssColor('#282828')).toEqual({ rgb: [40, 40, 40], alpha: 1 })
+ expect(parseCssColor('rgb(1,2,3)')).toEqual({ rgb: [1, 2, 3], alpha: 1 })
+ expect(glassChromeAlpha('nope', '#000')).toBeNull()
+ })
+})
diff --git a/src/renderer/lib/glassContrast.ts b/src/renderer/lib/glassContrast.ts
index 623ab39f8..c90f64f8e 100644
--- a/src/renderer/lib/glassContrast.ts
+++ b/src/renderer/lib/glassContrast.ts
@@ -127,3 +127,62 @@ export function glassTint(theme: { background?: string; foreground?: string }):
foreground
}
}
+
+/* ------------------------------------------------------------------------------------------- *
+ * Liquid Glass CHROME (tab bar, dock, menus, sidebar, dialogs, Settings, non-terminal nodes).
+ *
+ * Same guarantee, one difference that matters: the app's `--text` is itself TRANSLUCENT
+ * (`rgba(var(--tint-rgb), 0.85)`), so the ink a user sees is the text colour blended over the
+ * surface it sits on — and that surface is now a blend over an unknown backdrop. The foreground
+ * therefore moves WITH the backdrop, which breaks the white/black endpoint argument above (it
+ * assumes a fixed fg). So this one samples: a 6×6×6 grid of backdrop colours (every channel at
+ * 0, 51, …, 255) plus a grey ramp at step 5. `glassContrast.test.ts` re-checks the answer on a
+ * finer grey sweep for both app themes.
+ * ------------------------------------------------------------------------------------------- */
+
+/** `#hex`, `rgb(r, g, b)` or `rgba(r, g, b, a)` → channels + alpha; null when unparseable. */
+export function parseCssColor(css: string): { rgb: Rgb; alpha: number } | null {
+ const hex = parseHex(css)
+ if (hex) return { rgb: hex, alpha: 1 }
+ const m = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+)\s*)?\)$/i.exec(css.trim())
+ if (!m) return null
+ return { rgb: [Number(m[1]), Number(m[2]), Number(m[3])], alpha: m[4] === undefined ? 1 : Number(m[4]) }
+}
+
+const CHROME_BACKDROPS: Rgb[] = (() => {
+ const out: Rgb[] = []
+ for (let r = 0; r <= 255; r += 51)
+ for (let g = 0; g <= 255; g += 51) for (let b = 0; b <= 255; b += 51) out.push([r, g, b])
+ for (let v = 0; v <= 255; v += 5) out.push([v, v, v])
+ return out
+})()
+
+/** Contrast of (possibly translucent) text on `panel`@`alpha` over one backdrop pixel. */
+export function chromeContrast(
+ text: { rgb: Rgb; alpha: number },
+ panel: Rgb,
+ alpha: number,
+ backdrop: Rgb
+): number {
+ const surface = composite(panel, backdrop, alpha)
+ return contrastRatio(composite(text.rgb, surface, text.alpha), surface)
+}
+
+/**
+ * The smallest alpha (floored at 0.55) for a chrome surface of colour `panel` that keeps `text`
+ * at `minRatio` over every sampled backdrop; 1 when even opaque does not reach it; null when a
+ * colour cannot be parsed (the caller then leaves the chrome opaque).
+ */
+export function glassChromeAlpha(text: string, panel: string, minRatio = 4.5): number | null {
+ const t = parseCssColor(text)
+ const p = parseCssColor(panel)
+ if (!t || !p) return null
+ let lowest = Infinity
+ for (let i = Math.round(1 / STEP); i >= 0; i--) {
+ const a = i * STEP
+ if (!CHROME_BACKDROPS.every((b) => chromeContrast(t, p.rgb, a, b) >= minRatio)) break
+ lowest = a
+ }
+ if (lowest === Infinity) return 1
+ return Math.max(GLASS_ALPHA_MIN, lowest)
+}
diff --git a/src/renderer/lib/settingsReset.ts b/src/renderer/lib/settingsReset.ts
index 742295a46..67df9e709 100644
--- a/src/renderer/lib/settingsReset.ts
+++ b/src/renderer/lib/settingsReset.ts
@@ -38,7 +38,6 @@ export const APPEARANCE_RESET_KEYS = [
'tabBarHeight',
'accent',
'desktopWallpaper',
- 'glassTerminals',
'hiddenNodeMenuItems',
'hiddenHeaderButtons',
'showResumeCard',
diff --git a/src/renderer/nodes/TerminalNode.tsx b/src/renderer/nodes/TerminalNode.tsx
index f7ee06430..9b69d6588 100644
--- a/src/renderer/nodes/TerminalNode.tsx
+++ b/src/renderer/nodes/TerminalNode.tsx
@@ -179,6 +179,7 @@ import { ContextMeter } from '../components/ContextMeter'
import { isZoomModifierHeld } from '../lib/zoomModifier'
import { isHidden } from '../lib/ui-visibility'
import { glassTint } from '../lib/glassContrast'
+import { isLiquidGlass } from '../lib/appTheme'
import { resolveTerminalTheme } from '../terminal/themes'
import { readsClaudeTranscript } from '../lib/transcriptGates'
import { liveProjectJumpTarget } from '../lib/projectJump'
@@ -1246,7 +1247,7 @@ export function TerminalNode({
// Glass terminals (Settings → Appearance): xterm paints no background and the node supplies a
// translucent tint of THIS node's effective theme — project override included — at the alpha
// that keeps its foreground at 4.5:1 over any backdrop (lib/glassContrast.ts).
- const glass = useSettings((s) => s.settings.glassTerminals) === true
+ const glass = isLiquidGlass(useSettings((s) => s.settings.appTheme))
const glassVars = useMemo(() => {
if (!glass) return null
const tint = glassTint(resolveTerminalTheme(visual.terminalTheme).theme)
@@ -2116,7 +2117,7 @@ export function TerminalNode({
const s = useSettings.getState().settings
// Appearance comes from ONE place, shared with the kanban card modal's viewer of this same
// session (`ModalTerminal`) — see `xtermOptionsFromSettings`.
- const term = parked?.term ?? new Terminal(xtermOptionsFromSettings(s, s.glassTerminals === true))
+ const term = parked?.term ?? new Terminal(xtermOptionsFromSettings(s, isLiquidGlass(s.appTheme)))
// Only on a FRESH instance: a parked terminal already carries the table, and the buffer it kept
// alive was measured with it — re-registering under a live buffer buys nothing.
if (!parked) activateUnicode11(term)
diff --git a/src/shared/types.ts b/src/shared/types.ts
index aa1b7d90b..4b3610475 100644
--- a/src/shared/types.ts
+++ b/src/shared/types.ts
@@ -1397,8 +1397,12 @@ export interface Settings {
cursorBlink: boolean
/** Appearance of the APP chrome (tab bar, panels, node headers, menus). `auto` (the default)
* takes it from the terminal colour theme, so picking a light terminal theme doesn't leave a
- * black window framing it; `dark`/`light` pin it. See renderer/lib/appTheme.ts. */
- appTheme: 'auto' | 'dark' | 'light'
+ * black window framing it; `dark`/`light` pin it. `liquid-glass` follows the terminal theme like
+ * `auto` AND turns the Liquid Glass appearance on: every canvas node and the app chrome go
+ * translucent + blurred over the wallpaper, and terminal windows drop their per-node accent
+ * colour; tint opacities keep the primary text at WCAG 4.5:1 over any backdrop
+ * (renderer/lib/glassContrast.ts). See renderer/lib/appTheme.ts. */
+ appTheme: 'auto' | 'dark' | 'light' | 'liquid-glass'
/** Scale factor for the whole application UI (1 = 100%; issue #299, 4K readability). Applied as
* PAGE ZOOM (`webFrame.setZoomFactor`) on desktop, so menus, node headers, dialogs — and
* terminal glyphs — all scale together: the terminal font-size setting stays in CSS px, so its
@@ -1421,10 +1425,6 @@ export interface Settings {
/** Desktop wallpaper behind the canvas (Liquid Glass appearance). Opt-in; `none` draws the
* canvas exactly as before. Hand-editable: read through `normalizeWallpaper` (shared/wallpaper). */
desktopWallpaper: import('./wallpaper').DesktopWallpaper
- /** Frosted-glass terminal nodes: translucent tint + backdrop blur, with the tint's opacity
- * computed per terminal theme so text keeps WCAG 4.5:1 over any backdrop
- * (renderer/lib/glassContrast.ts). Terminal nodes only. Opt-in. */
- glassTerminals: boolean
/** Weight for normal text. xterm's own default is `normal` (400). */
fontWeight: number
/** Weight for BOLD text. xterm's own default is `bold` (700). Lowering it is how you keep bold
@@ -1859,7 +1859,6 @@ export const DEFAULT_SETTINGS: Settings = {
windowTitleActiveSession: false,
terminalTheme: 'nodeterm-dark',
desktopWallpaper: { kind: 'none' },
- glassTerminals: false,
fontWeight: 400,
fontWeightBold: 700,
drawBoldTextInBrightColors: true,
diff --git a/src/shared/wallpaper.test.ts b/src/shared/wallpaper.test.ts
new file mode 100644
index 000000000..c7516a70b
--- /dev/null
+++ b/src/shared/wallpaper.test.ts
@@ -0,0 +1,13 @@
+import { describe, expect, it } from 'vitest'
+import { defaultWallpaper, GRADIENT_WALLPAPERS, normalizeWallpaper } from './wallpaper'
+
+describe('defaultWallpaper (Liquid Glass chosen with no wallpaper)', () => {
+ it('takes the first still (the scan puts Sonoma Horizon first)', () => {
+ expect(defaultWallpaper([{ id: 'mac:a' }, { id: 'mac:b' }])).toEqual({ kind: 'preset', id: 'mac:a' })
+ })
+ it('falls back to a gradient where there are no stills', () => {
+ const w = defaultWallpaper([])
+ expect(w).toEqual({ kind: 'preset', id: GRADIENT_WALLPAPERS[0].id })
+ expect(normalizeWallpaper(w)).toEqual(w)
+ })
+})
diff --git a/src/shared/wallpaper.ts b/src/shared/wallpaper.ts
index d740be2e3..5a1688af2 100644
--- a/src/shared/wallpaper.ts
+++ b/src/shared/wallpaper.ts
@@ -101,6 +101,15 @@ export function normalizeWallpaper(v: unknown): DesktopWallpaper {
return NO_WALLPAPER
}
+/**
+ * What Liquid Glass picks when it is chosen with no wallpaper, so glass never sits over plain
+ * black: the first macOS still (the scan already orders Sonoma Horizon first), else the first
+ * gradient — the answer on Linux, Windows and the Server Edition, where the list is empty.
+ */
+export function defaultWallpaper(stills: readonly { id: string }[]): DesktopWallpaper {
+ return stills[0] ? { kind: 'preset', id: stills[0].id } : { kind: 'preset', id: GRADIENT_WALLPAPERS[0].id }
+}
+
export function sameWallpaper(a: DesktopWallpaper, b: DesktopWallpaper): boolean {
if (a.kind !== b.kind) return false
if (a.kind === 'preset') return a.id === (b as { id: string }).id