Replace idle toasts with pane border + titlebar badge

Old behaviour: every pane fired orch.notify("X is idle") after 5s of
silence, stacking up to N toasts that took ages to dismiss.

New behaviour:
- LeafPane tracks its own isIdle state locally and reports up via
  orch.reportLeafIdle(leafId, idle).
- App aggregates into a Set<NodeId> and renders "N idle" in red after
  the "N panes" count in the titlebar (hidden when zero).
- The pane itself gets a red border (.leaf.idle) — but active and
  broadcasting borders still take precedence, so the focus indicator
  isn't masked by idle status.
- The pane's "alive" status text in the toolbar swaps to red "idle"
  while it's quiet (reverts to "alive" the moment output arrives).
- Idle clears immediately on the next byte of output (no 1-second lag)
  AND when the pane unmounts (cleanup effect).

No more flood of toasts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
megaproxy 2026-05-22 19:54:20 +01:00
parent c93ebddfa5
commit d9ddf52699
5 changed files with 71 additions and 15 deletions

View file

@ -37,6 +37,11 @@ export interface Orchestration {
beginHeaderDrag: (leafId: NodeId) => void;
setHeaderDragOver: (leafId: NodeId | null) => void;
endHeaderDrag: (commitSwap: boolean) => void;
// Per-leaf idle reporting. LeafPanes call reportLeafIdle when their
// own quiet-state crosses the threshold; App aggregates so the titlebar
// can show an "N idle" count without spamming toast notifications.
reportLeafIdle: (leafId: NodeId, idle: boolean) => void;
}
const OrchestrationContext = createContext<Orchestration | null>(null);