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(glass): accessibility fallbacks for Liquid Glass

iceclatterWTa945b8f86034
diff --git a/CLAUDE.md b/CLAUDE.md
index 7815c3bf2..b1264d406 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -3902,6 +3902,16 @@ glass never sits over plain black; a wallpaper the user chose is never replaced.
moves (`.canvas-moving`); chrome keeps both. MEASURED on the live dev build (CDP computed style):
Chromium keeps `url("#nt-refract") blur(…) saturate(…)` on the tab bar, dock, sessions sidebar,
minimap, zoom controls and terminal nodes.
+- **Accessibility outranks the slider** (HIG liquid-glass.md, like iOS). `lib/useGlassA11y.ts`
+ reads `prefers-reduced-transparency` and `prefers-contrast: more` (one subscription, Electron and
+ browser alike) and `glassSurfaceAlpha` applies them to every tint alpha: **Reduce Transparency**
+ = alpha 1, no blur, no refraction filter in the DOM, no sheen, and the slider row is disabled
+ with the reason; **Increase Contrast** = the slider pins to Tinted, `--glass-edge` goes to 0.5,
+ terminal borders thicken and the `--sys-*` palette takes HIG's increased-contrast columns
+ (`SYSTEM_COLORS.darkContrast|lightContrast`, pinned to the CSS). The alpha half lives in JS
+ because the fills are INLINE custom properties a media query cannot override. **Reduce Motion**
+ holds the three state glows static-lit (the idle gate's values) and stops the minimap and badge
+ pulses, in every appearance — the state still reads, nothing breathes.
- **Surfaces.** Desktop: full. Server Edition: gradients + glass; the stills list is empty (not
macOS) and "Choose image…" is hidden (a picker there browses the SERVER's disk). Relay tabs keep
a stub (no stills, import refused). Mobile: N/A (no canvas). Kanban: N/A (the board is opaque).
diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx
index 414b5c12c..1db80f3ef 100644
--- a/src/renderer/App.tsx
+++ b/src/renderer/App.tsx
@@ -19,7 +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, glassSheen, glassSliderAlpha, parseCssColor, resolveGlassSlider } from './lib/glassContrast'
+import { glassChromeAlpha, glassSheen, glassSurfaceAlpha, parseCssColor, resolveGlassSlider } from './lib/glassContrast'
+import { useGlassA11y } from './lib/useGlassA11y'
import { GlassRefraction } from './components/GlassRefraction'
import { isLiquidGlass } from './lib/appTheme'
@@ -85,6 +86,8 @@ export default function App() {
// The Glass slider moves every surface between Clear and Tinted through its own readable alpha
// (glassSliderAlpha); `--glass-t` scales the blur and `--glass-sheen` the specular wash in CSS.
const glassSlider = resolveGlassSlider(useSettings((s) => s.settings.glassTint))
+ // Reduce Transparency / Increase Contrast outrank the slider (opaque / Tinted), like iOS.
+ const glassA11y = useGlassA11y()
useEffect(() => {
const root = document.documentElement
if (!liquidGlass) {
@@ -105,13 +108,13 @@ export default function App() {
root.style.setProperty(
'--glass-chrome-bg',
readable !== null && rgb
- ? `rgba(${rgb.join(', ')}, ${glassSliderAlpha(glassSlider, readable).toFixed(3)})`
+ ? `rgba(${rgb.join(', ')}, ${glassSurfaceAlpha(glassSlider, readable, glassA11y).toFixed(3)})`
: panel
)
root.style.setProperty('--glass-t', glassSlider.toFixed(3))
- root.style.setProperty('--glass-sheen', glassSheen(glassSlider).toFixed(3))
+ root.style.setProperty('--glass-sheen', glassA11y.reduceTransparency ? '0' : glassSheen(glassSlider).toFixed(3))
root.dataset.ntGlass = 'on'
- }, [liquidGlass, appTheme, glassSlider])
+ }, [liquidGlass, appTheme, glassSlider, glassA11y])
// 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
@@ -140,7 +143,7 @@ export default function App() {
{/* The node-icon picker, opened from the node menu, a node header and the kanban card
modal — one dialog for all three, driven by nodeIconDialog(). */}
<NodeIconDialogHost />
- {liquidGlass && <GlassRefraction slider={glassSlider} />}
+ {liquidGlass && !glassA11y.reduceTransparency && <GlassRefraction slider={glassSlider} />}
</ReactFlowProvider>
</SessionProvider>
)
diff --git a/src/renderer/components/settings/sections/AppearanceSection.tsx b/src/renderer/components/settings/sections/AppearanceSection.tsx
index 161f2d633..4f090cf9f 100644
--- a/src/renderer/components/settings/sections/AppearanceSection.tsx
+++ b/src/renderer/components/settings/sections/AppearanceSection.tsx
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'
import { useSettings } from '../../../state/settings'
import { isLiquidGlass } from '@renderer/lib/appTheme'
import { GLASS_READABLE_TICK, resolveGlassSlider } from '@renderer/lib/glassContrast'
+import { useGlassA11y } from '@renderer/lib/useGlassA11y'
import { showCanvasDots } from '@renderer/lib/canvasDots'
import {
defaultWallpaper,
@@ -343,6 +344,8 @@ export function AppearanceSection({ isActive }: { isActive: boolean }): React.JS
const showResumeCard = useSettings((s) => s.settings.showResumeCard)
const canvasDots = useSettings((s) => s.settings.canvasDots)
const glassSlider = resolveGlassSlider(useSettings((s) => s.settings.glassTint))
+ const glassA11y = useGlassA11y()
+ const glassLocked = glassA11y.reduceTransparency || glassA11y.moreContrast
const windowTitleActiveSession = useSettings((s) => s.settings.windowTitleActiveSession)
const update = useSettings((s) => s.update)
// Glass over plain black reads as a dark theme with smudges, so choosing Liquid Glass with no
@@ -393,18 +396,23 @@ export function AppearanceSection({ isActive }: { isActive: boolean }): React.JS
<FieldRow
label="Glass"
description={
- glassSlider < GLASS_READABLE_TICK
+ glassA11y.reduceTransparency
+ ? 'Reduce Transparency is on in your system settings, so glass is opaque. Turn it off there to use this slider.'
+ : glassA11y.moreContrast
+ ? 'Increase Contrast is on in your system settings, so glass stays at Tinted with stronger edges.'
+ : glassSlider < GLASS_READABLE_TICK
? 'Clearer than Readable: the wallpaper shows through more, and text contrast is no longer guaranteed.'
: 'From Readable to Tinted, regular text keeps 4.5:1 contrast over any wallpaper.'
}
control={
- <div className="flex w-56 flex-col gap-1">
+ <div className={cn('flex w-56 flex-col gap-1', glassLocked && 'pointer-events-none opacity-40')}>
<input
type="range"
min={0}
max={1}
step={0.01}
list="nt-glass-ticks"
+ disabled={glassLocked}
value={glassSlider}
aria-label="Glass, from Clear to Tinted"
aria-valuetext={
diff --git a/src/renderer/lib/glassContrast.test.ts b/src/renderer/lib/glassContrast.test.ts
index a83c9391f..9ab38601a 100644
--- a/src/renderer/lib/glassContrast.test.ts
+++ b/src/renderer/lib/glassContrast.test.ts
@@ -20,7 +20,8 @@ import {
glassSheen,
glassSliderAlpha,
glassTint,
- resolveGlassSlider
+ resolveGlassSlider,
+ glassSurfaceAlpha
} from './glassContrast'
const WHITE = [255, 255, 255] as const
@@ -198,3 +199,11 @@ describe('Glass slider (Clear ↔ Tinted)', () => {
expect(at(1)).toBeGreaterThanOrEqual(at(GLASS_READABLE_TICK))
})
})
+
+describe('accessibility outranks the Glass slider', () => {
+ it('Reduce Transparency is opaque; Increase Contrast pins to Tinted', () => {
+ expect(glassSurfaceAlpha(0, 0.7, { reduceTransparency: true, moreContrast: false })).toBe(1)
+ expect(glassSurfaceAlpha(0, 0.7, { reduceTransparency: false, moreContrast: true })).toBe(glassSliderAlpha(1, 0.7))
+ expect(glassSurfaceAlpha(0.3, 0.7)).toBe(glassSliderAlpha(0.3, 0.7))
+ })
+})
diff --git a/src/renderer/lib/glassContrast.ts b/src/renderer/lib/glassContrast.ts
index a1a2c6d7e..8354b6df1 100644
--- a/src/renderer/lib/glassContrast.ts
+++ b/src/renderer/lib/glassContrast.ts
@@ -118,12 +118,13 @@ export interface GlassTint {
* its background is not a colour we can parse. */
export function glassTint(
theme: { background?: string; foreground?: string },
- slider: number = GLASS_READABLE_TICK
+ slider: number = GLASS_READABLE_TICK,
+ a11y: GlassA11y = NO_GLASS_A11Y
): GlassTint | null {
const bg = theme.background ? parseHex(theme.background) : null
if (!bg) return null
const foreground = theme.foreground ?? '#ffffff'
- const alpha = glassSliderAlpha(slider, glassTintAlpha(foreground, theme.background!))
+ const alpha = glassSurfaceAlpha(slider, glassTintAlpha(foreground, theme.background!), a11y)
const rgb = bg.join(', ')
return {
background: `rgba(${rgb}, ${alpha.toFixed(3)})`,
@@ -241,3 +242,18 @@ export const GLASS_REFRACT_MAX = 0.06
export function glassRefraction(t: number): number {
return GLASS_REFRACT_MAX * (1 - t)
}
+
+/** The system accessibility settings that outrank the Glass slider, like iOS. */
+export interface GlassA11y {
+ /** Reduce Transparency: glass becomes opaque (and loses blur, refraction and sheen in CSS). */
+ reduceTransparency: boolean
+ /** Increase Contrast: the slider pins to the Tinted end. */
+ moreContrast: boolean
+}
+export const NO_GLASS_A11Y: GlassA11y = { reduceTransparency: false, moreContrast: false }
+
+/** The tint alpha a surface actually gets: the slider's, unless an accessibility setting wins. */
+export function glassSurfaceAlpha(t: number, readable: number, a11y: GlassA11y = NO_GLASS_A11Y): number {
+ if (a11y.reduceTransparency) return 1
+ return glassSliderAlpha(a11y.moreContrast ? 1 : t, readable)
+}
diff --git a/src/renderer/lib/palette.ts b/src/renderer/lib/palette.ts
index 14ff6ba64..2f3c9ef12 100644
--- a/src/renderer/lib/palette.ts
+++ b/src/renderer/lib/palette.ts
@@ -19,7 +19,10 @@ export type SystemColor =
| 'brown'
| 'gray'
-export const SYSTEM_COLORS: Record<'dark' | 'light', Record<SystemColor, string>> = {
+export const SYSTEM_COLORS: Record<
+ 'dark' | 'light' | 'darkContrast' | 'lightContrast',
+ Record<SystemColor, string>
+> = {
dark: {
red: '#ff453a',
orange: '#ff9f0a',
@@ -49,6 +52,38 @@ export const SYSTEM_COLORS: Record<'dark' | 'light', Record<SystemColor, string>
pink: '#ff2d55',
brown: '#a2845e',
gray: '#8e8e93'
+ },
+ // HIG color.md's "Increased contrast" columns — what Liquid Glass switches to under the system
+ // Increase Contrast setting (styles.css, the accessibility block at the end).
+ darkContrast: {
+ red: '#ff6961',
+ orange: '#ffb340',
+ yellow: '#ffd426',
+ green: '#30db5b',
+ mint: '#66d4cf',
+ teal: '#5de6ff',
+ cyan: '#70d7ff',
+ blue: '#409cff',
+ indigo: '#7d7aff',
+ purple: '#da8fff',
+ pink: '#ff6482',
+ brown: '#b59469',
+ gray: '#aeaeb2'
+ },
+ lightContrast: {
+ red: '#d70015',
+ orange: '#c93400',
+ yellow: '#b25000',
+ green: '#248a3d',
+ mint: '#0c817b',
+ teal: '#008299',
+ cyan: '#0071a4',
+ blue: '#0040dd',
+ indigo: '#3634a3',
+ purple: '#8944ab',
+ pink: '#d30f45',
+ brown: '#7f6545',
+ gray: '#6c6c70'
}
}
diff --git a/src/renderer/lib/useGlassA11y.ts b/src/renderer/lib/useGlassA11y.ts
new file mode 100644
index 000000000..88a139145
--- /dev/null
+++ b/src/renderer/lib/useGlassA11y.ts
@@ -0,0 +1,32 @@
+import { useSyncExternalStore } from 'react'
+import type { GlassA11y } from './glassContrast'
+
+// The two system settings Liquid Glass must yield to (HIG liquid-glass.md, accessibility):
+// Reduce Transparency and Increase Contrast. Electron and the browser both expose them as media
+// queries, so one subscription serves every surface.
+const REDUCE = '(prefers-reduced-transparency: reduce)'
+const MORE = '(prefers-contrast: more)'
+
+const query = (q: string): MediaQueryList | null =>
+ typeof window !== 'undefined' && typeof window.matchMedia === 'function' ? window.matchMedia(q) : null
+
+let snapshot: GlassA11y = read()
+function read(): GlassA11y {
+ return { reduceTransparency: !!query(REDUCE)?.matches, moreContrast: !!query(MORE)?.matches }
+}
+
+function subscribe(onChange: () => void): () => void {
+ const lists = [query(REDUCE), query(MORE)].filter((l): l is MediaQueryList => !!l)
+ const handler = (): void => {
+ snapshot = read()
+ onChange()
+ }
+ for (const l of lists) l.addEventListener('change', handler)
+ return () => {
+ for (const l of lists) l.removeEventListener('change', handler)
+ }
+}
+
+export function useGlassA11y(): GlassA11y {
+ return useSyncExternalStore(subscribe, () => snapshot)
+}
diff --git a/src/renderer/nodes/TerminalNode.tsx b/src/renderer/nodes/TerminalNode.tsx
index b7c6c900a..0e97169c8 100644
--- a/src/renderer/nodes/TerminalNode.tsx
+++ b/src/renderer/nodes/TerminalNode.tsx
@@ -180,6 +180,7 @@ import { ContextMeter } from '../components/ContextMeter'
import { isZoomModifierHeld } from '../lib/zoomModifier'
import { isHidden } from '../lib/ui-visibility'
import { glassTint, resolveGlassSlider } from '../lib/glassContrast'
+import { useGlassA11y } from '../lib/useGlassA11y'
import { isLiquidGlass } from '../lib/appTheme'
import { resolveTerminalTheme } from '../terminal/themes'
import { readsClaudeTranscript } from '../lib/transcriptGates'
@@ -1250,9 +1251,10 @@ export function TerminalNode({
// that keeps its foreground at 4.5:1 over any backdrop (lib/glassContrast.ts).
const glass = isLiquidGlass(useSettings((s) => s.settings.appTheme))
const glassSlider = resolveGlassSlider(useSettings((s) => s.settings.glassTint))
+ const glassA11y = useGlassA11y()
const glassVars = useMemo(() => {
if (!glass) return null
- const tint = glassTint(resolveTerminalTheme(visual.terminalTheme).theme, glassSlider)
+ const tint = glassTint(resolveTerminalTheme(visual.terminalTheme).theme, glassSlider, glassA11y)
return tint
? ({
'--term-glass-bg': tint.background,
@@ -1260,7 +1262,7 @@ export function TerminalNode({
'--term-glass-fg': tint.foreground
} as React.CSSProperties)
: null
- }, [glass, glassSlider, visual.terminalTheme])
+ }, [glass, glassSlider, glassA11y, visual.terminalTheme])
// The account list, for the chip and for the READERS below: a config dir the user links while
// this pane sits quiet must resolve to its new account immediately, not at the next hook event.
const claudeAccounts = useSettings((s) => s.settings.claudeAccounts)
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index bed2d42fe..2413e5321 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -13706,3 +13706,83 @@ body.focus-mode .dock:hover {
padding: 1px 6px;
border-radius: 999px;
}
+
+/* ---- Liquid Glass accessibility (HIG liquid-glass.md: Reduce Transparency, Increase Contrast,
+ Reduce Motion). The system settings outrank the Glass slider, as on iOS. App.tsx and the
+ terminal nodes read the same two media queries (lib/useGlassA11y.ts) for the tint ALPHA, which
+ lives in inline custom properties CSS cannot override; everything else is here. */
+
+/* Reduce Transparency: opaque surfaces (the alpha is 1 from JS), and no blur, refraction or
+ sheen — nothing of the wallpaper shows through. */
+@media (prefers-reduced-transparency: reduce) {
+ :root[data-nt-glass='on'] {
+ --glass-blur: none;
+ --glass-sheen: 0;
+ --glass-sheen-image: none;
+ }
+}
+
+/* Increase Contrast: the slider pins to Tinted (from JS), edges get stronger and the palette takes
+ HIG's increased-contrast values (lib/palette.ts, pinned by styles.palette.test.ts). */
+@media (prefers-contrast: more) {
+ :root[data-nt-glass='on'] {
+ --glass-edge: rgba(var(--tint-rgb), 0.5);
+ --sys-red: #ff6961;
+ --sys-orange: #ffb340;
+ --sys-yellow: #ffd426;
+ --sys-green: #30db5b;
+ --sys-mint: #66d4cf;
+ --sys-teal: #5de6ff;
+ --sys-cyan: #70d7ff;
+ --sys-blue: #409cff;
+ --sys-indigo: #7d7aff;
+ --sys-purple: #da8fff;
+ --sys-pink: #ff6482;
+ --sys-brown: #b59469;
+ --sys-gray: #aeaeb2;
+ }
+ :root[data-nt-glass='on'][data-theme='light'] {
+ --sys-red: #d70015;
+ --sys-orange: #c93400;
+ --sys-yellow: #b25000;
+ --sys-green: #248a3d;
+ --sys-mint: #0c817b;
+ --sys-teal: #008299;
+ --sys-cyan: #0071a4;
+ --sys-blue: #0040dd;
+ --sys-indigo: #3634a3;
+ --sys-purple: #8944ab;
+ --sys-pink: #d30f45;
+ --sys-brown: #7f6545;
+ --sys-gray: #6c6c70;
+ }
+ :root[data-nt-glass='on'] .term-node {
+ border-width: 1.5px;
+ }
+}
+
+/* Reduce Motion (every appearance): the state glows stop pulsing and hold lit, the same static
+ values the idle-window gate uses, and the minimap strokes stop beating. The state still reads. */
+@media (prefers-reduced-motion: reduce) {
+ .react-flow__node:has(.term-node.unread)::after {
+ animation: none;
+ opacity: 0.85;
+ will-change: auto;
+ }
+ .react-flow__node:has(.term-node.working)::after {
+ animation: none;
+ opacity: 0.7;
+ will-change: auto;
+ }
+ .react-flow__node:has(.term-node.attention)::after {
+ animation: none;
+ opacity: 0.8;
+ will-change: auto;
+ }
+ .term-node__status-dot,
+ .minimap .mm-working,
+ .minimap .mm-attention,
+ .minimap .mm-unread {
+ animation: none;
+ }
+}
diff --git a/src/renderer/styles.palette.test.ts b/src/renderer/styles.palette.test.ts
index f20a8495c..d45f3fec5 100644
--- a/src/renderer/styles.palette.test.ts
+++ b/src/renderer/styles.palette.test.ts
@@ -89,6 +89,7 @@ describe('palette tokens', () => {
// Claude-identity surfaces (subagent node, usage pill) and the onboarding decoration.
const rules = CSS.slice(CSS.indexOf('\n}\n', CSS.search(/^:root\[data-theme='light'\]/m)))
.replace(/\/\*[\s\S]*?\*\//g, '')
+ .replace(/^\s*--sys-[a-z]+:.*$/gm, '') // palette declarations (the Increase Contrast block)
const hits = rules.match(
/rgba?\(\s*(255,\s*69,\s*58|10,\s*132,\s*255|48,\s*209,\s*88|255,\s*159,\s*10|191,\s*122,\s*240|217,\s*119,\s*87)|#(ff453a|30d158|32d74b|ff9f0a|bf7af0|ffb340|f85149|8e8e93)\b/gi
)
@@ -157,8 +158,47 @@ describe('minimap status strokes match the node glows', () => {
expect(canvas).toContain(stroke)
const glow = CSS.slice(CSS.indexOf(`.react-flow__node:has(.term-node.${state})::after {`))
expect(glow.slice(0, glow.indexOf('}'))).toContain(`var(--state-${state})`)
- const mm = CSS.slice(CSS.lastIndexOf(`.minimap .mm-${state} {`))
+ const mm = CSS.slice(CSS.indexOf(`\n.minimap .mm-${state} {\n filter`))
expect(mm.slice(0, mm.indexOf('}'))).toContain(`var(--state-${state})`)
})
}
})
+
+describe('Liquid Glass accessibility fallbacks', () => {
+ /** Body of the first `@media <query> {` block (balanced braces). */
+ const media = (query: string): string => {
+ const start = CSS.indexOf(`@media ${query} {`)
+ expect(start, query).toBeGreaterThanOrEqual(0)
+ let depth = 0
+ for (let i = CSS.indexOf('{', start); i < CSS.length; i++) {
+ if (CSS[i] === '{') depth++
+ else if (CSS[i] === '}' && --depth === 0) return CSS.slice(start, i + 1)
+ }
+ return ''
+ }
+
+ it('Reduce Transparency drops blur, refraction and sheen on glass', () => {
+ const m = media('(prefers-reduced-transparency: reduce)')
+ expect(m).toContain(":root[data-nt-glass='on']")
+ expect(m).toMatch(/--glass-blur:\s*none/)
+ expect(m).toMatch(/--glass-sheen-image:\s*none/)
+ })
+
+ it('Increase Contrast strengthens edges and takes the HIG increased-contrast palette', () => {
+ const m = media('(prefers-contrast: more)')
+ expect(m).toMatch(/--glass-edge:\s*rgba\(var\(--tint-rgb\), 0\.5\)/)
+ const light = m.slice(m.indexOf("[data-theme='light']"))
+ const dark = m.slice(0, m.indexOf("[data-theme='light']"))
+ for (const [name, hex] of Object.entries(SYSTEM_COLORS.darkContrast)) expect(dark).toContain(`--sys-${name}: ${hex};`)
+ for (const [name, hex] of Object.entries(SYSTEM_COLORS.lightContrast)) expect(light).toContain(`--sys-${name}: ${hex};`)
+ })
+
+ it('Reduce Motion holds every state glow still', () => {
+ const all = CSS.split('@media (prefers-reduced-motion: reduce) {').slice(1).join('')
+ for (const state of ['unread', 'working', 'attention']) {
+ const rule = all.slice(all.indexOf(`.react-flow__node:has(.term-node.${state})::after {`))
+ expect(rule.slice(0, rule.indexOf('}')), state).toContain('animation: none')
+ }
+ expect(all).toMatch(/\.minimap \.mm-unread \{\s*animation: none/)
+ })
+})