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.

fix(glass): glass is opt-in per surface; no see-through without a blur (visual QA round 3 NC1, NC2, NH1, NH2)

iceclatterWTf3a24526c26c
diff --git a/scripts/glass-trap-probe.mjs b/scripts/glass-trap-probe.mjs
new file mode 100644
index 000000000..f8a0fee99
--- /dev/null
+++ b/scripts/glass-trap-probe.mjs
@@ -0,0 +1,165 @@
+#!/usr/bin/env node
+
+/**
+ * Liquid Glass trap probe: finds surfaces that are see-through WITHOUT a working blur.
+ *
+ * A translucent fill only reads as glass when the content behind it is blurred. It is a TRAP when:
+ * - it has no blur of its own and no blurred ancestor behind it, or
+ * - it floats (absolute/fixed/sticky) over the nearest blurred or solid ancestor's content —
+ * that content is sharp, and a blur inside a blurred ancestor samples only its pixels, or
+ * - it has its own blur but sits inside a BACKDROP ROOT (an ancestor with backdrop-filter, filter,
+ * opacity < 1, mask, clip-path or a blend mode) and reaches outside that root's box: the part
+ * outside samples nothing, so whatever is behind it reads sharp through the tint.
+ * `transform` and `isolation` are not backdrop roots (the React Flow viewport, `.dock`).
+ *
+ * Usage (a dev build with remote debugging, e.g. `--remote-debugging-port=9333`):
+ * node scripts/glass-trap-probe.mjs [--port 9333 | --ws ws://…] [--json]
+ * Open the overlay under test first; the probe checks what is on screen. Exits 1 on any trap.
+ * It only reads computed styles — it never clicks, types or changes state.
+ */
+
+// Runs in the page (serialised with toString). Keep it self-contained.
+export function glassTrapProbe() {
+ // Intentional full-window dims behind a modal, not glass.
+ const SCRIMS = ['.palette-overlay', '.drawer-overlay', '.kanban-modal-scrim', '.confirm-overlay', '.tab-backdrop', '.ctx-backdrop', '.dock-backdrop']
+ const MIN_AREA = 300
+ const alphaOf = (c) => {
+ if (!c || c === 'transparent') return 0
+ const slash = c.match(/\/\s*([\d.]+%?)\s*\)$/)
+ if (slash) return slash[1].endsWith('%') ? parseFloat(slash[1]) / 100 : parseFloat(slash[1])
+ const m = c.match(/^rgba\(([^)]+)\)$/)
+ if (m) return parseFloat(m[1].split(',')[3])
+ return 1
+ }
+ const blurs = (cs) => !!cs && /blur\(/.test(cs.backdropFilter || cs.webkitBackdropFilter || '')
+ const beforeOf = (el) => {
+ const b = getComputedStyle(el, '::before')
+ return b.content && b.content !== 'none' && b.display !== 'none' ? b : null
+ }
+ const isRoot = (el) => {
+ const cs = getComputedStyle(el)
+ return (
+ (cs.backdropFilter && cs.backdropFilter !== 'none') ||
+ cs.filter !== 'none' ||
+ parseFloat(cs.opacity) < 1 ||
+ (cs.maskImage && cs.maskImage !== 'none') ||
+ (cs.webkitMaskImage && cs.webkitMaskImage !== 'none') ||
+ cs.clipPath !== 'none' ||
+ cs.mixBlendMode !== 'normal' ||
+ /filter|opacity|mask|clip-path|mix-blend/.test(cs.willChange)
+ )
+ }
+ const hasBlur = (el) => blurs(getComputedStyle(el)) || blurs(beforeOf(el))
+ const floats = (el) => /absolute|fixed|sticky/.test(getComputedStyle(el).position)
+ const opaque = (e) => alphaOf(getComputedStyle(e).backgroundColor) >= 0.9
+ const inside = (a, b) => a.left >= b.left - 1 && a.top >= b.top - 1 && a.right <= b.right + 1 && a.bottom <= b.bottom + 1
+ const name = (el) =>
+ el.tagName.toLowerCase() + (typeof el.className === 'string' && el.className ? '.' + el.className.trim().split(/\s+/).slice(0, 3).join('.') : '')
+ const visible = (el) => {
+ for (let e = el; e; e = e.parentElement) {
+ const cs = getComputedStyle(e)
+ if (cs.display === 'none' || cs.visibility === 'hidden' || parseFloat(cs.opacity) < 0.05) return false
+ }
+ return true
+ }
+ const vw = innerWidth
+ const vh = innerHeight
+ const traps = []
+ const check = (el, pseudo) => {
+ if (SCRIMS.some((s) => el.matches(s))) return
+ const cs = pseudo ? beforeOf(el) : getComputedStyle(el)
+ if (!cs) return
+ const a = alphaOf(cs.backgroundColor)
+ if (a < 0.02 || a >= 0.9) return
+ // What shows is the box clipped by scrolling/clipping ancestors (a long settings list scrolls
+ // inside its sheet; the part past the sheet's edge is not painted).
+ const b = el.getBoundingClientRect()
+ const r = { left: b.left, top: b.top, right: b.right, bottom: b.bottom, x: b.x, y: b.y, width: b.width, height: b.height }
+ for (let e = el.parentElement; e; e = e.parentElement) {
+ if (getComputedStyle(e).overflow === 'visible') continue
+ const c = e.getBoundingClientRect()
+ r.left = Math.max(r.left, c.left)
+ r.top = Math.max(r.top, c.top)
+ r.right = Math.min(r.right, c.right)
+ r.bottom = Math.min(r.bottom, c.bottom)
+ }
+ const w = Math.min(r.right, vw) - Math.max(r.left, 0)
+ const h = Math.min(r.bottom, vh) - Math.max(r.top, 0)
+ if (w <= 0 || h <= 0 || w * h < MIN_AREA || !visible(el)) return
+ // The ::before paints inside its element: its ancestor chain starts at the element itself.
+ const chain = []
+ for (let e = pseudo ? el : el.parentElement; e && e !== document.documentElement; e = e.parentElement) chain.push(e)
+ const own = pseudo ? blurs(cs) : hasBlur(el)
+ let why = null
+ if (own) {
+ const root = chain.find(isRoot)
+ if (root && !inside(r, root.getBoundingClientRect())) why = `blur escapes backdrop root ${name(root)}`
+ } else {
+ // The nearest ancestor that paints something solid or blurred is what shows behind an
+ // in-flow piece. A piece that FLOATS above that ancestor covers its content instead.
+ const backIdx = chain.findIndex((e) => hasBlur(e) || opaque(e))
+ if (backIdx < 0) why = 'no blur behind it'
+ else {
+ const back = chain[backIdx]
+ const between = [el, ...chain.slice(0, backIdx)]
+ if (!pseudo && between.some(floats)) why = `floats over ${name(back)}'s content`
+ else if (!inside(r, back.getBoundingClientRect())) why = `outside ${name(back)}`
+ }
+ }
+ if (why)
+ traps.push({
+ el: name(el) + (pseudo ? '::before' : ''),
+ bg: cs.backgroundColor,
+ why,
+ box: [b.x, b.y, b.width, b.height].map(Math.round),
+ })
+ }
+ for (const el of document.body.querySelectorAll('*')) {
+ check(el, false)
+ check(el, true)
+ }
+ return { glass: document.documentElement.dataset.ntGlass === 'on', traps }
+}
+
+async function main() {
+ const args = process.argv.slice(2)
+ const opt = (k) => (args.includes(k) ? args[args.indexOf(k) + 1] : undefined)
+ let ws = opt('--ws')
+ if (!ws) {
+ const port = opt('--port') ?? '9333'
+ const pages = await (await fetch(`http://localhost:${port}/json`)).json()
+ ws = pages.find((p) => p.type === 'page' && !p.url.includes('hud'))?.webSocketDebuggerUrl
+ if (!ws) throw new Error(`no app page on port ${port}`)
+ }
+ const sock = new WebSocket(ws)
+ const result = await new Promise((resolve, reject) => {
+ sock.onerror = reject
+ sock.onopen = () =>
+ sock.send(
+ JSON.stringify({
+ id: 1,
+ method: 'Runtime.evaluate',
+ params: { expression: `(${glassTrapProbe.toString()})()`, returnByValue: true },
+ }),
+ )
+ sock.onmessage = (m) => {
+ const r = JSON.parse(m.data)
+ if (r.id !== 1) return
+ sock.close()
+ if (r.result?.exceptionDetails) reject(new Error(r.result.exceptionDetails.exception?.description))
+ else resolve(r.result.result.value)
+ }
+ })
+ if (args.includes('--json')) console.log(JSON.stringify(result))
+ else {
+ if (!result.glass) console.log('note: Liquid Glass is not on (data-nt-glass) — nothing glass to check')
+ console.log(`${result.traps.length} trap(s)`)
+ for (const t of result.traps) console.log(` ${t.el} ${t.bg} ${t.why} [${t.box.join(',')}]`)
+ }
+ process.exit(result.traps.length ? 1 : 0)
+}
+
+if (import.meta.url === `file://${process.argv[1]}`) main().catch((e) => {
+ console.error(e.message)
+ process.exit(2)
+})
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index cf00bcbad..c6339637c 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -13553,26 +13553,20 @@ body.focus-mode .dock:hover {
over any backdrop (dark 0.70, light 0.745 on the shipped palettes). `--muted` gets no guarantee.
Three rules hold it together:
- - Surface TOKENS are redefined to that fill, which reaches the many panels that paint
- `var(--panel)` & co. without naming each one. A surface nested in another only stacks the SAME
- tint, which moves the composite toward the panel colour — every alpha above the computed one
- also passes (the scan in glassContrast.ts is contiguous from opaque), so nesting cannot break
- the guarantee.
- - The floating containers that hard-code `rgba(var(--menu-rgb), .98)` and friends are listed
- explicitly; `!important` because the minimap's own rule already carries it.
+ - Glass is OPT-IN per surface. The shared surface tokens (`--panel`, `--panel-header`,
+ `--surface-*`) keep their solid theme colours under glass, so a panel, menu, popover or tooltip
+ that is not listed below is OPAQUE — never see-through without a blur (visual QA round 3: the
+ tokens used to BE the fill, and every unlisted floating surface became a trap). Only the
+ surfaces listed here get the translucent fill, and each one gets a working blur with it
+ (`styles.glass-traps.test.ts` fails otherwise; `scripts/glass-trap-probe.mjs` checks the live
+ page). `!important` because the minimap's own rule already carries it.
+ - A piece INSIDE a glass surface paints a lift, a sink or nothing — never a second fill.
- backdrop-filter goes on OUTERMOST containers only. A blur inside another blurred element
re-blurs its parent's already-blurred pixels (and costs a second pass), so nested pieces take
the fill alone. Node blur pauses while the camera moves (`.canvas-moving`) only when Keep blur
while moving is off (Canvas never sets the class otherwise); chrome is static and keeps its
blur. */
:root[data-nt-glass='on'] {
- --panel: var(--glass-chrome-bg);
- --panel-header: var(--glass-chrome-bg);
- --panel-2: var(--glass-chrome-bg);
- --surface-deep: var(--glass-chrome-bg);
- --surface-raised: var(--glass-chrome-bg);
- --surface-overlay: var(--glass-chrome-bg);
- --tabbar-bg: var(--glass-control-bg);
--glass-edge: rgba(var(--tint-rgb), 0.2);
/* Highlights on glass (Phase 4): a row lift is the theme's own ink at low alpha, never another
layer of the fill — re-stacking `--panel-header` on its own panel read as a darker, or
@@ -13647,6 +13641,8 @@ body.focus-mode .dock:hover {
.usage-popover,
.sessmem-panel,
.sessions-sidebar,
+ .drawer,
+ .tooltip,
.phone-pair,
.dictation,
.nt-settings,
@@ -13738,13 +13734,16 @@ body.focus-mode .dock:hover {
backdrop-filter is a BACKDROP ROOT: a blur on anything inside it samples only the root's own
pixels, so a menu that opens outside its parent (or over sharp content inside it) blurs nothing
and the text behind it reads straight through. Two fixes, one per case:
- - The dock and its menus HOST menus that pop out of them, so their glass lives on a ::before
- layer (fill, hairline and blur). The container itself has no backdrop-filter, is no backdrop
- root, and each menu — the submenu included — blurs the canvas like any top-level surface. The
- dock keeps the control fill (it follows the slider); its menus are text surfaces.
- - A popover INSIDE a glass node (the context meter's, the colour swatches) cannot blur: the node
- is its backdrop root and the terminal text under it is sharp. It is solid — the menu colour at
- full alpha — instead. The node's own surface is unchanged. */
+ - The dock, its menus and the context menus HOST menus that pop out of them, so their glass
+ lives on a ::before layer (fill, hairline and blur). The container itself has no
+ backdrop-filter, is no backdrop root, and each flyout blurs the canvas like any top-level
+ surface (visual QA round 3, NC2: the Snap to zone flyout escaped `.ctx-menu`'s blur). A menu
+ that SCROLLS cannot host a flyout (overflow clips it) and a ::before would scroll away with its
+ rows, so scrolling menus and leaf flyouts keep their glass on the element. The dock keeps the
+ control fill (it follows the slider); menus are text surfaces.
+ - A popover INSIDE a glass node or the card modal (context meter, colour swatches, label and
+ member pickers) cannot blur: its host is its backdrop root and the text under it is sharp. It
+ is not listed, so it paints its opaque token colour. */
:root[data-nt-glass='on'] :is(.dock, .dock-menu, .dock-menu__sub) {
background: transparent !important;
border-color: transparent;
@@ -13769,8 +13768,30 @@ body.focus-mode .dock:hover {
-webkit-backdrop-filter: var(--glass-control-blur);
backdrop-filter: var(--glass-control-blur);
}
-:root[data-nt-glass='on'] :is(.ctx-popover, .color-popover) {
- background: rgb(var(--menu-rgb)) !important;
+:root[data-nt-glass='on'] .ctx-menu:not(.ctx-menu--scroll, .ctx-submenu:not(.ctx-submenu--host)) {
+ background: transparent !important;
+ border-color: transparent;
+ -webkit-backdrop-filter: none;
+ backdrop-filter: none;
+ isolation: isolate;
+}
+:root[data-nt-glass='on'] .ctx-menu:not(.ctx-menu--scroll, .ctx-submenu:not(.ctx-submenu--host))::before {
+ content: '';
+ position: absolute;
+ inset: -1px;
+ z-index: -1;
+ border: 1px solid var(--glass-edge);
+ border-radius: inherit;
+ pointer-events: none;
+ background: var(--glass-chrome-bg);
+ -webkit-backdrop-filter: var(--glass-text-blur);
+ backdrop-filter: var(--glass-text-blur);
+}
+/* Top tooltips belong to the dock (the only `placement="top"` user). They pin 6px above the BUTTON,
+ which on glass put the bubble on the dock's visible rim (visual QA round 3, NH2): they clear the
+ rim by 7px instead. */
+:root[data-nt-glass='on'] .tooltip--top {
+ margin-top: -10px;
}
/* The sessions sidebar opens over its own toggle (same corner); through translucent glass the
toggle's glyph ghosted above "Sessions" (visual QA M5). The sidebar's × closes it. */
@@ -13793,13 +13814,44 @@ body.focus-mode .dock:hover {
/* Input wells: the default `bg-bg` well is the opaque page colour, which read as a hole punched in
the frosted page (visual QA M4). On glass it is a sink (dark) or a lift (light) of the page with a
hairline — each moves AWAY from the ink, so the field's text keeps at least the page's contrast. */
-:root[data-nt-glass='on'] :is(:is(input, select, textarea).bg-bg, .bind-select) {
+:root[data-nt-glass='on'] :is(:is(input, select, textarea).bg-bg, .bind-select, .bind-field input, .sessions-sidebar__search input, .ss-title-input, .dictation__textarea) {
background: rgba(0, 0, 0, 0.22);
border-color: var(--glass-edge);
}
-:root[data-nt-glass='on'][data-theme='light'] :is(:is(input, select, textarea).bg-bg, .bind-select) {
+:root[data-nt-glass='on'][data-theme='light'] :is(:is(input, select, textarea).bg-bg, .bind-select, .bind-field input, .sessions-sidebar__search input, .ss-title-input, .dictation__textarea) {
background: rgba(255, 255, 255, 0.55);
}
+/* Pieces INSIDE a glass surface that painted a panel token (opaque under glass — see the top of
+ this block). Bars and chips in the flow are a lift of the surface; the Settings sidebar is the
+ sheet's own glass. Small buttons keep their solid colour: a control, not a surface. */
+:root[data-nt-glass='on'] :is(.term-node__find, .term-md__bar, .ss-chip) {
+ background: var(--glass-lift-hover);
+ color: var(--text-strong);
+}
+:root[data-nt-glass='on'] .nt-settings aside.bg-panel {
+ background: transparent;
+}
+/* Hover rows inside glass surfaces painted `--panel-header`, a solid band on glass: a lift instead. */
+:root[data-nt-glass='on']
+ :is(
+ .ex-row:hover,
+ .scm-more:hover,
+ .scm-iconbtn:hover,
+ .resume-card__row:hover,
+ .resume-card__close:hover,
+ .sessions-sidebar__head-actions button:hover,
+ .sessions-sidebar__search-clear:hover,
+ .sessions-sidebar__history-head:hover,
+ .sessions-sidebar__history-item:hover,
+ .sessions-sidebar__history-transcript:hover,
+ .ss-group__head:hover,
+ .ss-subgroup__head:hover,
+ .dictation__close:hover,
+ .bind-existing__row:hover:not(:disabled)
+ ) {
+ background: var(--glass-lift);
+ color: var(--text-strong);
+}
/* Scroll edge effect (HIG liquid-glass: content fades where it meets the edge): the palette's
last row was cut hard at the bottom (visual QA L3). The extra padding lets the last row clear the
@@ -13872,13 +13924,11 @@ body.focus-mode .dock:hover {
}
/* Every node kind. Terminal nodes keep their own theme-derived tint (.term-node--glass, above);
- the others take the chrome fill through the tokens (or here, for the rgb-token ones). Bodies
+ the others take the chrome fill here. Bodies
that are another renderer's surface — Monaco, a <webview>, a <video> — stay opaque: they paint
their own background. Sticky notes keep their colour: the colour IS the note. */
-:root[data-nt-glass='on'] :is(.files-node, .trigger-node, .dino-node) {
+:root[data-nt-glass='on'] :is(.files-node, .loop-node, .subagent-node, .trigger-node, .dino-node) {
background: var(--glass-chrome-bg);
-}
-:root[data-nt-glass='on'] :is(.term-node, .files-node, .loop-node, .subagent-node, .trigger-node, .dino-node) {
-webkit-backdrop-filter: var(--glass-blur);
backdrop-filter: var(--glass-blur);
}
@@ -13966,7 +14016,7 @@ body.focus-mode .dock:hover {
:root[data-nt-glass='on'] .kanban-card:hover {
background: var(--glass-lift);
}
-:root[data-nt-glass='on'] .kanban-col--drop {
+:root[data-nt-glass='on'] .kanban-col.kanban-col--drop {
border-color: var(--text);
background:
linear-gradient(var(--glass-lift-hover), var(--glass-lift-hover)),
@@ -14004,7 +14054,7 @@ body.focus-mode .dock:hover {
selected node brighter. Status strokes (working/attention/unread, the `mm-*` classes) keep their
colours: they are state, not decoration. The mask dims outside the viewport with the same
chrome fill the map sits on. */
-:root[data-nt-glass='on'] {
+:root[data-nt-glass='on'] .react-flow__minimap.minimap {
--minimap-mask: var(--glass-control-bg);
}
:root[data-nt-glass='on'] .minimap .react-flow__minimap-node {
diff --git a/src/renderer/styles.glass-traps.test.ts b/src/renderer/styles.glass-traps.test.ts
new file mode 100644
index 000000000..210f8b298
--- /dev/null
+++ b/src/renderer/styles.glass-traps.test.ts
@@ -0,0 +1,143 @@
+import { readFileSync } from 'node:fs'
+import { join } from 'node:path'
+import { describe, expect, it } from 'vitest'
+
+/**
+ * Liquid Glass is OPT-IN per surface: a translucent glass fill is only ever handed to a surface
+ * that also gets a working blur. Visual QA rounds 2 and 3 found eleven surfaces that were
+ * see-through with no blur — terminal text read sharp through menus, drawers, pickers and
+ * tooltips — because the shared panel tokens themselves resolved to the fill, which reached every
+ * floating surface nobody had listed.
+ *
+ * The rule checked here: every rule that paints a translucent glass fill (as a background or by
+ * assigning it to a custom property that surfaces paint) must, for each of its selectors, either
+ * carry a backdrop-filter itself or target an element that a blur rule also targets (the same
+ * classes, or its paired `::before` glass layer). A token assignment on `:root` targets no
+ * surface in particular, so it always fails. The live half of the check — backdrop roots, which
+ * CSS alone cannot see — is `scripts/glass-trap-probe.mjs` (see CLAUDE.md, Liquid Glass chrome).
+ */
+const FILL = /var\(--(glass-chrome-bg|glass-control-bg|term-glass-bg|term-glass-header-bg)\)/
+const PAINT = /(?:^|;)\s*(background(?:-color)?|--[\w-]+)\s*:([^;]*)/g
+const BLUR = /(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:\s*(?!none)[^;]*blur/
+
+/** In-flow pieces that only stack on their own blurred surface, never over other content. */
+const IN_FLOW: Record<string, string> = {
+ '.kanban-modal__termwrap--glass': 'the card-modal terminal fills the blurred .kanban-modal',
+ '.term-node--glass .term-node__header': 'the header row of its own blurred glass node',
+}
+
+interface Rule {
+ selectors: string[]
+ body: string
+}
+
+function parse(css: string): Rule[] {
+ const out: Rule[] = []
+ const re = /([^{}]+)\{([^{}]*)\}/g
+ const src = css.replace(/\r\n/g, '\n').replace(/\/\*[\s\S]*?\*\//g, '')
+ let m: RegExpExecArray | null
+ while ((m = re.exec(src))) out.push({ selectors: splitTop(m[1].replace(/\s+/g, ' ').trim()), body: m[2] })
+ return out
+}
+
+/** Split on commas outside parentheses. */
+function splitTop(list: string): string[] {
+ const parts: string[] = []
+ let depth = 0
+ let cur = ''
+ for (const ch of list) {
+ if (ch === '(') depth++
+ if (ch === ')') depth--
+ if (ch === ',' && depth === 0) {
+ parts.push(cur.trim())
+ cur = ''
+ } else cur += ch
+ }
+ if (cur.trim()) parts.push(cur.trim())
+ return parts
+}
+
+/** The subject compound of a selector, one per `:is(…)` alternative, each as its class set plus
+ * its pseudo-element. `:not(…)`, `:hover` & co. do not change which element is painted. */
+function subjects(selector: string): { classes: Set<string>; pseudo: string }[] {
+ // The last compound: split on descendant/child combinators outside parentheses.
+ let depth = 0
+ let start = 0
+ for (let i = 0; i < selector.length; i++) {
+ const ch = selector[i]
+ if (ch === '(') depth++
+ else if (ch === ')') depth--
+ else if (depth === 0 && (ch === ' ' || ch === '>' || ch === '+' || ch === '~')) start = i + 1
+ }
+ const compound = selector.slice(start)
+ const pseudo = /::([\w-]+)/.exec(compound)?.[1] ?? ''
+ // A leading `:is(a, b)` lists alternatives; whatever follows it (`:hover`, `::before`) applies to each.
+ let alts = [classesOf(compound)]
+ if (compound.startsWith(':is(')) {
+ let d = 0
+ let end = 3
+ while (end < compound.length && !(compound[end] === ')' && --d === 0)) if (compound[end++] === '(') d++
+ const rest = classesOf(compound.slice(end + 1))
+ alts = splitTop(compound.slice(4, end)).map((a) => new Set([...subjects(a)[0].classes, ...rest]))
+ }
+ return alts.map((classes) => ({ classes, pseudo }))
+}
+
+function classesOf(compound: string): Set<string> {
+ const bare = compound.replace(/:(not|is|where|has)\((?:[^()]|\([^()]*\))*\)/g, '')
+ return new Set([...bare.matchAll(/\.([\w-]+)/g)].map((c) => c[1]))
+}
+
+/** Every selector that paints a glass fill without a blur of its own or a paired blur rule. */
+function glassFillsWithoutBlur(css: string): string[] {
+ const rules = parse(css)
+ const blurred = rules
+ .filter((r) => BLUR.test(r.body))
+ .flatMap((r) => r.selectors.flatMap(subjects))
+ .filter((s) => s.classes.size > 0)
+ const covered = (s: { classes: Set<string>; pseudo: string }): boolean =>
+ blurred.some(
+ (b) => (b.pseudo === s.pseudo || b.pseudo === 'before') && [...b.classes].every((c) => s.classes.has(c))
+ )
+ const bad: string[] = []
+ for (const r of rules) {
+ const paints = [...r.body.matchAll(PAINT)].some((d) => FILL.test(d[2]))
+ if (!paints || BLUR.test(r.body)) continue
+ for (const sel of r.selectors) {
+ if (Object.keys(IN_FLOW).some((k) => sel.endsWith(k))) continue
+ if (!subjects(sel).every(covered)) bad.push(sel)
+ }
+ }
+ return bad
+}
+
+describe('Liquid Glass: no translucent fill without a blur', () => {
+ const CSS = readFileSync(join(__dirname, 'styles.css'), 'utf8')
+
+ it('every glass fill in styles.css is paired with a working blur', () => {
+ expect(glassFillsWithoutBlur(CSS)).toEqual([])
+ })
+
+ it('catches the pre-opt-in shape: panel tokens redefined to the fill on :root', () => {
+ const tokens = `:root[data-nt-glass='on'] { --panel: var(--glass-chrome-bg); --surface-raised: var(--glass-chrome-bg); }`
+ expect(glassFillsWithoutBlur(tokens)).toEqual([":root[data-nt-glass='on']"])
+ })
+
+ it('catches an unlisted surface given the fill, and accepts a listed or ::before-layered one', () => {
+ const css = `
+ :root[data-nt-glass='on'] :is(.menu, .drawer) { background: var(--glass-chrome-bg); backdrop-filter: var(--glass-text-blur); }
+ :root[data-nt-glass='on'] .drawer:hover { background: linear-gradient(red, red), var(--glass-chrome-bg); }
+ :root[data-nt-glass='on'] .host::before { background: var(--glass-chrome-bg); backdrop-filter: blur(20px); }
+ :root[data-nt-glass='on'] .picker { background: var(--glass-chrome-bg); }
+ :root[data-nt-glass='on'] .host { --x: var(--glass-control-bg); }
+ :root[data-nt-glass='on'] .tip { background: var(--glass-chrome-bg); backdrop-filter: none; }`
+ expect(glassFillsWithoutBlur(css)).toEqual([":root[data-nt-glass='on'] .picker", ":root[data-nt-glass='on'] .tip"])
+ })
+
+ it('the shared surface tokens are never redefined under the glass gate', () => {
+ const redefined = parse(CSS)
+ .filter((r) => r.selectors.some((s) => s.startsWith(":root[data-nt-glass='on']")))
+ .flatMap((r) => [...r.body.matchAll(/(?:^|;)\s*(--(?:panel|panel-header|panel-2|surface-[\w-]+|tabbar-bg))\s*:/g)].map((d) => d[1]))
+ expect(redefined).toEqual([])
+ })
+})
diff --git a/src/renderer/styles.liquid-glass.test.ts b/src/renderer/styles.liquid-glass.test.ts
index c653565cd..48989d03c 100644
--- a/src/renderer/styles.liquid-glass.test.ts
+++ b/src/renderer/styles.liquid-glass.test.ts
@@ -60,7 +60,7 @@ describe('Liquid Glass stylesheet', () => {
it('slider scope: text surfaces take the readable-floored fill, small controls the slider fill', () => {
const outer = (needle: string): Rule | undefined =>
gated(needle).find((r) => /backdrop-filter:/.test(r.body) && r.selector.includes(':is('))
- for (const text of ['.nt-settings', '.palette', '.ctx-menu', '.tab-menu', '.sessions-sidebar', '.confirm', '.usage-popover', '.kanban-col', '.kanban-add-col', '.kanban-modal']) {
+ for (const text of ['.nt-settings', '.palette', '.ctx-menu', '.tab-menu', '.sessions-sidebar', '.drawer', '.tooltip', '.confirm', '.usage-popover', '.kanban-col', '.kanban-add-col', '.kanban-modal']) {
expect(outer(text)?.body, text).toMatch(/var\(--glass-chrome-bg\)[\s\S]*var\(--glass-text-blur\)/)
}
for (const control of ['.tabbar', '.react-flow__controls', '.react-flow__minimap', '.usage-pill', '.sysres-pill', '.usage-refresh', '.controls-cluster > button', '.sessions-icon-cluster button']) {
@@ -92,11 +92,14 @@ describe('Liquid Glass stylesheet', () => {
expect(layer?.body).toMatch(/background:\s*var\(--glass-chrome-bg\)[\s\S]*backdrop-filter:\s*var\(--glass-text-blur\)/)
const dock = rules.find((r) => r.selector === `${GATE} .dock::before`)
expect(dock?.body).toMatch(/var\(--glass-control-bg\)[\s\S]*var\(--glass-control-blur\)/)
- // Popovers inside a glass node (their backdrop root) cannot blur, so they are solid.
- const solid = rules.find((r) => r.selector === `${GATE} :is(.ctx-popover, .color-popover)`)
- expect(solid?.body).toMatch(/background:\s*rgb\(var\(--menu-rgb\)\)\s*!important/)
- // …and nothing else hands any of them a translucent glass fill on the element itself.
- for (const nested of ['.dock-menu', '.dock-menu__sub', '.ctx-popover', '.color-popover']) {
+ // Context menus host flyouts (Snap to zone) the same way, except menus that scroll (visual QA
+ // round 3, NC2).
+ const ctxHost = `${GATE} .ctx-menu:not(.ctx-menu--scroll, .ctx-submenu:not(.ctx-submenu--host))`
+ expect(rules.find((r) => r.selector === ctxHost)?.body).toMatch(/background:\s*transparent\s*!important[\s\S]*(^|[^-])backdrop-filter:\s*none/)
+ expect(rules.find((r) => r.selector === `${ctxHost}::before`)?.body).toMatch(/var\(--glass-chrome-bg\)[\s\S]*var\(--glass-text-blur\)/)
+ // Popovers inside a glass node or the card modal (their backdrop root) cannot blur: glass is
+ // opt-in, so nothing hands them a translucent glass fill and they keep their opaque colour.
+ for (const nested of ['.dock-menu', '.dock-menu__sub', '.ctx-popover', '.color-popover', '.label-picker', '.kanban-meta__picker']) {
const fills = gated(nested).filter(
(r) => !r.selector.includes('::before') && /background:[^;]*var\(--glass-(chrome|control)-bg\)/.test(r.body)
)
diff --git a/src/renderer/styles.palette.test.ts b/src/renderer/styles.palette.test.ts
index 94a7390bc..63012a855 100644
--- a/src/renderer/styles.palette.test.ts
+++ b/src/renderer/styles.palette.test.ts
@@ -307,10 +307,10 @@ describe('needs-you and priorities under glass', () => {
})
describe('no nested blur for the context popover', () => {
- it('.ctx-popover (inside a blurred node) is solid, never blurred or translucent (visual QA N1)', () => {
- const blurList = CSS.slice(CSS.indexOf('/* Outermost chrome: fill + blur. */'))
- expect(blurList.slice(0, blurList.indexOf('{'))).not.toContain('.ctx-popover')
- const solid = CSS.slice(CSS.indexOf(":root[data-nt-glass='on'] :is(.ctx-popover, .color-popover) {"))
- expect(solid.slice(0, solid.indexOf('}'))).toMatch(/background:\s*rgb\(var\(--menu-rgb\)\)/)
+ it('.ctx-popover (inside a blurred node) is never blurred or given the glass fill (visual QA N1)', () => {
+ // Glass is opt-in (styles.glass-traps.test.ts): an unlisted popover keeps its opaque colour.
+ const glassRules = CSS.split('}').filter((r) => r.includes(":root[data-nt-glass='on']") && /(ctx|color)-popover/.test(r.slice(0, r.indexOf('{'))))
+ expect(glassRules.filter((r) => /backdrop-filter|--glass-(chrome|control)-bg/.test(r))).toEqual([])
+ expect(CSS).toMatch(/\.ctx-popover \{[^}]*background: rgba\(var\(--popover-rgb\), 0\.98\)/)
})
})