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(notch-hud): dismiss a stuck row (hover × / right-click)

enesf9494d848b9a
diff --git a/docs/notch-hud.md b/docs/notch-hud.md
index a54c18c30..ff0d97139 100644
--- a/docs/notch-hud.md
+++ b/docs/notch-hud.md
@@ -86,6 +86,10 @@ the transparent rest of the window stays click-through. Hidden entirely when idl
label + state). A **Go** button (or row-tap) → IPC → main mirrors the notification-click handler:
`getMainWindow().show()/focus()` + `sendToMain(app:focus-node, nodeId)` → `Canvas.focusNodeById`,
and clears that node's done latch.
+- **Dismissing a row**: hovering a row reveals a `×` (right-click on the row does the same) →
+ `IPC.hudDismiss` → `model.dismiss(nodeId)`. It latches the state the row was hidden AT
+ (`dismissedAt`), so a session hung in `working` (agent died mid-turn) stays hidden while any
+ genuine state change brings the row back. HUD-local only — the node/terminal is untouched.
- **Notchless fallback** (`hasNotch === false`, e.g. an external monitor or a display with no menu
bar): the `.notchless` root class draws the capsule as a **standalone floating pill** — a small
`--pill-top-gap` above it and all-corner `--pill-radius`, since there is no notch to fuse with.
@@ -107,5 +111,6 @@ renderer entry).
## Out of scope (v1)
-Pet-switching config, non-darwin (Windows/Linux) HUD, per-row context menu, multi-monitor notch
+Pet-switching config, non-darwin (Windows/Linux) HUD, a full per-row context menu (dismiss is a
+right-click / hover ×, not a menu), multi-monitor notch
precision beyond centering, the SDK chat node in the panel.
diff --git a/src/main/notch-hud-model.test.ts b/src/main/notch-hud-model.test.ts
index 3269bd2e7..eeb91ae29 100644
--- a/src/main/notch-hud-model.test.ts
+++ b/src/main/notch-hud-model.test.ts
@@ -208,3 +208,26 @@ describe('buildIndicator + ordering', () => {
expect(ind.doneUnseen).toBe(true)
})
})
+
+describe('dismiss', () => {
+ it('hides a stuck row until its state genuinely changes', () => {
+ const m = createHudModel()
+ m.applyStateChange(stateChange({ nodeId: 'stuck', state: 'working', agentId: 'claude', ts: T0 }))
+ expect(rowFor(m.buildRows(T0 + 1, titleOf), 'stuck')?.state).toBe('working')
+
+ m.dismiss('stuck')
+ expect(rowFor(m.buildRows(T0 + 2, titleOf), 'stuck')).toBeUndefined()
+ // Still hidden on a repeat build and on a mirror flush that keeps it working.
+ m.applyMirrorFlush({ nodes: { stuck: { state: 'working', agentId: 'claude', updatedAt: T0 } } } as never)
+ expect(rowFor(m.buildRows(T0 + 3, titleOf), 'stuck')).toBeUndefined()
+
+ // A real state change earns the row back.
+ m.applyStateChange(stateChange({ nodeId: 'stuck', state: 'done', ts: T0 + 4 }))
+ expect(rowFor(m.buildRows(T0 + 5, titleOf), 'stuck')?.state).toBe('done')
+ })
+
+ it('ignores an unknown node', () => {
+ const m = createHudModel()
+ expect(() => m.dismiss('nope')).not.toThrow()
+ })
+})
diff --git a/src/main/notch-hud-model.ts b/src/main/notch-hud-model.ts
index e542e5a44..faf031e68 100644
--- a/src/main/notch-hud-model.ts
+++ b/src/main/notch-hud-model.ts
@@ -60,6 +60,10 @@ interface NodeAccum {
presentInMirror: boolean
/** The done highlight has been acknowledged (focused / panel opened) → demote to idle. */
doneSeen: boolean
+ /** The state this node was manually dismissed AT — hidden until it moves off that state.
+ * (A session can hang in `working` forever if its agent dies mid-turn; the HUD would show it
+ * for good. Dismiss hides it, and any genuine state change brings it back.) */
+ dismissedAt?: HudRowState
}
/** Map an agent's 4-state model to the HUD's 3 live buckets (waiting/blocked collapse to needsYou). */
@@ -95,6 +99,8 @@ export interface HudModel {
noteFocus(nodeId: string): void
/** Clear EVERY node's done highlight (the panel was opened — "you looked at it"). */
notePanelOpened(): void
+ /** Hide a row by hand (a stuck session). It returns if its state genuinely changes. */
+ dismiss(nodeId: string): void
/** Drop nodes gone from the mirror + idle > 6h. Returns true if anything changed. */
prune(now: number): boolean
/** Build the row array (active sessions, newest-active first), joining titles in. */
@@ -228,6 +234,15 @@ export function createHudModel(): HudModel {
for (const a of nodes.values()) if (a.state === 'done') a.doneSeen = true
}
+ function dismiss(nodeId: string): void {
+ const a = nodes.get(nodeId)
+ if (!a) return
+ // Latch the state we're hiding AT, not a boolean: a node stuck in `working` stays hidden, but
+ // the moment it really moves (done / needs-you / a new turn) it earns its row back.
+ a.dismissedAt = displayState(a)
+ if (a.state === 'done') a.doneSeen = true
+ }
+
function prune(now: number): boolean {
let changed = false
for (const [nodeId, a] of nodes) {
@@ -253,6 +268,8 @@ export function createHudModel(): HudModel {
const state = displayState(a)
// The HUD shows active sessions only — nothing when a node is idle/seen.
if (state === 'idle') continue
+ if (a.dismissedAt === state) continue
+ a.dismissedAt = undefined
const model = a.sessionId ? modelBySession.get(a.sessionId) : undefined
rows.push({
nodeId,
@@ -279,6 +296,7 @@ export function createHudModel(): HudModel {
applyContextUpdate,
noteFocus,
notePanelOpened,
+ dismiss,
prune,
buildRows
}
diff --git a/src/main/notch-hud.ts b/src/main/notch-hud.ts
index e1c1f2665..3c415805c 100644
--- a/src/main/notch-hud.ts
+++ b/src/main/notch-hud.ts
@@ -102,6 +102,7 @@ class NotchHudController {
private readonly onSetIgnoreMouse: (_e: unknown, ignore: boolean) => void
private readonly onFocusNode: (_e: unknown, nodeId: string) => void
private readonly onExpanded: (_e: unknown, expanded: boolean) => void
+ private readonly onDismiss: (_e: unknown, nodeId: string) => void
/** When the panel was opened (epoch ms), 0 while collapsed — gates the read-clear below. */
private panelOpenedAt = 0
private readonly onDisplayChange: () => void
@@ -127,6 +128,11 @@ class NotchHudController {
this.model.noteFocus(nodeId)
this.schedulePush()
}
+ this.onDismiss = (_e, nodeId) => {
+ if (typeof nodeId !== 'string' || !nodeId) return
+ this.model.dismiss(nodeId)
+ this.schedulePush()
+ }
this.onExpanded = (_e, expanded) => {
// The done latch clears when the panel CLOSES, not when it opens — and only after it was
// open long enough to read (field bug: with hover-to-open the green blob vanished the instant
@@ -210,6 +216,7 @@ class NotchHudController {
ipcMain.on(IPC.hudSetIgnoreMouse, this.onSetIgnoreMouse)
ipcMain.on(IPC.hudFocusNode, this.onFocusNode)
ipcMain.on(IPC.hudExpanded, this.onExpanded)
+ ipcMain.on(IPC.hudDismiss, this.onDismiss)
this.ipcBound = true
}
@@ -218,6 +225,7 @@ class NotchHudController {
ipcMain.removeListener(IPC.hudSetIgnoreMouse, this.onSetIgnoreMouse)
ipcMain.removeListener(IPC.hudFocusNode, this.onFocusNode)
ipcMain.removeListener(IPC.hudExpanded, this.onExpanded)
+ ipcMain.removeListener(IPC.hudDismiss, this.onDismiss)
this.ipcBound = false
}
diff --git a/src/preload/hud.ts b/src/preload/hud.ts
index 72894fc9e..553640b6d 100644
--- a/src/preload/hud.ts
+++ b/src/preload/hud.ts
@@ -1,6 +1,6 @@
// Tiny, HUD-only preload (docs/notch-hud.md). The Notch HUD is a separate BrowserWindow with a
// minimal surface — it does not need the full `window.nodeTerminal` API, so it gets its own bridge
-// exposing exactly the four HUD channels. contextIsolation stays on; no node integration.
+// exposing exactly the HUD channels. contextIsolation stays on; no node integration.
import { contextBridge, ipcRenderer } from 'electron'
import { IPC } from '../shared/ipc'
@@ -45,6 +45,8 @@ export interface HudApi {
focusNode(nodeId: string): void
/** hud → main: the panel expanded (true) / collapsed (false). */
setExpanded(expanded: boolean): void
+ /** hud → main: remove this row from the HUD (a session stuck in `working`). */
+ dismiss(nodeId: string): void
}
const api: HudApi = {
@@ -55,7 +57,8 @@ const api: HudApi = {
},
setIgnoreMouse: (ignore) => ipcRenderer.send(IPC.hudSetIgnoreMouse, ignore),
focusNode: (nodeId) => ipcRenderer.send(IPC.hudFocusNode, nodeId),
- setExpanded: (expanded) => ipcRenderer.send(IPC.hudExpanded, expanded)
+ setExpanded: (expanded) => ipcRenderer.send(IPC.hudExpanded, expanded),
+ dismiss: (nodeId) => ipcRenderer.send(IPC.hudDismiss, nodeId)
}
contextBridge.exposeInMainWorld('hud', api)
diff --git a/src/renderer/hud/hud.css b/src/renderer/hud/hud.css
index ddb14969f..e8e75ee3a 100644
--- a/src/renderer/hud/hud.css
+++ b/src/renderer/hud/hud.css
@@ -254,9 +254,41 @@ body {
padding: 7px 8px;
border-radius: 9px;
cursor: pointer;
+ position: relative;
+ transition: padding-right 0.12s ease;
}
.hud-row:hover {
background: rgba(255, 255, 255, 0.06);
+ /* Make room for the dismiss × instead of letting it sit on top of the tag. */
+ padding-right: 26px;
+}
+
+/* Dismiss (×): hover-only, so an idle HUD stays clean. Right-click on the row does the same. */
+.hud-row__close {
+ position: absolute;
+ top: 6px;
+ right: 5px;
+ width: 17px;
+ height: 17px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 13px;
+ line-height: 1;
+ color: rgba(255, 255, 255, 0.55);
+ background: rgba(255, 255, 255, 0.08);
+ border: none;
+ border-radius: 50%;
+ cursor: pointer;
+ opacity: 0;
+ transition: opacity 0.12s ease;
+}
+.hud-row:hover .hud-row__close {
+ opacity: 1;
+}
+.hud-row__close:hover {
+ color: #fff;
+ background: rgba(255, 69, 58, 0.75);
}
.hud-row__icon {
grid-row: 1 / span 2;
diff --git a/src/renderer/hud/main.ts b/src/renderer/hud/main.ts
index 38c228723..0c64312cd 100644
--- a/src/renderer/hud/main.ts
+++ b/src/renderer/hud/main.ts
@@ -40,6 +40,7 @@ interface HudApi {
setIgnoreMouse(ignore: boolean): void
focusNode(nodeId: string): void
setExpanded(expanded: boolean): void
+ dismiss(nodeId: string): void
}
declare global {
@@ -266,6 +267,24 @@ function buildRow(row: HudRow): HTMLElement {
if (row.subagents.length > 0) el.append(buildSubs(row))
+ // Dismiss (hover ×, or right-click anywhere on the row): a session can hang in `working` when its
+ // agent dies mid-turn, and the HUD would carry it forever. Hiding is local to the HUD — the node
+ // and its terminal are untouched, and a real state change brings the row back.
+ const dismiss = (e: Event): void => {
+ e.preventDefault()
+ e.stopPropagation()
+ window.hud.dismiss(row.nodeId)
+ }
+ el.addEventListener('contextmenu', dismiss)
+
+ const close = document.createElement('button')
+ close.className = 'hud-row__close'
+ close.title = 'Remove from HUD'
+ close.setAttribute('aria-label', 'Remove from HUD')
+ close.textContent = '×'
+ close.addEventListener('click', dismiss)
+ el.append(close)
+
const go = document.createElement('button')
go.className = 'hud-row__go'
go.textContent = 'Go'
diff --git a/src/shared/ipc.ts b/src/shared/ipc.ts
index 9fd23b458..6b7c655be 100644
--- a/src/shared/ipc.ts
+++ b/src/shared/ipc.ts
@@ -58,6 +58,8 @@ export const IPC = {
hudFocusNode: 'hud:focus-node',
/** hud → main: the panel expanded/collapsed. `true` clears every done latch (you looked). */
hudExpanded: 'hud:expanded',
+ /** hud → main: dismiss one HUD row by hand (a stuck session). Arg: `nodeId: string`. */
+ hudDismiss: 'hud:dismiss',
agentControl: 'agent:control',
agentControlResult: 'agent:control-result',
/** Canvas sync: a client casts its local node mutations here; the core reflector