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.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
fix(glass): code review 5 and visual QA round 3 medium/low findings
iceclatterWT7c03a917066e
diff --git a/src/renderer/components/TabBar.tsx b/src/renderer/components/TabBar.tsxindex f6c56653b..5d5358707 100644--- a/src/renderer/components/TabBar.tsx+++ b/src/renderer/components/TabBar.tsx@@ -163,8 +163,13 @@ export function TabBar({const openMenu = (id: string, anchor: HTMLElement) => {const r = anchor.getBoundingClientRect()+ // Under Liquid Glass the bar is a visible glass slab and the caret sits inside it, so the menu+ // hangs from the BAR's bottom edge rather than 3px inside it (visual QA N11). Still a plain+ // position, so useMenuFlip keeps flipping/clamping a tall menu.+ const glass = document.documentElement.dataset.ntGlass === 'on'+ const bottom = glass ? Math.max(r.bottom, anchor.closest('.tabbar')?.getBoundingClientRect().bottom ?? 0) : r.bottomsetMenuId(id)- setMenuPos({ top: r.bottom + 4, left: r.left, flipBase: r.top - 4 })+ setMenuPos({ top: bottom + 4, left: r.left, flipBase: r.top - 4 })}// Viewport-edge flip for the caret menu, same behavior as the right-click ContextMenu. The@@ -472,7 +477,7 @@ export function TabBar({createPortal(<divref={menuFlip.ref}- className="tab-menu tab-menu--tabbar"+ className="tab-menu"style={{ top: menuFlip.top, left: menuFlip.left }}onClick={(e) => e.stopPropagation()}>diff --git a/src/renderer/lib/glassContrast.test.ts b/src/renderer/lib/glassContrast.test.tsindex 37a56071f..a750709e3 100644--- a/src/renderer/lib/glassContrast.test.ts+++ b/src/renderer/lib/glassContrast.test.ts@@ -2,6 +2,7 @@ import { readFileSync } from 'node:fs'import { join } from 'node:path'import { describe, expect, it } from 'vitest'import { TERMINAL_THEMES } from '../terminal/themes'+import { SYSTEM_NODE_COLOR_SWATCHES } from '@shared/node-colors'import {GLASS_ALPHA_MAX,GLASS_ALPHA_MIN,@@ -181,19 +182,24 @@ describe('highlights, placeholders and small controls on the chrome fill (visualexpect(token(glass, '--glass-select')).toBe(`color-mix(in srgb, var(--accent) ${GLASS_SELECT_MIX * 100}%, transparent)`)})- it.each(themes)('%s: the active tab / hovered / selected rows keep 4.5:1 at the readable alpha', (_n, t) => {- const hs = glassChromeHighlights(resolve(t, '--text-strong'), tint(t), ACCENT)- expect(hs).toHaveLength(2)- const a = glassChromeAlpha(resolve(t, '--text'), resolve(t, '--panel'), 4.5, hs)!- const plain = glassChromeAlpha(resolve(t, '--text'), resolve(t, '--panel'))!- expect(a).toBeGreaterThanOrEqual(plain)- expect(a).toBeLessThan(0.8) // still glass, not a slab+ // Every accent the user can pick, not only the default blue: a bright accent's selection wash+ // needs a denser fill (dark: Yellow 0.825, Teal 0.76). Accepted up to 0.85 — still glass, not a+ // slab (code review 5 #8).+ it.each(themes)('%s: the active tab / hovered / selected rows keep 4.5:1 at the readable alpha, every accent', (_n, t) => {const panel = parseCssColor(resolve(t, '--panel'))!.rgb- for (const h of hs) {- const ink = parseCssColor(h.ink)!- const wash = parseCssColor(h.wash)!- for (let v = 0; v <= 255; v += 3) {- expect(chromeHighlightContrast(ink, wash, panel, a, [v, v, v])).toBeGreaterThanOrEqual(4.5)+ const plain = glassChromeAlpha(resolve(t, '--text'), resolve(t, '--panel'))!+ for (const { value: accent, label } of SYSTEM_NODE_COLOR_SWATCHES) {+ const hs = glassChromeHighlights(resolve(t, '--text-strong'), tint(t), accent)+ expect(hs).toHaveLength(2)+ const a = glassChromeAlpha(resolve(t, '--text'), resolve(t, '--panel'), 4.5, hs)!+ expect(a, label).toBeGreaterThanOrEqual(plain)+ expect(a, label).toBeLessThanOrEqual(0.85)+ for (const h of hs) {+ const ink = parseCssColor(h.ink)!+ const wash = parseCssColor(h.wash)!+ for (let v = 0; v <= 255; v += 3) {+ expect(chromeHighlightContrast(ink, wash, panel, a, [v, v, v]), label).toBeGreaterThanOrEqual(4.5)+ }}}})@@ -203,6 +209,9 @@ describe('highlights, placeholders and small controls on the chrome fill (visualconst ph = parseCssColor((token(g, '--glass-placeholder') ?? token(glass, '--glass-placeholder')!).replace('var(--tint-rgb)', tint(t)))!const panel = parseCssColor(resolve(t, '--panel'))!.rgbfor (let v = 0; v <= 255; v += 3) expect(chromeContrast(ph, panel, a, [v, v, v])).toBeGreaterThanOrEqual(4.5)+ // …and never reads stronger than body text (visual QA round 3, NM1): at most --text's alpha.+ // Light has no room below it at 4.5:1, so typed text takes --text-strong there (styles.css).+ expect(ph.alpha).toBeLessThanOrEqual(parseCssColor(resolve(t, '--text'))!.alpha)})it.each(themes)('%s: small controls keep 3:1 icons at Clear, never below the 0.35 floor', (_n, t, g) => {diff --git a/src/renderer/state/wallpaper.test.tsx b/src/renderer/state/wallpaper.test.tsxindex 17688e001..c39497f14 100644--- a/src/renderer/state/wallpaper.test.tsx+++ b/src/renderer/state/wallpaper.test.tsx@@ -4,7 +4,7 @@ import { createRoot, type Root } from 'react-dom/client'import { act } from 'react'import { DEFAULT_SETTINGS } from '@shared/types'import { useSettings } from './settings'-import { useBoardWallpaperStyle } from './wallpaper'+import { useBoardWallpaperStyle, useWallpaperBackgroundFor } from './wallpaper'// A board opens long after the canvas loaded the wallpaper; its first frame must already carry the// picture, or the board flashes its plain background (black) for a frame on every open.@@ -12,14 +12,19 @@ function Probe({ seen }: { seen: (string | undefined)[] }) {seen.push(useBoardWallpaperStyle()?.backgroundImage as string | undefined)return null}+function Tile({ path }: { path: string }) {+ useWallpaperBackgroundFor({ kind: 'image', path })+ return null+}describe('useBoardWallpaperStyle', () => {const roots: Root[] = []- const mount = (seen: (string | undefined)[]): void => {+ const mountEl = (el: JSX.Element): void => {const root = createRoot(document.createElement('div'))roots.push(root)- act(() => root.render(<Probe seen={seen} />))+ act(() => root.render(el))}+ const mount = (seen: (string | undefined)[]): void => mountEl(<Probe seen={seen} />)afterEach(() => {act(() => roots.splice(0).forEach((r) => r.unmount()))vi.unstubAllGlobals()@@ -41,4 +46,20 @@ describe('useBoardWallpaperStyle', () => {expect(board[0]).toBe('url("data:image/jpeg;base64,AAAA")')expect(load).toHaveBeenCalledTimes(1)})++ it("a second consumer (Settings' 'Your image' tile) does not evict the canvas still", async () => {+ const load = vi.fn(async (w: { path: string }) => `data:image/png;base64,${w.path}`)+ vi.stubGlobal('nodeTerminal', { wallpaper: { load } })+ useSettings.setState({+ settings: { ...DEFAULT_SETTINGS, appTheme: 'liquid-glass', desktopWallpaper: { kind: 'image', path: 'c.jpg' } }+ })+ mount([])+ await act(async () => {})+ mountEl(<Tile path="d.jpg" />) // Settings mounts every section, the tile included+ await act(async () => {})+ const board: (string | undefined)[] = []+ mount(board)+ expect(board[0]).toBe('url("data:image/png;base64,c.jpg")')+ expect(load).toHaveBeenCalledTimes(2)+ })})diff --git a/src/renderer/state/wallpaper.ts b/src/renderer/state/wallpaper.tsindex 90282b004..939b78224 100644--- a/src/renderer/state/wallpaper.ts+++ b/src/renderer/state/wallpaper.ts@@ -31,10 +31,15 @@ function load(w: DesktopWallpaper): Promise<string | null> {const key = cacheKey(w)let p = loaded.get(key)if (!p) {- // ponytail: keep only the latest image; a picker session that flips through ten stills would- // otherwise pin ten data: URLs in memory for the app run.- loaded.clear()- resolved.clear()+ // ponytail: keep the two most recent images (Map order = insertion order): the canvas's own+ // wallpaper and the Settings "Your image" tile are both live consumers, and a cache of one let+ // opening Settings evict the canvas still (the board's next first frame went black and re-read+ // 3 MB, code review 5 #3). A picker session that flips through ten stills still pins at most two.+ if (loaded.size >= 2) {+ const oldest = loaded.keys().next().value as string+ loaded.delete(oldest)+ resolved.delete(oldest)+ }p = window.nodeTerminal.wallpaper.load(w).then((url) => (url ? `url("${url}")` : null))diff --git a/src/renderer/styles.css b/src/renderer/styles.cssindex c6339637c..ab63df984 100644--- a/src/renderer/styles.css+++ b/src/renderer/styles.css@@ -7195,6 +7195,25 @@ button.group-node__setup:disabled {:root[data-nt-glass='on'] .usage-pill__summary > * {flex: 0 0 auto;}+/* …except the FIRST text segment: it always keeps line 1 (capped to what is left beside the 42px+ minibar and its 6px gap, and the error mark) and elides there, so a too-narrow window never+ leaves the bar alone. The error mark leads, so it is never the segment that wraps away (code+ review 5 #7). */+:root[data-nt-glass='on'] .usage-pill__summary > :is(.usage-pill__minibar + span, :first-child:not(.usage-pill__minibar)) {+ flex: 0 1 auto;+ min-width: 0;+ max-width: calc(100% - 48px);+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+}+:root[data-nt-glass='on'] .usage-pill__summary:has(> .usage-pill__dim) > .usage-pill__minibar + span {+ max-width: calc(100% - 68px);+}+:root[data-nt-glass='on'] .usage-pill__summary > .usage-pill__dim {+ order: -1;+ margin: 0 6px 0 0;+}/* While the popover is open, rise above the sessions sidebar (z-index 12) — a tall sidebarreaches the bottom-left corner and would cover the panel. Closed pill keeps its low layer soit never draws over the sidebar itself.@@ -13675,7 +13694,7 @@ body.focus-mode .dock:hover {:root[data-nt-glass='on'][data-theme='light'] {--glass-control-dim: 1.3;--muted: rgba(var(--tint-rgb), 0.8);- --glass-placeholder: rgba(var(--tint-rgb), 0.86);+ --glass-placeholder: rgba(var(--tint-rgb), 0.85);}/* The pills' own hovers are opaque literals (`rgba(44,44,46,.95)` is a dark-theme colour): onglass a hover is a neutral lift over the same fill. */@@ -13793,6 +13812,46 @@ body.focus-mode .dock:hover {:root[data-nt-glass='on'] .tooltip--top {margin-top: -10px;}+/* The three dock menus sat 9, 2 and −5px from the dock, the Zoom menu's rim ON the dock's (visual+ QA round 3, NL1): each clears the dock's top edge by 8px. Add hangs from the dock itself; Layouts+ and Zoom from their wraps, which start 8px and 15px below the dock's top (7px padding + 1px+ border; the 24px zoom pill is centred in the 38px row). */+:root[data-nt-glass='on'] .dock > .dock-menu {+ bottom: calc(100% + 8px);+}+:root[data-nt-glass='on'] .dock-layouts-wrap > .dock-menu {+ bottom: calc(100% + 16px);+}+:root[data-nt-glass='on'] .dock-zoom-wrap > .dock-menu {+ bottom: calc(100% + 23px);+}+/* The RAM panel reached over the dock's + corner (NL2): it rises above the dock (54px tall, same+ baseline as the pill row) by 8px, and a long session name elides instead of pushing the row's+ actions onto a second line. */+:root[data-nt-glass='on'] .sessmem-panel {+ bottom: calc(54px + 8px);+}+:root[data-nt-glass='on'] .sessmem-row__main {+ flex-basis: 0;+}+/* The terminal theme list hangs its checkmark gutter to the LEFT of the trigger, so the swatch and+ name columns line up with the trigger's, as a macOS pop-up button does (NL3: 36px apart). The+ ⌄ glyph sits low in its box; it is centred on the name. */+:root[data-nt-glass='on'] .theme-select__menu {+ margin-left: -36px;+}+:root[data-nt-glass='on'] .theme-select__trigger .bind-select__chev {+ transform: translateY(-3px);+}+/* The Speech language list's current row stacked `--panel` on the menu (NL5): it is THE choice. */+:root[data-nt-glass='on'] .speech-lang__row.is-active {+ background: var(--glass-select);+ color: var(--text-strong);+}+/* A menu none of whose rows has an icon keeps no empty icon column (the Help menu, NL8). */+:root[data-nt-glass='on'] .ctx-menu:not(:has(.ctx-icon:not(:empty))) .ctx-icon {+ display: none;+}/* The sessions sidebar opens over its own toggle (same corner); through translucent glass thetoggle's glyph ghosted above "Sessions" (visual QA M5). The sidebar's × closes it. */:root[data-nt-glass='on'] .canvas-root:has(.sessions-sidebar) .sessions-icon-cluster {@@ -13806,9 +13865,10 @@ body.focus-mode .dock:hover {background: var(--glass-lift);color: var(--text-strong);}-/* Its two icons read at 3:1 on the lift (visual QA round 2, N2: 2.0:1 at the default 0.45). */+/* Its two icons read at 3:1 on the lift (visual QA round 2, N2: 2.0:1 at the default 0.45; 0.8 still+ measured 2.90:1 over Sunrise at Clear, round 3 NL7). */:root[data-nt-glass='on'] .tab.active :is(.tab__board-toggle, .tab__caret) {- opacity: 0.8;+ opacity: 0.9;}/* Input wells: the default `bg-bg` well is the opaque page colour, which read as a hole punched in@@ -13866,14 +13926,23 @@ body.focus-mode .dock:hover {/* Every highlighted state carries `--text-strong` ink: App.tsx solves the fill's readable alpha forthese washes WITH that ink (`glassChromeHighlights`), so a highlighted row keeps 4.5:1 exactlylike a plain one (visual QA round 2, N2: the active tab measured 3.9:1). */-:root[data-nt-glass='on'] :is(.ctx-item, .tab-menu button, .dock-menu button, .dock-menu__sub button):hover:not(:disabled),+:root[data-nt-glass='on'] :is(.ctx-item, .tab-menu button, .dock-menu button:not(.dock-menu__row-main), .dock-menu__sub button):hover:not(:disabled),:root[data-nt-glass='on'] :is(.dock-menu__row:hover, .dock-menu__row:focus-within, .settings-nav-row:hover) {background: var(--glass-lift);color: var(--text-strong);}-/* Hovers that painted `--panel-header` (= the fill again, a dark slab on glass — N5). */+/* A Layouts row is ONE highlight: its main button sits on the row's lift and must not stack a+ second one (3.48:1, code review 5 #2), and it takes the row's ink while any part of the row is+ hovered or focused (3.78:1 on --text). */+:root[data-nt-glass='on'] .dock-menu__row:is(:hover, :focus-within) button.dock-menu__row-main {+ color: var(--text-strong);+}+/* Hovers that painted `--panel-header` (= the fill again, a dark slab on glass — N5). The hover+ lift is not in the solver's highlight list, so its ink is --text-strong like every other+ highlight (--text on it measured 4.11 dark / 4.04 light, code review 5 #1). */:root[data-nt-glass='on'] :is(.dock-btn:not(.dock-add):hover:not(:disabled), .dock-zoom:hover, .ss-row:hover) {background: var(--glass-lift-hover);+ color: var(--text-strong);}:root[data-nt-glass='on'] .dock-zoom.active {background: var(--glass-lift);@@ -13883,6 +13952,7 @@ body.focus-mode .dock:hover {a dark slab, N5): a neutral lift instead; its own hover (`bg-fill-weak`) still applies. */:root[data-nt-glass='on'] button.bg-panel-header:not(:hover) {background-color: var(--glass-lift-hover);+ color: var(--text-strong);}/* Segmented controls: the selected segment is a neutral lifted thumb, as in Apple's segmentedcontrol, so the one filled accent per view stays the primary action (N12: Settings → Agents@@ -13890,6 +13960,11 @@ body.focus-mode .dock:hover {:root[data-nt-glass='on'] .seg-pill-opt {color: var(--muted);}+/* The rule above outranks the base `.seg-pill-opt:hover`, which left unselected segments without+ hover feedback (code review 5 #5). */+:root[data-nt-glass='on'] .seg-pill-opt:hover:not(.active) {+ color: var(--text);+}:root[data-nt-glass='on'] .seg-pill-opt.active {background: var(--glass-lift);color: var(--text-strong);@@ -13901,6 +13976,12 @@ body.focus-mode .dock:hover {:root[data-nt-glass='on'] :not(.sticky-node__body)::placeholder {color: var(--glass-placeholder);}+/* An empty field must look empty (visual QA round 3, NM1): the placeholder's 4.5:1 floor sits at+ --text's own alpha in light (0.85), so TYPED text in chrome fields takes --text-strong instead.+ Terminal nodes and the card-modal terminal keep their theme ink; notes keep their own. */+:root[data-nt-glass='on'] :is(input:not([type]), input[type='text'], input[type='search'], textarea):not(.term-node *, .sticky-node *, .kanban-modal__termwrap *, .monaco-editor *) {+ color: var(--text-strong);+}:root[data-nt-glass='on'] .settings-nav-row {background: transparent;}@@ -13912,10 +13993,6 @@ body.focus-mode .dock:hover {:root[data-nt-glass='on'] .tab.active::after {display: none;}-/* The project menu hangs from its caret, 3px INSIDE the glass bar (N11); on glass it clears the bar. */-:root[data-nt-glass='on'] .tab-menu--tabbar {- top: calc(var(--tabbar-h) + 4px) !important;-}/* The node's label row has its own `--panel` fill (for the glyph grid, which stands glass down);on glass that stacked a third band between header and body (visual QA M7). */@@ -14044,6 +14121,28 @@ body.focus-mode .dock:hover {:root[data-nt-glass='on'] :is(.board-log__title, .board-log__hint, .board-log__time, .board-log__event-body) {color: var(--muted);}+/* Secondary controls and labels were hard-coded 35–65% ink, 1.95–3.7:1 on glass (visual QA round 3,+ NM2/NM3): they take the glass secondary label; hovers are the neutral lift. The activity author+ was painted in the author's colour (systemGray for "you", 1.97:1 in light) — on glass it is ink,+ and the dot beside it keeps the colour. */+:root[data-nt-glass='on'] :is(.kanban-col__count, .kanban-col__close, .kanban-col__new, .kanban-meta__label, .kanban-modal__column, .kanban-prio) {+ color: var(--muted);+}+:root[data-nt-glass='on'] :is(.kanban-col__new, .kanban-prio) {+ border-color: var(--glass-edge);+}+:root[data-nt-glass='on'] :is(.kanban-col__new, .kanban-prio):hover {+ background: var(--glass-lift);+ border-color: var(--glass-edge);+ color: var(--text-strong);+}+:root[data-nt-glass='on'] .kanban-col__close:hover {+ color: var(--danger);+}+:root[data-nt-glass='on'] .board-log__author {+ color: var(--text) !important;+ font-weight: 600;+}:root[data-nt-glass='on'] .kanban-modal__termwrap--glass {background: var(--term-glass-bg);}diff --git a/src/renderer/styles.liquid-glass.test.ts b/src/renderer/styles.liquid-glass.test.tsindex 48989d03c..b434d436f 100644--- a/src/renderer/styles.liquid-glass.test.ts+++ b/src/renderer/styles.liquid-glass.test.ts@@ -69,7 +69,7 @@ describe('Liquid Glass stylesheet', () => {})it('row highlights on glass never re-stack a panel token (visual QA H1/H2)', () => {- for (const row of ['.palette__item.active', '.settings-nav-row', '.ctx-item', '.tab-menu button', '.tab.active', '.dock-btn', '.dock-zoom', '.ss-row:hover', 'button.bg-panel-header', '.seg-pill-opt.active']) {+ for (const row of ['.palette__item.active', '.settings-nav-row', '.ctx-item', '.tab-menu button', '.tab.active', '.dock-btn', '.dock-zoom', '.ss-row:hover', 'button.bg-panel-header', '.seg-pill-opt.active', '.speech-lang__row.is-active']) {const hits = gated(row).filter((r) => /background(-color)?:/.test(r.body))expect(hits.length, row).toBeGreaterThan(0)for (const r of hits) expect(r.body, row).not.toMatch(/--panel|--glass-chrome-bg/)@@ -77,10 +77,15 @@ describe('Liquid Glass stylesheet', () => {})it('highlighted rows carry --text-strong, the ink their readable alpha is solved for (N2)', () => {- for (const row of ['.palette__item.active', '.ctx-item', '.tab.active', '.dock-zoom.active', '.seg-pill-opt.active']) {+ // …the hover lift too: it is not in the solver's list, and --text on it is 4.11:1 (code review 5 #1).+ for (const row of ['.palette__item.active', '.ctx-item', '.tab.active', '.dock-zoom.active', '.seg-pill-opt.active', '.dock-btn', '.ss-row:hover', 'button.bg-panel-header', '.dock-menu__row:hover']) {const hits = gated(row).filter((r) => /background(-color)?:/.test(r.body))- expect(hits.some((r) => /color:\s*var\(--text-strong\)/.test(r.body)), row).toBe(true)+ expect(hits.length, row).toBeGreaterThan(0)+ for (const r of hits) expect(r.body, row).toMatch(/color:\s*var\(--text-strong\)/)}+ // A Layouts row is one highlight: its main button never stacks a second lift on the row's.+ expect(gated('.dock-menu button').some((r) => /dock-menu button(?!:not\(\.dock-menu__row-main\))/.test(r.selector) && /:hover/.test(r.selector))).toBe(false)+ expect(gated('button.dock-menu__row-main').some((r) => /color:\s*var\(--text-strong\)/.test(r.body))).toBe(true)})it('never translucent without a working blur (N1)', () => {