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): moved resize controls take the pointer, the old box still paints

Ara Babigian8a1aa689374a
diff --git a/src/renderer/nodes/BrowserNode.tsx b/src/renderer/nodes/BrowserNode.tsx
index 89b4d5880..3eb50a521 100644
--- a/src/renderer/nodes/BrowserNode.tsx
+++ b/src/renderer/nodes/BrowserNode.tsx
@@ -26,6 +26,8 @@ export default function BrowserNode({ id, data, selected }: NodeProps<CanvasNode
return (
<>
<div className={`term-node browser-node${selected ? ' selected' : ''}`} style={{ borderTopColor: data.color }}>
+ {/* Paint only: the old resize box in its old place (see .nt-resize-ghost in styles.css). */}
+ <NodeResizer isVisible={selected} color={data.color} lineClassName="nt-resize-ghost" handleClassName="nt-resize-ghost" />
{/* Invisible target handle so a rope from the agent node that opened this can attach. */}
<Handle
id="flow-in"
diff --git a/src/renderer/nodes/DiffNode.tsx b/src/renderer/nodes/DiffNode.tsx
index c9c05eb30..c5279af74 100644
--- a/src/renderer/nodes/DiffNode.tsx
+++ b/src/renderer/nodes/DiffNode.tsx
@@ -140,6 +140,8 @@ export function DiffNode({ id, data, selected }: NodeProps<CanvasNode>) {
className={`term-node editor-node${selected ? ' selected' : ''}`}
style={{ borderTopColor: data.color }}
>
+ {/* Paint only: the old resize box in its old place (see .nt-resize-ghost in styles.css). */}
+ <NodeResizer isVisible={selected} color={data.color} lineClassName="nt-resize-ghost" handleClassName="nt-resize-ghost" />
<div className="term-node__header">
<span className="term-node__title-text" title={`${rel} — ${commitOid ? commitOid.slice(0, 7) : staged ? 'staged' : 'working'}`}>
{rel.split('/').pop()}
diff --git a/src/renderer/nodes/DinoNode.tsx b/src/renderer/nodes/DinoNode.tsx
index bb4164b93..cdd223d5b 100644
--- a/src/renderer/nodes/DinoNode.tsx
+++ b/src/renderer/nodes/DinoNode.tsx
@@ -96,6 +96,8 @@ export function DinoNode({ id, data, selected }: NodeProps<CanvasNode>) {
return (
<>
<div className={`dino-node${selected ? ' selected' : ''}`} style={{ borderColor: data.color }}>
+ {/* Paint only: the old resize box in its old place (see .nt-resize-ghost in styles.css). */}
+ <NodeResizer isVisible={selected} color={data.color} lineClassName="nt-resize-ghost" handleClassName="nt-resize-ghost" />
<div className="dino-node__header" style={{ background: `${data.color}33` }}>
<span className="term-node__color" style={{ background: data.color }} />
<input
diff --git a/src/renderer/nodes/EditorNode.tsx b/src/renderer/nodes/EditorNode.tsx
index e9a53ce96..6db6d7de8 100644
--- a/src/renderer/nodes/EditorNode.tsx
+++ b/src/renderer/nodes/EditorNode.tsx
@@ -268,6 +268,8 @@ export function EditorNode({ id, data, selected }: NodeProps<CanvasNode>) {
onMouseEnter={() => (hoveredRef.current = true)}
onMouseLeave={() => (hoveredRef.current = false)}
>
+ {/* Paint only: the old resize box in its old place (see .nt-resize-ghost in styles.css). */}
+ <NodeResizer isVisible={selected} color={data.color} lineClassName="nt-resize-ghost" handleClassName="nt-resize-ghost" />
{/* Invisible target handle so a rope from an agent node that opened this can attach. */}
<Handle
id="flow-in"
diff --git a/src/renderer/nodes/FilesNode.tsx b/src/renderer/nodes/FilesNode.tsx
index d1c27be90..24540f58b 100644
--- a/src/renderer/nodes/FilesNode.tsx
+++ b/src/renderer/nodes/FilesNode.tsx
@@ -441,6 +441,8 @@ export function FilesNode({ id, data, selected }: NodeProps<CanvasNode>) {
return (
<>
<div className={`files-node${selected ? ' selected' : ''}${collapsed ? ' collapsed' : ''}`}>
+ {/* Paint only: the old resize box in its old place (see .nt-resize-ghost in styles.css). */}
+ <NodeResizer isVisible={selected && !collapsed} color={data.color as string} lineClassName="nt-resize-ghost" handleClassName="nt-resize-ghost" />
<div className="files-node__header" style={{ background: `${data.color}22` }}>
<button className="term-node__collapse" title={collapsed ? 'Expand' : 'Collapse'} onClick={toggleCollapse}>
{collapsed ? '▸' : '▾'}
diff --git a/src/renderer/nodes/LoopNode.tsx b/src/renderer/nodes/LoopNode.tsx
index f47419b0a..9c1d70298 100644
--- a/src/renderer/nodes/LoopNode.tsx
+++ b/src/renderer/nodes/LoopNode.tsx
@@ -56,6 +56,8 @@ export function LoopNode({ id, data, selected }: NodeProps<CanvasNode>) {
return (
<>
<div onPointerDownCapture={select} className={`loop-node${active ? ' working' : ''}`}>
+ {/* Paint only: the old resize box in its old place (see .nt-resize-ghost in styles.css). */}
+ <NodeResizer isVisible={selected} color="var(--state-automation)" lineClassName="nt-resize-ghost" handleClassName="nt-resize-ghost" />
<Handle type="target" position={Position.Top} isConnectable={false} />
<div className="loop-node__head nodrag" onClick={toggle} style={{ cursor: 'pointer' }}>
<button
diff --git a/src/renderer/nodes/SubagentNode.tsx b/src/renderer/nodes/SubagentNode.tsx
index 3fad5c4b8..b104e991d 100644
--- a/src/renderer/nodes/SubagentNode.tsx
+++ b/src/renderer/nodes/SubagentNode.tsx
@@ -62,6 +62,8 @@ export function SubagentNode({ id, data, selected }: NodeProps<CanvasNode>) {
return (
<>
<div onPointerDownCapture={select} className={`subagent-node${working ? ' working' : ' done'}`}>
+ {/* Paint only: the old resize box in its old place (see .nt-resize-ghost in styles.css). */}
+ <NodeResizer isVisible={selected} color="#d97757" lineClassName="nt-resize-ghost" handleClassName="nt-resize-ghost" />
<Handle type="target" position={Position.Top} isConnectable={false} />
<div className="subagent-node__head nodrag" onClick={toggle} style={{ cursor: 'pointer' }}>
<button
diff --git a/src/renderer/nodes/TerminalNode.tsx b/src/renderer/nodes/TerminalNode.tsx
index cb436f21a..82366c54b 100644
--- a/src/renderer/nodes/TerminalNode.tsx
+++ b/src/renderer/nodes/TerminalNode.tsx
@@ -5987,6 +5987,8 @@ export function TerminalNode({
onMouseEnter={() => (hoveredRef.current = true)}
onMouseLeave={() => (hoveredRef.current = false)}
>
+ {/* Paint only: the old resize box in its old place (see .nt-resize-ghost in styles.css). */}
+ <NodeResizer isVisible={selected && !collapsed && !focused} color="#0a84ff" lineClassName="nt-resize-ghost" handleClassName="nt-resize-ghost" />
{/* Invisible source handle so edges to subagent/loop nodes can attach. */}
<Handle
id="flow-out"
diff --git a/src/renderer/nodes/TriggerNode.tsx b/src/renderer/nodes/TriggerNode.tsx
index 3bd8c0683..0eb017bbf 100644
--- a/src/renderer/nodes/TriggerNode.tsx
+++ b/src/renderer/nodes/TriggerNode.tsx
@@ -202,6 +202,8 @@ export function TriggerNode({ id, data, selected }: NodeProps<CanvasNode>) {
return (
<>
<div className={`trigger-node${selected ? ' selected' : ''}`} style={{ borderColor: data.color }}>
+ {/* Paint only: the old resize box in its old place (see .nt-resize-ghost in styles.css). */}
+ <NodeResizer isVisible={selected} color={data.color} lineClassName="nt-resize-ghost" handleClassName="nt-resize-ghost" />
<div className="trigger-node__header" style={{ background: `${data.color}33` }}>
<span className="term-node__color" style={{ background: data.color }} />
<input
diff --git a/src/renderer/nodes/VideoNode.tsx b/src/renderer/nodes/VideoNode.tsx
index 313b18729..34efe1438 100644
--- a/src/renderer/nodes/VideoNode.tsx
+++ b/src/renderer/nodes/VideoNode.tsx
@@ -78,6 +78,8 @@ export default function VideoNode({ id, data, selected }: NodeProps<CanvasNode>)
className={`term-node video-node${selected ? ' selected' : ''}`}
style={{ borderTopColor: data.color }}
>
+ {/* Paint only: the old resize box in its old place (see .nt-resize-ghost in styles.css). */}
+ <NodeResizer isVisible={selected} color={data.color} lineClassName="nt-resize-ghost" handleClassName="nt-resize-ghost" />
{/* Invisible target handle so a rope from the agent node that opened this can attach. */}
<Handle
id="flow-in"
diff --git a/src/renderer/nodes/WebNode.tsx b/src/renderer/nodes/WebNode.tsx
index b07d72a8d..01b93f921 100644
--- a/src/renderer/nodes/WebNode.tsx
+++ b/src/renderer/nodes/WebNode.tsx
@@ -172,6 +172,8 @@ export default function WebNode({ id, data, selected }: NodeProps<CanvasNode>) {
className={`term-node web-node${selected ? ' selected' : ''}`}
style={{ borderTopColor: data.color }}
>
+ {/* Paint only: the old resize box in its old place (see .nt-resize-ghost in styles.css). */}
+ <NodeResizer isVisible={selected} color={data.color} lineClassName="nt-resize-ghost" handleClassName="nt-resize-ghost" />
{/* Invisible target handle so a rope from the agent node that opened this can attach. */}
<Handle
id="flow-in"
diff --git a/src/renderer/nodes/node-resizer-placement.test.ts b/src/renderer/nodes/node-resizer-placement.test.ts
index b1eb3fa57..e7c55e3fe 100644
--- a/src/renderer/nodes/node-resizer-placement.test.ts
+++ b/src/renderer/nodes/node-resizer-placement.test.ts
@@ -37,13 +37,33 @@ const FILTERED_ROOTS: Record<string, string> = {
/** Index of the root's closing tag: the last 4-space-indented `</div>` of the component's return. */
const rootClose = (src: string): number => src.lastIndexOf('\n </div>\n')
+/** Every `<NodeResizer …/>` tag in the file, with its offset. */
+const resizers = (src: string): { at: number; tag: string }[] =>
+ [...src.matchAll(/<NodeResizer\b[\s\S]*?\/>/g)].map((m) => ({ at: m.index!, tag: m[0] }))
+/** The paint-only copy: a second NodeResizer whose controls carry `nt-resize-ghost`. */
+const isPaintCopy = (tag: string): boolean =>
+ /lineClassName="nt-resize-ghost"/.test(tag) && /handleClassName="nt-resize-ghost"/.test(tag)
+const colorOf = (tag: string) => tag.match(/color=(\{[^}]*\}|"[^"]*")/)?.[1]
+
describe('NodeResizer sits outside, after, a backdrop-filtered node root', () => {
it.each(Object.entries(FILTERED_ROOTS))('%s', (file, rootClass) => {
+ const src = read(file)
+ expect(src.indexOf(`className={\`${rootClass}`)).toBeGreaterThan(-1)
+ const live = resizers(src).filter((r) => !isPaintCopy(r.tag))
+ expect(live).toHaveLength(1)
+ expect(live[0].at).toBeGreaterThan(rootClose(src))
+ })
+
+ it.each(Object.entries(FILTERED_ROOTS))('%s paints the old resize box from inside the root', (file, rootClass) => {
const src = read(file)
const root = src.indexOf(`className={\`${rootClass}`)
- const resizer = src.indexOf('<NodeResizer')
- expect(root).toBeGreaterThan(-1)
- expect(resizer).toBeGreaterThan(rootClose(src))
+ const copies = resizers(src).filter((r) => isPaintCopy(r.tag))
+ expect(copies).toHaveLength(1)
+ expect(copies[0].at).toBeGreaterThan(root)
+ expect(copies[0].at).toBeLessThan(rootClose(src))
+ // the same colour expression as the live resizer, so it paints what the old one painted
+ const live = resizers(src).find((r) => !isPaintCopy(r.tag))!
+ expect(colorOf(copies[0].tag)).toBe(colorOf(live.tag))
})
it('the terminal link dots sit outside, after, the root too', () => {
@@ -52,6 +72,18 @@ describe('NodeResizer sits outside, after, a backdrop-filtered node root', () =>
})
})
+describe('the moved resizer paints above the root it now follows', () => {
+ const css = read('../styles.css')
+ const z = (sel: string): number => {
+ const i = css.indexOf(`${sel} {`)
+ return Number(css.slice(i, css.indexOf('}', i)).match(/z-index:\s*(\d+)/)?.[1])
+ }
+ it('is above the root and the terminal hover guard (z 2), below the kanban half-pill', () => {
+ expect(z('.react-flow__node > .react-flow__resize-control')).toBeGreaterThan(2)
+ expect(z('.kanban-node-pill')).toBeGreaterThan(z('.react-flow__node > .react-flow__resize-control'))
+ })
+})
+
describe('focus mode reparenting', () => {
;(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true
const Control = ({ visible }: { visible: boolean }) => (visible ? h('div', { className: 'ctl' }) : null)
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index ed2f68a66..c9729dcf1 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -7478,6 +7478,13 @@ body,
pointer-events: auto;
}
+/* The node's resize controls are a SIBLING of its root (so a glass root's backdrop-filter cannot
+ clip them), which puts the later-painted root over their inner half. Lift them above the root
+ and the terminal's hover guard (z 2); the kanban half-pill stays above them. */
+.react-flow__node > .react-flow__resize-control {
+ z-index: 3;
+}
+
/* Bound to a git worktree: a checkout, not a loose grouping. Solid, thicker border (the tint is
bumped inline from the group's own data.color — no separate palette) so it reads as bound from
across the canvas, where the label pill is too small to parse. */
@@ -12927,6 +12934,8 @@ button.pull-checks__name {
text-overflow: ellipsis;
cursor: pointer;
backdrop-filter: blur(4px);
+ /* Over the node's resize controls (z 3). */
+ z-index: 4;
}
.kanban-node-pill:hover {
filter: brightness(1.3);
@@ -17200,6 +17209,39 @@ body.focus-mode .dock:hover {
:root[data-nt-glass='on'] .react-flow__node:not(.react-flow__node-group) .react-flow__resize-control.line {
border-color: var(--glass-edge) !important;
}
+/* The live resize controls moved OUTSIDE the node root (direct children of the node wrapper) only
+ take the pointer; they paint nothing in any look. A control outside the root cannot reproduce
+ where the old one painted (under glass: against the root's padding box, cut by its rounded
+ clip; in every look: partly under the node's own body), so each node also renders a second,
+ paint-only <NodeResizer> in the old place inside the root, its controls classed
+ `.nt-resize-ghost` and taking no pointer — so no second resizer can ever start a drag.
+ Specific enough, and !important, to beat React Flow's inline colour and the glass overrides. */
+:root .flow-wrap .react-flow .react-flow__node:not(.react-flow__node-group) > .react-flow__resize-control:is(.handle, .line) {
+ background-color: transparent !important;
+ border-color: transparent !important;
+}
+.react-flow__resize-control.nt-resize-ghost {
+ pointer-events: none;
+}
+/* Link dots moved OUTSIDE a terminal's root (so a glass root's backdrop-filter, its own stacking
+ context, no longer buries them under the resize controls) keep the look they had while that
+ root clipped them: laid out against its PADDING box, so centred 1px inside the border, and
+ showing only their inner half. Scoped to exactly when the root's backdrop-filter is live — it
+ is dropped while the camera moves with "Keep blur while moving" off (.canvas-moving) and under
+ Reduce Transparency, and there nothing was clipped. A clip-path also clips hit testing, so the
+ outer half goes to the resize band exactly as before; the tooltip (above, growing inward) stays
+ inside the clip, so on a node narrower than it the tooltip is no longer cut at the node's far
+ edge as it was (not reproduced: the clip box cannot reach the node's width). */
+@media (prefers-reduced-transparency: no-preference) {
+ :root[data-nt-glass='on'] .flow-wrap:not(.canvas-moving) .react-flow__node > .bridge-handle--in {
+ left: 1px;
+ clip-path: inset(-48px -480px -48px 50%);
+ }
+ :root[data-nt-glass='on'] .flow-wrap:not(.canvas-moving) .react-flow__node > .bridge-handle--out {
+ right: 1px;
+ clip-path: inset(-48px 50% -48px -480px);
+ }
+}
/* State stays visible without the accent colour: selection is a neutral ink outline; unread and
attention keep their own glows (app state, not a per-node colour), and their border reads
through the neutral top edge too. */
diff --git a/src/renderer/styles.liquid-glass.test.ts b/src/renderer/styles.liquid-glass.test.ts
index 3d74c988e..264b933fa 100644
--- a/src/renderer/styles.liquid-glass.test.ts
+++ b/src/renderer/styles.liquid-glass.test.ts
@@ -39,6 +39,38 @@ describe('Liquid Glass stylesheet', () => {
expect(dot?.body).toMatch(/background:\s*transparent\s*!important/)
})
+ it('the moved resize controls paint nothing in any look; their inert copies do the painting', () => {
+ const idx = (sel: string) => rules.findIndex((r) => r.selector === sel)
+ const moved = rules.filter((r) => r.selector.endsWith('> .react-flow__resize-control:is(.handle, .line)'))
+ expect(moved).toHaveLength(1)
+ expect(moved[0].selector.startsWith(GATE)).toBe(false) // every look, not just glass
+ expect(moved[0].body).toMatch(/background-color:\s*transparent\s*!important/)
+ expect(moved[0].body).toMatch(/border-color:\s*transparent\s*!important/)
+ // More specific than the neutralising glass overrides (6 class-level parts) it must beat.
+ expect(moved[0].selector).toBe(
+ ':root .flow-wrap .react-flow .react-flow__node:not(.react-flow__node-group) > .react-flow__resize-control:is(.handle, .line)'
+ )
+ expect(idx(":root[data-nt-glass='on'] .react-flow__node:not(.react-flow__node-group) .react-flow__resize-control.handle")).toBeGreaterThan(-1)
+ // The copies take no pointer.
+ expect(rules.find((r) => r.selector === '.react-flow__resize-control.nt-resize-ghost')?.body).toMatch(/pointer-events:\s*none/)
+ })
+
+ it('the moved link dots keep their clipped look, only while the root blur is live', () => {
+ const dotIn = gated('> .bridge-handle--in')[0]
+ const dotOut = gated('> .bridge-handle--out')[0]
+ // laid out against the root's padding box (1px inside the border), inner half only
+ expect(dotIn?.body).toMatch(/left:\s*1px/)
+ expect(dotOut?.body).toMatch(/right:\s*1px/)
+ expect(dotIn?.body).toMatch(/clip-path:\s*inset\(-48px -480px -48px 50%\)/)
+ expect(dotOut?.body).toMatch(/clip-path:\s*inset\(-48px 50% -48px -480px\)/)
+ // Not while the camera moves with blur-while-moving off, nor under Reduce Transparency:
+ // there the root's backdrop-filter is off and nothing was clipped.
+ for (const r of [dotIn, dotOut]) expect(r.selector).toContain('.flow-wrap:not(.canvas-moving)')
+ const media = CSS.indexOf('@media (prefers-reduced-transparency: no-preference) {')
+ const block = CSS.slice(media, CSS.indexOf('\n}\n', media))
+ for (const needle of ['> .bridge-handle--in', '> .bridge-handle--out']) expect(block).toContain(needle)
+ })
+
it('keeps selection visible with neutral ink, not the accent', () => {
const sel = gated('.term-node.selected')[0]
expect(sel?.body).toMatch(/border-color:\s*var\(--text\)\s*!important/)