From d44b049c510e7f1c0d3be26a24978172dea8ff08 Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Fri, 13 Nov 2026 20:35:32 +0100 Subject: [PATCH] chore(web): remove the teammate terminal windows nothing can open A subagent window could host an xterm attached to a teammate's tmux pane, but only for a teammate listed in teammatePanesByName, and the SSE listeners that filled that map were removed in February. Since then the branch could not be taken, and the code behind it was unreachable: - initTeammateTerminal and the lazy dispose / restore pair that parked a teammate terminal while its window was minimized or hidden; - the two maps (teammatePanesByName, teammateTerminals) and every loop over them: window close and reconnect cleanup, the live font-weight save and the skin switch; - the two early returns in renderSubagentWindowContent that protected a terminal which could not exist. Subagent windows render their activity list exactly as before, and a teammate still gets its name and badge from the agent description. The server side is untouched: TeamWatcher still holds respawn back while teammates are active, and the teammate-pane routes remain. Tests and docs that described "Agent Teams panes" now name what a font or skin change really reaches: the main terminal, the tiles and the split pane. Co-Authored-By: Claude Fable 5.2 --- docs/architecture-invariants.md | 6 +- src/web/CLAUDE.md | 2 +- src/web/public/app.js | 4 - src/web/public/panels-ui.js | 162 +---------------------------- src/web/public/subagent-windows.js | 118 +-------------------- src/web/public/terminal-ui.js | 27 +---- test/operation-lightspeed.test.ts | 1 - test/skin-themes.test.ts | 4 - test/terminal-font-weight.test.ts | 34 +----- 9 files changed, 14 insertions(+), 344 deletions(-) diff --git a/docs/architecture-invariants.md b/docs/architecture-invariants.md index 679a32af..e17a089b 100644 --- a/docs/architecture-invariants.md +++ b/docs/architecture-invariants.md @@ -1123,7 +1123,7 @@ Tests: `test/tab-rail-search.test.ts` (gate) and `test/tab-rail-search.browser.t **Adding a skin means touching four places, and each one fails silently on its own**: (1) the `html[data-skin="…"]` token block in `styles.css`; (2) the xterm ANSI palette in `CODEMAN_XTERM_THEMES` (terminal-ui.js) — a missing entry falls back to `daylight-blue`, so the terminal simply stays the wrong color; (3) the pre-paint allowlist array in `index.html` — a skin missing there is coerced to `daylight-blue` on every reload, which reads as "my theme keeps resetting"; (4) the `` popups, date pickers and scrollbars as dark widgets on a light page. xterm `minimumContrastRatio: 4.5` (set at construction in terminal-ui.js **and** panels-ui.js for teammate terminals, and re-applied in `applyTerminalSkin()`), because CLIs emit colors chosen for dark backgrounds; dark skins keep `1` to avoid the per-cell contrast work. And `applyTerminalSkin()` must call `this._localEchoOverlay?.refreshFont()` — the zero-lag overlay **caches** the terminal fg/bg at construction, so without the refresh typed-but-not-yet-flushed text keeps the previous theme's dark backing after a live skin switch. +**Light skins carry three extra obligations.** `color-scheme: light` on the `html[data-skin]` block, or the UA renders native `