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(canvas): stable move handlers and a debounced blur restore

iceclatterWT0113e5c9edf6
diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsx
index 793cadb2c..2406579eb 100644
--- a/src/renderer/canvas/Canvas.tsx
+++ b/src/renderer/canvas/Canvas.tsx
@@ -1523,10 +1523,28 @@ export function Canvas() {
// Glass terminals: while the camera moves, every glass node's backdrop changes each frame and
// the 28px blur is re-rasterised for all of them. The class drops the blur (the tint stays, and
// the tint alone is what the contrast guarantee rests on) until the move settles. A classList
- // toggle rather than state, so a pan does not re-render this component twice.
- const setCanvasMoving = useCallback((moving: boolean) => {
- flowWrapRef.current?.classList.toggle('canvas-moving', moving)
+ // toggle rather than state, so a pan does not re-render this component twice. The REMOVAL is
+ // debounced: a wheel zoom driven through setViewport ends a "move" on every packet, and toggling
+ // the blur back on between packets would re-rasterise it anyway.
+ const movingClearRef = useRef<ReturnType<typeof setTimeout> | null>(null)
+ const onCanvasMoveStart = useCallback(() => {
+ if (movingClearRef.current) clearTimeout(movingClearRef.current)
+ movingClearRef.current = null
+ flowWrapRef.current?.classList.add('canvas-moving')
}, [])
+ const onCanvasMoveEnd = useCallback(() => {
+ if (movingClearRef.current) clearTimeout(movingClearRef.current)
+ movingClearRef.current = setTimeout(() => {
+ movingClearRef.current = null
+ flowWrapRef.current?.classList.remove('canvas-moving')
+ }, 150)
+ }, [])
+ useEffect(
+ () => () => {
+ if (movingClearRef.current) clearTimeout(movingClearRef.current)
+ },
+ []
+ )
// Undo/redo history (snapshots of the nodes array; arrays are immutable per change).
const pastRef = useRef<CanvasNode[][]>([])
const futureRef = useRef<CanvasNode[][]>([])
@@ -14832,8 +14850,8 @@ export function Canvas() {
onConnect={onConnect}
onEdgeDoubleClick={onEdgeDoubleClick}
onMove={onMove}
- onMoveStart={() => setCanvasMoving(true)}
- onMoveEnd={() => setCanvasMoving(false)}
+ onMoveStart={onCanvasMoveStart}
+ onMoveEnd={onCanvasMoveEnd}
onNodeDragStart={() => (draggingRef.current = true)}
onNodeDragStop={() => {
draggingRef.current = false
diff --git a/src/renderer/state/wallpaper.ts b/src/renderer/state/wallpaper.ts
index 0e8fc5e39..c8c7d1138 100644
--- a/src/renderer/state/wallpaper.ts
+++ b/src/renderer/state/wallpaper.ts
@@ -33,8 +33,8 @@ function load(w: DesktopWallpaper): Promise<string | null> {
.then((url) => (url ? `url("${url}")` : null))
.catch(() => null)
loaded.set(key, p)
- // A miss is not remembered: the file may appear (a still converting, an import finishing), and
- // a cached null would pin the plain canvas until the app restarts.
+ // A miss is not remembered, so the NEXT selection of this wallpaper asks core again instead of
+ // getting the cached null for the rest of the app run. Nothing retries on its own.
void p.then((bg) => {
if (bg === null && loaded.get(key) === p) loaded.delete(key)
})
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index 0703673f4..a0cd94c99 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -1479,7 +1479,8 @@ body,
/* The header sits on the TERMINAL theme's tint, so its text takes the terminal's foreground:
with the app's own --text, a light app theme over a dark terminal theme measured 1.31:1.
Redefined as tokens so every header child that reads them (title, session chip, icons)
- follows; the header layer only adds tint, so the foreground's 4.5:1 holds here too. */
+ follows; the header layer only adds tint, so --text (the foreground) keeps its 4.5:1 here
+ too. --muted is a 75% mix of it and carries no such guarantee. */
--text: var(--term-glass-fg);
--muted: color-mix(in srgb, var(--term-glass-fg) 75%, transparent);
color: var(--term-glass-fg);