Compare commits

..
Author SHA1 Message Date
Codeman maintainer 79f444a2fc fix(tabs): keep the working spinner on a ledger cell
The ledger layout hid every .tab-status to swap the dot for its coloured
bar. The bar is green for idle and working alike, and the spinner is the
dot's own .tab-status.busy::after ring, so a working session showed no
mark at all. A busy cell now keeps the dot and its ring, idle cells stay
bar-only, and an exited agent's cell still hides it like the classic strip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 09:46:23 +01:00
11 changed files with 55 additions and 216 deletions

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"aicodeman": patch
---
The Ledger tab layout shows the spinning ring on a working session again. The ledger swaps the status dot for a coloured bar, and that bar is green for idle and working alike, so hiding the dot also hid the only sign that a session was busy. A working cell now keeps the dot and its ring, the same mark the classic strip draws; idle cells stay bar-only, and an exited agent's cell still shows no ring.
+1 -1
View File
@@ -158,7 +158,7 @@ Codeman is a Claude Code session manager with web interface and autonomous Ralph
**Workspace-trust dialog auto-accept** (`session-trust-dialog.ts`, pure): Claude Code's per-directory trust dialog is always answered yes, or the session is stuck. ⚠️ Match the compacted SCREEN (`compactScreenText()`, all whitespace removed), never the stream (tmux sends words joined by cursor-forwards, not spaces). ⚠️ Never answer with a blind `\r` (newer versions highlight "No, exit" first): `trustDialogNextKey()` returns ONE key per re-read frame (arrow, then Enter only once `❯` is on the trust option), and the LAST marked option wins. ⚠️ All three guards must hold: startup window `TRUST_DIALOG_WINDOW_MS` (90s), two-marker match (`isTrustDialogScreen`), attempt cap `TRUST_DIALOG_MAX_ATTEMPTS` (6). ⚠️ Read `capturePaneText()`; only a direct-PTY session falls back to a SHORT buffer tail. ⚠️ The scan must schedule its own next read (`_trustDialogTimer`, cleared in `_clearAllTimers()`), not rely on PTY output, and a throttled read is DEFERRED onto that timer, never dropped (the dialog's paint is often the pane's last output); a stopped session never scans. → [architecture-invariants#workspace-trust-dialog-auto-accept](docs/architecture-invariants.md#workspace-trust-dialog-auto-accept) **Workspace-trust dialog auto-accept** (`session-trust-dialog.ts`, pure): Claude Code's per-directory trust dialog is always answered yes, or the session is stuck. ⚠️ Match the compacted SCREEN (`compactScreenText()`, all whitespace removed), never the stream (tmux sends words joined by cursor-forwards, not spaces). ⚠️ Never answer with a blind `\r` (newer versions highlight "No, exit" first): `trustDialogNextKey()` returns ONE key per re-read frame (arrow, then Enter only once `❯` is on the trust option), and the LAST marked option wins. ⚠️ All three guards must hold: startup window `TRUST_DIALOG_WINDOW_MS` (90s), two-marker match (`isTrustDialogScreen`), attempt cap `TRUST_DIALOG_MAX_ATTEMPTS` (6). ⚠️ Read `capturePaneText()`; only a direct-PTY session falls back to a SHORT buffer tail. ⚠️ The scan must schedule its own next read (`_trustDialogTimer`, cleared in `_clearAllTimers()`), not rely on PTY output, and a throttled read is DEFERRED onto that timer, never dropped (the dialog's paint is often the pane's last output); a stopped session never scans. → [architecture-invariants#workspace-trust-dialog-auto-accept](docs/architecture-invariants.md#workspace-trust-dialog-auto-accept)
**Process-tree walks are bounded** (`proc-tree.ts`, pure): `collectDescendants(pid, byParent)` is the ONE descendant traversal, fed by one cached `ps -eo pid=,ppid=` snapshot (`refreshProcSnapshot()` in tmux-manager.ts: async, in-flight-shared, and ANY error discards the result rather than caching a truncated `ps`). ⚠️ Never walk a process tree with per-node `pgrep` or unbounded recursion (the unbounded version took a machine down): the walk must terminate on cycles, cap depth (`PROC_WALK_MAX_DEPTH`) and node count (`PROC_WALK_MAX_NODES`), and never spawn anything. ⚠️ Keep it in its own module so the test exercises the shipped code, and report truncation through `onTruncated` naming both caps, never silently. ⚠️ **A kill never takes pid 0 or 1** (`isSignalablePid()`): the children of pid 0 are the whole machine, and tmux really answers 0 for an empty pane (`split-window ''`), which the pane list at server start records as `session.pid`; a close then signalled every process of the account. `killSession` signals only through `signalProcess()`, walks nothing for such a pid and leaves the close to `tmux kill-session`. Never call `process.kill` in tmux-manager.ts with a signal anywhere else, and never drive a real `killSession` from a script: stub `process.kill` in vitest (`test/kill-pid-guard.test.ts`). → [architecture-invariants#process-tree-walks-are-bounded](docs/architecture-invariants.md#process-tree-walks-are-bounded) **Process-tree walks are bounded** (`proc-tree.ts`, pure): `collectDescendants(pid, byParent)` is the ONE descendant traversal, fed by one cached `ps -eo pid=,ppid=` snapshot (`refreshProcSnapshot()` in tmux-manager.ts: async, in-flight-shared, and ANY error discards the result rather than caching a truncated `ps`). ⚠️ Never walk a process tree with per-node `pgrep` or unbounded recursion (the unbounded version took a machine down): the walk must terminate on cycles, cap depth (`PROC_WALK_MAX_DEPTH`) and node count (`PROC_WALK_MAX_NODES`), and never spawn anything. ⚠️ Keep it in its own module so the test exercises the shipped code, and report truncation through `onTruncated` naming both caps, never silently. → [architecture-invariants#process-tree-walks-are-bounded](docs/architecture-invariants.md#process-tree-walks-are-bounded)
**A `persistent: false` chokidar watcher stops on its first error**: ⚠️ its `'error'` handler goes through `closeWatcherOnError()` (`utils/close-watcher-on-error.ts`), never a bare log or `close()`. chokidar 3 retries a failed `fs.watch` (EMFILE once the inotify instances are used up, ENOSPC once the watches are) on the parent directory up to `/` forever, logging every pass (one server wrote 174 GiB of log that way); a bare `close()` turns the follow-up TypeError into an unhandled rejection, and a callback already in flight can reopen it through `add()`. The watcher's own poll must cover what it watched and create it again on a later tick (`TeamWatcher`, `WorkflowRunWatcher`): chokidar 3 reports a one-off ENOENT race (a new file gone between its `stat` and `watch`) through the same TypeError, so a watcher that stayed closed would end live updates until a restart. Tests: `test/watcher-fs-watch-failure.test.ts`. **A `persistent: false` chokidar watcher stops on its first error**: ⚠️ its `'error'` handler goes through `closeWatcherOnError()` (`utils/close-watcher-on-error.ts`), never a bare log or `close()`. chokidar 3 retries a failed `fs.watch` (EMFILE once the inotify instances are used up, ENOSPC once the watches are) on the parent directory up to `/` forever, logging every pass (one server wrote 174 GiB of log that way); a bare `close()` turns the follow-up TypeError into an unhandled rejection, and a callback already in flight can reopen it through `add()`. The watcher's own poll must cover what it watched and create it again on a later tick (`TeamWatcher`, `WorkflowRunWatcher`): chokidar 3 reports a one-off ENOENT race (a new file gone between its `stat` and `watch`) through the same TypeError, so a watcher that stayed closed would end live updates until a restart. Tests: `test/watcher-fs-watch-failure.test.ts`.
+1 -3
View File
@@ -1211,7 +1211,7 @@ Tests: `test/terminal-touch-tap.test.ts`, `test/session-swipe-gesture.test.ts` (
⚠️ **The boxes ARE a DOM grouping**, unlike by state, which is safe only because a tab changes case far less often than it changes state: `_tabClusterLayout().key` is the whole structure, and the incremental path rebuilds whenever it differs from the last full render's. The keyboard walk keeps boxes together (box index first, then computed order, since a sorted rail orders rows inside each box). Drag only reorders inside one box, as it only reorders inside one state group (`_isTabDropAcrossGroups()`). ⚠️ **The boxes ARE a DOM grouping**, unlike by state, which is safe only because a tab changes case far less often than it changes state: `_tabClusterLayout().key` is the whole structure, and the incremental path rebuilds whenever it differs from the last full render's. The keyboard walk keeps boxes together (box index first, then computed order, since a sorted rail orders rows inside each box). Drag only reorders inside one box, as it only reorders inside one state group (`_isTabDropAcrossGroups()`).
**Ledger.** CSS only, on `.tabs-ledger` inside `@media (min-width: 768px)` and the header host: the flat list on an auto-fill column grid with equal cells, mono type and a 3px status bar (`--ledger-bar`: yellow for a waiting alert, red for an action alert or an error, muted for stopped, exited and web tabs) instead of the dot. ⚠️ It must not change the markup (pinned: the ledger's innerHTML equals classic's); the rail, the sidebar and narrower strips show the plain list. **Ledger.** CSS only, on `.tabs-ledger` inside `@media (min-width: 768px)` and the header host: the flat list on an auto-fill column grid with equal cells, mono type and a 3px status bar (`--ledger-bar`: yellow for a waiting alert, red for an action alert or an error, muted for stopped, exited and web tabs) instead of the dot. ⚠️ A WORKING cell keeps the dot (`.tab-status:not(.busy)` is what is hidden): the bar is green for idle and working alike, and the spinner is the dot's own `.tab-status.busy::after` ring, so hiding every dot left a busy session with no mark (pinned by `test/tab-clusters.test.ts`); an exited agent's cell hides it, as the classic strip hides the ring there. ⚠️ It must not change the markup (pinned: the ledger's innerHTML equals classic's); the rail, the sidebar and narrower strips show the plain list.
**Classic, wrapped: the L-shaped strip.** Once a classic desktop strip in the header host wraps (`tabs-auto-wrap`, or the manual `tabs-two-rows`), `_syncTabStripCorner()` (app.js) adds `.tabs-corner`: `#headerRight` goes `position: absolute` over the strip's top-right corner and the strip runs the header's full width, so only the row(s) beside the toolbar stop short of it and every later row uses the width under it. A flex line cannot be shortened on its own, so in that state the strip is `display: block` with `inline-flex` tabs flowing around a `::before` float sized from the toolbar's box (`--tab-corner-width` / `--tab-corner-height`); the old `row-gap` (lineage's `--lineage-row-gap` included) becomes the tabs' bottom margin and the bottom padding shrinks by the same amount, so row spacing and lineage routing room are unchanged. ⚠️ `updateTabOverflowMode()` removes `.tabs-corner` BEFORE it measures the wrap (the corner takes the toolbar out of the header's flow, which widens the strip), so the wrap is still judged against the one-row layout and an unwrapped strip looks exactly as before. ⚠️ Flex-only rules do not apply to the strip in that state. ⚠️ A strip that already scrolls (past `--tab-strip-max-height`) keeps the plain wrap, checked on the plain strip before the class goes on: the float scrolls with the tabs while the toolbar stays put, and toggling the class on a scrolled strip lets scroll anchoring move it; a strip pushed past the max-height by the float itself falls back too. A first tab too wide for the room beside the toolbar (the whole first line would drop below it) is trimmed to the room instead (`tab-corner-fit`, `max-width: var(--tab-corner-first-max)`, its name ellipsized): a selected tab is wider (gear and close show), so a fallback here made the whole layout follow the selection. Only a room under `TAB_CORNER_MIN_FIRST_TAB` keeps the plain wrap. ⚠️ The cap goes on the first tab on every pass, never only once it measures too wide: `selectSession()` widens a newly selected tab at once and this sync is debounced, so a cap set afterwards leaves the first row below the toolbar until it runs. It changes nothing on a tab narrower than the room. A `ResizeObserver` on the toolbar re-decides wrap and corner and redraws the connection lines when a reading or the header divider resizes it without a tab render. Scope: classic arrangement, desktop, header host only; state/case/ledger, the sidebar and the vertical rail never get the class (`applySessionListLayout()` drops it when the strip moves). Tests: `test/tab-strip-corner.browser.test.ts` (browser suite). **Classic, wrapped: the L-shaped strip.** Once a classic desktop strip in the header host wraps (`tabs-auto-wrap`, or the manual `tabs-two-rows`), `_syncTabStripCorner()` (app.js) adds `.tabs-corner`: `#headerRight` goes `position: absolute` over the strip's top-right corner and the strip runs the header's full width, so only the row(s) beside the toolbar stop short of it and every later row uses the width under it. A flex line cannot be shortened on its own, so in that state the strip is `display: block` with `inline-flex` tabs flowing around a `::before` float sized from the toolbar's box (`--tab-corner-width` / `--tab-corner-height`); the old `row-gap` (lineage's `--lineage-row-gap` included) becomes the tabs' bottom margin and the bottom padding shrinks by the same amount, so row spacing and lineage routing room are unchanged. ⚠️ `updateTabOverflowMode()` removes `.tabs-corner` BEFORE it measures the wrap (the corner takes the toolbar out of the header's flow, which widens the strip), so the wrap is still judged against the one-row layout and an unwrapped strip looks exactly as before. ⚠️ Flex-only rules do not apply to the strip in that state. ⚠️ A strip that already scrolls (past `--tab-strip-max-height`) keeps the plain wrap, checked on the plain strip before the class goes on: the float scrolls with the tabs while the toolbar stays put, and toggling the class on a scrolled strip lets scroll anchoring move it; a strip pushed past the max-height by the float itself falls back too. A first tab too wide for the room beside the toolbar (the whole first line would drop below it) is trimmed to the room instead (`tab-corner-fit`, `max-width: var(--tab-corner-first-max)`, its name ellipsized): a selected tab is wider (gear and close show), so a fallback here made the whole layout follow the selection. Only a room under `TAB_CORNER_MIN_FIRST_TAB` keeps the plain wrap. ⚠️ The cap goes on the first tab on every pass, never only once it measures too wide: `selectSession()` widens a newly selected tab at once and this sync is debounced, so a cap set afterwards leaves the first row below the toolbar until it runs. It changes nothing on a tab narrower than the room. A `ResizeObserver` on the toolbar re-decides wrap and corner and redraws the connection lines when a reading or the header divider resizes it without a tab render. Scope: classic arrangement, desktop, header host only; state/case/ledger, the sidebar and the vertical rail never get the class (`applySessionListLayout()` drops it when the strip moves). Tests: `test/tab-strip-corner.browser.test.ts` (browser suite).
@@ -1385,8 +1385,6 @@ Target: 20 sessions, 50 agent windows at 60fps. Limits in `src/config/`: termina
⚠️ Truncation is reported through `onTruncated` rather than silently, with BOTH caps named: a silent depth cap hides a deep tree exactly as effectively as a silent node cap hides a wide one. ⚠️ Truncation is reported through `onTruncated` rather than silently, with BOTH caps named: a silent depth cap hides a deep tree exactly as effectively as a silent node cap hides a wide one.
⚠️ **A kill never takes pid 0 or 1** (2026-11-25). A bound limits how MUCH a walk collects, not what it is a walk of: the children of pid 0 are init and everything below it, so `killSession()` with pid 0 signalled every process of the account, which took down every session, tmux itself and the systemd user manager (the machine did not reboot, and with the manager gone the server did not come back until the next login). It was reached by a script that drove the real `killSession()` on an empty pane lookup (`Number('')` is 0), but it needs no script. tmux answers `0` for `#{pane_pid}` of a pane without a process (`split-window ''`; measured on 3.4), `parsePaneRows()` keeps that row, and `reconcileSessions()` at server start writes it to `session.pid`, where the last pane of a session wins. The next close read 0 from tmux, fell back to the record, found 0 there too, and walked it. Reproduced on master with the signals logged instead of sent, inside a PID namespace: "Killing session codeman-feed1234 (PID 0)", "Found 15 child processes to kill". So 0 is an ordinary answer and means "nothing to signal". Three layers, all pinned in `test/kill-pid-guard.test.ts`: `killSession()` decides once (`isSignalablePid()`, an integer above 1) and otherwise leaves the close to `tmux kill-session`; `getChildPidsFresh()` walks nothing for such a root; and `signalProcess()`, the only place in `tmux-manager.ts` that sends a signal, refuses it for the group form as well (`kill(-1)` is every process, `kill(0)` is our own group). `collectDescendants()` itself stays a plain walk. A recorded 0 is deliberately left on the record rather than replaced by the older pid: that pid belongs to a process that may have exited since and been reused.
## Local packages and build artifacts ## Local packages and build artifacts
### xterm-zerolag-input is single-source ### xterm-zerolag-input is single-source
+1 -1
View File
@@ -43,7 +43,7 @@ per device, so a sidebar on your desktop does not force one onto your phone.
| ---------------------- | ------------------------------------------------------------------------------------ | | ---------------------- | ------------------------------------------------------------------------------------ |
| **By state** | Groups the tabs by what each session needs from you (below). | | **By state** | Groups the tabs by what each session needs from you (below). |
| **By case** | One box per case, labelled with the case and its tab count. Inside a box, `w75-api-gateway` reads just `w75`. A case with one tab gets a box with a colour swatch. | | **By case** | One box per case, labelled with the case and its tab count. Inside a box, `w75-api-gateway` reads just `w75`. A case with one tab gets a box with a colour swatch. |
| **Ledger** | The same list on an aligned column grid: equal cells, monospace names, a coloured bar on the left of each cell instead of the dot (yellow waiting, red needs you). Desktop header only. | | **Ledger** | The same list on an aligned column grid: equal cells, monospace names, a coloured bar on the left of each cell instead of the dot (yellow waiting, red needs you); a working session keeps its spinning ring. Desktop header only. |
| **Classic** (default) | The single list in tab order, as before. | | **Classic** (default) | The single list in tab order, as before. |
**By state** groups the tabs like this, most urgent on top: **By state** groups the tabs like this, most urgent on top:
-17
View File
@@ -32,23 +32,6 @@ export const PROC_WALK_MAX_DEPTH = 10;
/** Hard ceiling on collected descendants. A backstop, not an expected limit. */ /** Hard ceiling on collected descendants. A backstop, not an expected limit. */
export const PROC_WALK_MAX_NODES = 500; export const PROC_WALK_MAX_NODES = 500;
/**
* Whether a session kill may signal `pid`, or walk the tree below it: a real process of
* the user's, so an integer above 1.
*
* On 2026-11-25 a kill that got pid 0 took down every process of the account: all of the
* user's sessions, tmux itself and the systemd user manager. The children of pid 0 are
* the whole machine, so the bounds above do not help (500 processes are most of one), and
* `kill(-1)` means every process one may signal while `kill(0)` means one's own group.
*
* tmux answers 0 for a pane with no process (`split-window ''`), and that 0 reaches the
* session record through the pane list read at server start. So 0 is an ordinary answer
* here, not a corrupt one, and it means "nothing to signal".
*/
export function isSignalablePid(pid: number | null | undefined): pid is number {
return typeof pid === 'number' && Number.isInteger(pid) && pid > 1;
}
export interface WalkOptions { export interface WalkOptions {
maxDepth?: number; maxDepth?: number;
maxNodes?: number; maxNodes?: number;
+10 -30
View File
@@ -22,7 +22,7 @@
*/ */
import { EventEmitter } from 'node:events'; import { EventEmitter } from 'node:events';
import { collectDescendants, descendantsInPaneGroup, isSignalablePid } from './proc-tree.js'; import { collectDescendants, descendantsInPaneGroup } from './proc-tree.js';
import { import {
foreignViewSessionName, foreignViewSessionName,
buildForeignDockerViewKillCommand, buildForeignDockerViewKillCommand,
@@ -3148,8 +3148,6 @@ export class TmuxManager extends EventEmitter implements TerminalMultiplexer {
* its process-group and tmux fallbacks. * its process-group and tmux fallbacks.
*/ */
private async getChildPidsFresh(pid: number): Promise<number[]> { private async getChildPidsFresh(pid: number): Promise<number[]> {
// The children of pid 0 or 1 are the whole machine (see isSignalablePid).
if (!isSignalablePid(pid)) return [];
let byParent: ReadonlyMap<number, readonly number[]>; let byParent: ReadonlyMap<number, readonly number[]>;
try { try {
byParent = await Promise.race([ byParent = await Promise.race([
@@ -3207,19 +3205,6 @@ export class TmuxManager extends EventEmitter implements TerminalMultiplexer {
} }
} }
/**
* The one way this class signals a process. Refuses what is not a session's process
* (see {@link isSignalablePid}); a negative `pid` is the process group, so it is judged
* by its absolute value and `-1` (everything) and `-0` (our own group) are refused too.
*/
private signalProcess(pid: number, signal: 'SIGTERM' | 'SIGKILL'): void {
if (!isSignalablePid(Math.abs(pid))) {
console.error(`[TmuxManager] Refusing to send ${signal} to pid ${pid}`);
return;
}
process.kill(pid, signal);
}
// Check if a process is still alive. Signal decisions only: an unreaped zombie // Check if a process is still alive. Signal decisions only: an unreaped zombie
// counts here, so its process group still gets the SIGKILL below. The WAITS use // counts here, so its process group still gets the SIGKILL below. The WAITS use
// waitForProcessesExit(), which counts a zombie as exited. // waitForProcessesExit(), which counts a zombie as exited.
@@ -3363,15 +3348,10 @@ export class TmuxManager extends EventEmitter implements TerminalMultiplexer {
// Get current PID (may have changed) // Get current PID (may have changed)
const currentPid = (await this.getPanePidAsync(session.muxName)) || session.pid; const currentPid = (await this.getPanePidAsync(session.muxName)) || session.pid;
// An empty pane has no process: tmux says 0, and so does the record once a server
// start has read it. Nothing is signalled then, and only tmux is asked to close it.
const hasProcess = isSignalablePid(currentPid);
console.log( console.log(`[TmuxManager] Killing session ${session.muxName} (PID ${currentPid})`);
`[TmuxManager] Killing session ${session.muxName} (${hasProcess ? `PID ${currentPid}` : `no process, pane pid ${currentPid}`})`
);
const allPids: number[] = hasProcess ? [currentPid] : []; const allPids: number[] = [currentPid];
// Strategy 1: Kill all child processes recursively (but never a shared daemon the // Strategy 1: Kill all child processes recursively (but never a shared daemon the
// pane's CLI started for every session of that CLI: see killableDescendants) // pane's CLI started for every session of that CLI: see killableDescendants)
@@ -3383,7 +3363,7 @@ export class TmuxManager extends EventEmitter implements TerminalMultiplexer {
for (const childPid of [...childPids].reverse()) { for (const childPid of [...childPids].reverse()) {
if (this.isProcessAlive(childPid)) { if (this.isProcessAlive(childPid)) {
try { try {
this.signalProcess(childPid, 'SIGTERM'); process.kill(childPid, 'SIGTERM');
} catch { } catch {
// Process may already be dead // Process may already be dead
} }
@@ -3398,7 +3378,7 @@ export class TmuxManager extends EventEmitter implements TerminalMultiplexer {
for (const childPid of childPids) { for (const childPid of childPids) {
if (this.isProcessAlive(childPid)) { if (this.isProcessAlive(childPid)) {
try { try {
this.signalProcess(childPid, 'SIGKILL'); process.kill(childPid, 'SIGKILL');
} catch { } catch {
// Process already terminated // Process already terminated
} }
@@ -3407,12 +3387,12 @@ export class TmuxManager extends EventEmitter implements TerminalMultiplexer {
} }
// Strategy 2: Kill the entire process group // Strategy 2: Kill the entire process group
if (hasProcess && this.isProcessAlive(currentPid)) { if (this.isProcessAlive(currentPid)) {
try { try {
this.signalProcess(-currentPid, 'SIGTERM'); process.kill(-currentPid, 'SIGTERM');
await waitForProcessesExit([currentPid], { timeoutMs: GRACEFUL_SHUTDOWN_WAIT_MS }); await waitForProcessesExit([currentPid], { timeoutMs: GRACEFUL_SHUTDOWN_WAIT_MS });
if (this.isProcessAlive(currentPid)) { if (this.isProcessAlive(currentPid)) {
this.signalProcess(-currentPid, 'SIGKILL'); process.kill(-currentPid, 'SIGKILL');
} }
} catch { } catch {
// Process group may not exist or already terminated // Process group may not exist or already terminated
@@ -3459,9 +3439,9 @@ export class TmuxManager extends EventEmitter implements TerminalMultiplexer {
} }
// Strategy 4: Direct kill by PID as final fallback // Strategy 4: Direct kill by PID as final fallback
if (hasProcess && this.isProcessAlive(currentPid)) { if (this.isProcessAlive(currentPid)) {
try { try {
this.signalProcess(currentPid, 'SIGKILL'); process.kill(currentPid, 'SIGKILL');
} catch { } catch {
// Already dead // Already dead
} }
+1 -1
View File
@@ -38,7 +38,7 @@ Frontend JS modules have `@fileoverview` with `@dependency`/`@loadorder` tags. L
**Session list layout: header strip or left sidebar** (`sessionListLayout`, default `header`; per-device via `displayKeys`, also in `SettingsUpdateSchema`): the list can move into a collapsible `<aside>` (Alt+B, `toggleSessionSidebar`) or, via `tabOrientation`, a resizable vertical `#tabRail` (desktop/tablet only). ⚠️ There is ONE `#sessionTabs`, MOVED between hosts, never a second list: `applySessionListLayout()` runs first, then `applyTabOrientation()`, both BEFORE `applyTabWrapSettings()`, and both arm/disarm `_startSidebarRichClock()`. ⚠️ Axis decisions use `_isVerticalTabList()`, never `isSessionSidebarActive()` alone. ⚠️ Rich rows share one gate, `isRichTabRows()`; rich CSS pairs sidebar+rail with comma-grouped selectors, never `:is()`, and card rules stay rail-scoped. ⚠️ Rail sort (`tabRailSort`, default `activity`) is the flex `order` property only, never a DOM reorder; the arrow-key walk and the phone swipe follow computed `order`. ⚠️ Leaving sidebar mode clears `_sidebarFilter`; the handheld overlay drawer is `inert` when closed, the docked rail never. ⚠️ The rail's **Search sessions** box (`setTabRailSearch`, in memory only) and the sidebar filter share ONE row filter, `_applyTabListFilter()` over the pure `CodemanTabSearch` (constants.js): classes only, never a reorder or layout write; the rail matches the name, the sidebar name + folder. ⚠️ A session row with a tab alert (`tabAlerts`, red or yellow) is never hidden by either box: it goes in as `keep: true`, counts toward its group (which stays on screen) but not toward `matchCount`. ⚠️ Escape in the rail box is claimed by the global capture-phase Escape branch (the box's own `onkeydown` runs after it, too late to stop `closeAllPanels()`), and a filter change that shows or hides anything redraws the connector lines, since a keystroke re-renders nothing; a floating window finds its parent tab only through `_paintedSessionTab()` (a hidden row's rect is all zero but truthy, which drew connectors from the viewport's corner). While it runs `_projectTabGroups()` projects every group open (a collapsed group's rows are not in the DOM) and `toggleTabGroupCollapsed()` refuses, leaving the stored collapse untouched; drag stays on during a search (owner decision), a drop landing between the visible neighbours; `applyTabOrientation()` clears it off the rail. Tests: `test/tab-rail-search.test.ts`, `test/tab-rail-search.browser.test.ts`. → [architecture-invariants#session-list-layout-header-strip-vs-left-sidebar](../../docs/architecture-invariants.md#session-list-layout-header-strip-vs-left-sidebar) **Session list layout: header strip or left sidebar** (`sessionListLayout`, default `header`; per-device via `displayKeys`, also in `SettingsUpdateSchema`): the list can move into a collapsible `<aside>` (Alt+B, `toggleSessionSidebar`) or, via `tabOrientation`, a resizable vertical `#tabRail` (desktop/tablet only). ⚠️ There is ONE `#sessionTabs`, MOVED between hosts, never a second list: `applySessionListLayout()` runs first, then `applyTabOrientation()`, both BEFORE `applyTabWrapSettings()`, and both arm/disarm `_startSidebarRichClock()`. ⚠️ Axis decisions use `_isVerticalTabList()`, never `isSessionSidebarActive()` alone. ⚠️ Rich rows share one gate, `isRichTabRows()`; rich CSS pairs sidebar+rail with comma-grouped selectors, never `:is()`, and card rules stay rail-scoped. ⚠️ Rail sort (`tabRailSort`, default `activity`) is the flex `order` property only, never a DOM reorder; the arrow-key walk and the phone swipe follow computed `order`. ⚠️ Leaving sidebar mode clears `_sidebarFilter`; the handheld overlay drawer is `inert` when closed, the docked rail never. ⚠️ The rail's **Search sessions** box (`setTabRailSearch`, in memory only) and the sidebar filter share ONE row filter, `_applyTabListFilter()` over the pure `CodemanTabSearch` (constants.js): classes only, never a reorder or layout write; the rail matches the name, the sidebar name + folder. ⚠️ A session row with a tab alert (`tabAlerts`, red or yellow) is never hidden by either box: it goes in as `keep: true`, counts toward its group (which stays on screen) but not toward `matchCount`. ⚠️ Escape in the rail box is claimed by the global capture-phase Escape branch (the box's own `onkeydown` runs after it, too late to stop `closeAllPanels()`), and a filter change that shows or hides anything redraws the connector lines, since a keystroke re-renders nothing; a floating window finds its parent tab only through `_paintedSessionTab()` (a hidden row's rect is all zero but truthy, which drew connectors from the viewport's corner). While it runs `_projectTabGroups()` projects every group open (a collapsed group's rows are not in the DOM) and `toggleTabGroupCollapsed()` refuses, leaving the stored collapse untouched; drag stays on during a search (owner decision), a drop landing between the visible neighbours; `applyTabOrientation()` clears it off the rail. Tests: `test/tab-rail-search.test.ts`, `test/tab-rail-search.browser.test.ts`. → [architecture-invariants#session-list-layout-header-strip-vs-left-sidebar](../../docs/architecture-invariants.md#session-list-layout-header-strip-vs-left-sidebar)
**Tab layouts** (`tabArrangement`, per-device, default `classic`; `state`/`case`/`ledger` are opt-in; Discussion #426): `state` (option C) splits the list into needs you / waiting / working / idle (idle is `quiet`: its heading stays as the row's anchor but draws no label; `tabStateOrder: 'urgent-last'` flips the order, needs you at the bottom): rows in the desktop header strip with left-aligned labels in a measured column (the brand sits over the strip's corner, so the rows after the first start under "Codeman"), sections in the flat rail and the sidebar, inline dividers on the tablet strip, group order with no headings on phones. `case` (option A) wraps each case's tabs in one `.tab-cluster` box and hides the `-<case>` of a generated name (`.tab-name-case`). `ledger` (option B) is a CSS-only grid on the desktop header strip. `classic` is the old strip; once it wraps on desktop it is L-shaped via `_syncTabStripCorner()` (the toolbar sits over its top-right corner and later rows run the full width under it, a strip already past its max-height keeps the plain wrap): ⚠️ `.tabs-corner` comes off before the wrap is measured, and the strip is `display: block` in that state, so flex-only rules do not apply to it there (`test/tab-strip-corner.browser.test.ts`). Pure cores: `CodemanTabTriage` and `CodemanTabClusters` (constants.js). ⚠️ `state` is the flex `order` property plus `aria-hidden` heading/break elements reconciled in place by `_syncTabTriageChrome()` after BOTH render paths, never a DOM reorder (a state change is an incremental pass). ⚠️ `case` boxes ARE a DOM grouping, so the incremental path rebuilds whenever `_tabClusterLayout().key` changes; membership follows `_mobileOverviewCaseFor()` like the home screens. ⚠️ Drag only reorders within a group or box (`_isTabDropAcrossGroups()`). ⚠️ Named groups in the vertical rail win over both groupings. ⚠️ `classic` must leave no trace (no headings, no inline order, no boxes, no name split), and the ledger must not change the markup. ⚠️ Grouping is a render layer: `sessionOrder`, Alt+[ / Alt+], Ctrl+Tab and Alt+1..9 keep the canonical order, and only the phone swipe walks the drawn order (`nextSession({ visual: true })` through `_stripSessionOrder()`, the same `_visibleTabRows()` walk the strip's arrow keys use); an active session the list does not draw steps in at the first or last row, and an empty drawn list goes nowhere rather than falling back to a hidden session (`test/session-swipe-gesture.test.ts`). Tests: `test/tab-triage.test.ts`, `test/tab-clusters.test.ts`. → [architecture-invariants#tab-layouts-by-state-by-case-ledger](../../docs/architecture-invariants.md#tab-layouts-by-state-by-case-ledger) **Tab layouts** (`tabArrangement`, per-device, default `classic`; `state`/`case`/`ledger` are opt-in; Discussion #426): `state` (option C) splits the list into needs you / waiting / working / idle (idle is `quiet`: its heading stays as the row's anchor but draws no label; `tabStateOrder: 'urgent-last'` flips the order, needs you at the bottom): rows in the desktop header strip with left-aligned labels in a measured column (the brand sits over the strip's corner, so the rows after the first start under "Codeman"), sections in the flat rail and the sidebar, inline dividers on the tablet strip, group order with no headings on phones. `case` (option A) wraps each case's tabs in one `.tab-cluster` box and hides the `-<case>` of a generated name (`.tab-name-case`). `ledger` (option B) is a CSS-only grid on the desktop header strip; its bar replaces the dot everywhere except a working cell, which keeps the dot and its spinning ring (the bar alone is green for idle and working alike). `classic` is the old strip; once it wraps on desktop it is L-shaped via `_syncTabStripCorner()` (the toolbar sits over its top-right corner and later rows run the full width under it, a strip already past its max-height keeps the plain wrap): ⚠️ `.tabs-corner` comes off before the wrap is measured, and the strip is `display: block` in that state, so flex-only rules do not apply to it there (`test/tab-strip-corner.browser.test.ts`). Pure cores: `CodemanTabTriage` and `CodemanTabClusters` (constants.js). ⚠️ `state` is the flex `order` property plus `aria-hidden` heading/break elements reconciled in place by `_syncTabTriageChrome()` after BOTH render paths, never a DOM reorder (a state change is an incremental pass). ⚠️ `case` boxes ARE a DOM grouping, so the incremental path rebuilds whenever `_tabClusterLayout().key` changes; membership follows `_mobileOverviewCaseFor()` like the home screens. ⚠️ Drag only reorders within a group or box (`_isTabDropAcrossGroups()`). ⚠️ Named groups in the vertical rail win over both groupings. ⚠️ `classic` must leave no trace (no headings, no inline order, no boxes, no name split), and the ledger must not change the markup. ⚠️ Grouping is a render layer: `sessionOrder`, Alt+[ / Alt+], Ctrl+Tab and Alt+1..9 keep the canonical order, and only the phone swipe walks the drawn order (`nextSession({ visual: true })` through `_stripSessionOrder()`, the same `_visibleTabRows()` walk the strip's arrow keys use); an active session the list does not draw steps in at the first or last row, and an empty drawn list goes nowhere rather than falling back to a hidden session (`test/session-swipe-gesture.test.ts`). Tests: `test/tab-triage.test.ts`, `test/tab-clusters.test.ts`. → [architecture-invariants#tab-layouts-by-state-by-case-ledger](../../docs/architecture-invariants.md#tab-layouts-by-state-by-case-ledger)
**Header stats styles** (`headerStatsStyle`, per-device, desktop only, default `compact`; Discussion #426 option G): `tiles` / `compact` (two pills, a ring beside every value) / `classic` (as before), keyed on `data-header-stats` (pre-paint + `applyHeaderStatsStyle()`), forced to `classic` below 768px and in a solo window. ⚠️ The clustered styles MOVE `#connectionIndicator` into `#headerSystemStats` and `#planUsageChip` right after it; `classic` moves them back to comment anchors. ⚠️ WS joins the pill only while System Stats is shown. ⚠️ The extra parts (stat rings, tile words, plan rings, meters) are always rendered and hidden by default in CSS, which is what keeps `classic` unchanged; tile words are derived beside the connection descriptor, never added to it (`test/connection-indicator.test.ts` pins its shape). ⚠️ A tile is a three-row grid (label, value, bar) with pixel line-heights and the bundled JetBrains Mono; never lay the bar over a fixed-height tile (a taller system mono put the value on top of it). The WS tile's grid lives on the inner `.connection-tile`, because JS writes the indicator's `display` inline. Tests: `test/header-stats-style.test.ts`. → [architecture-invariants#header-stats-styles](../../docs/architecture-invariants.md#header-stats-styles) **Header stats styles** (`headerStatsStyle`, per-device, desktop only, default `compact`; Discussion #426 option G): `tiles` / `compact` (two pills, a ring beside every value) / `classic` (as before), keyed on `data-header-stats` (pre-paint + `applyHeaderStatsStyle()`), forced to `classic` below 768px and in a solo window. ⚠️ The clustered styles MOVE `#connectionIndicator` into `#headerSystemStats` and `#planUsageChip` right after it; `classic` moves them back to comment anchors. ⚠️ WS joins the pill only while System Stats is shown. ⚠️ The extra parts (stat rings, tile words, plan rings, meters) are always rendered and hidden by default in CSS, which is what keeps `classic` unchanged; tile words are derived beside the connection descriptor, never added to it (`test/connection-indicator.test.ts` pins its shape). ⚠️ A tile is a three-row grid (label, value, bar) with pixel line-heights and the bundled JetBrains Mono; never lay the bar over a fixed-height tile (a taller system mono put the value on top of it). The WS tile's grid lives on the inner `.connection-tile`, because JS writes the indicator's `display` inline. Tests: `test/header-stats-style.test.ts`. → [architecture-invariants#header-stats-styles](../../docs/architecture-invariants.md#header-stats-styles)
+7 -1
View File
@@ -23615,7 +23615,13 @@ html[data-session-list='sidebar'][data-sidebar='collapsed'] .session-sidebar .ta
font-weight: 500; font-weight: 500;
} }
.session-tabs-host > .session-tabs.tabs-ledger > .session-tab .tab-status { /* The bar replaces the dot, except on a WORKING cell: the bar is green for
idle and working alike, so the dot and its orbiting ring
(.tab-status.busy::after) stay, the same "working" mark the classic strip
and the home screens draw. An exited agent's cell hides it anyway, as the
classic strip hides the ring there. */
.session-tabs-host > .session-tabs.tabs-ledger > .session-tab .tab-status:not(.busy),
.session-tabs-host > .session-tabs.tabs-ledger > .session-tab.tab-agent-exited .tab-status {
display: none; display: none;
} }
-143
View File
@@ -1,143 +0,0 @@
/**
* @fileoverview killSession() must never signal the machine.
*
* On 2026-11-25 a kill that got pid 0 took down every process of the account: every
* session, tmux and the systemd user manager. The children of pid 0 are the whole process
* table, so the descendant walk handed all of it to SIGTERM. tmux answers 0 for a pane
* with no process (`split-window ''`), the pane list read at server start records it on
* the session, and the next close of that tab killed everything.
*
* These drive the SHIPPED killSession() with the tmux and ps answers mocked and
* process.kill stubbed: nothing here may reach a real process.
*
* Port: N/A (no server needed)
*/
import { afterEach, beforeEach, describe, expect, it, vi, type MockInstance } from 'vitest';
import { exec, execFile, execSync } from 'node:child_process';
import { isSignalablePid } from '../src/proc-tree.js';
import type { MuxSession } from '../src/mux-interface.js';
vi.mock('node:child_process', async () => {
const actual = await vi.importActual('node:child_process');
return { ...actual, exec: vi.fn(), execFile: vi.fn(), execSync: vi.fn(), spawn: vi.fn() };
});
/** A machine: init, kthreadd, the user's own programs, and one agent (4242) with a child. */
const PS = ['1 0', '2 0', '900 1', '901 900', '902 900', '4242 901', '4243 4242'].join('\n') + '\n';
describe('isSignalablePid', () => {
it('admits only a process of the user', () => {
for (const pid of [2, 4242, 2 ** 22]) expect(isSignalablePid(pid)).toBe(true);
for (const pid of [1, 0, -0, -1, -4242, NaN, Infinity, 1.5, null, undefined]) {
expect(isSignalablePid(pid as number)).toBe(false);
}
});
});
describe('killSession and a pane without a process', () => {
let panePid: string;
let commands: string[];
let kill: MockInstance<typeof process.kill>;
let signals: [number, string | number | undefined][];
beforeEach(() => {
panePid = '4242\n';
commands = [];
signals = [];
vi.mocked(execSync).mockImplementation(((cmd: string) => {
if (cmd.includes('list-panes -a')) return `codeman-feed1234|${panePid.trim()}|0||\n`;
return '';
}) as unknown as typeof execSync);
vi.mocked(exec).mockImplementation(((cmd: string, options: unknown, maybeCallback?: unknown) => {
commands.push(cmd);
const callback = (typeof options === 'function' ? options : maybeCallback) as (e: null, out: object) => void;
const stdout = cmd.includes('display-message') ? panePid : '';
setImmediate(() => callback(null, { stdout, stderr: '' }));
return { on: vi.fn(), kill: vi.fn(), pid: 12345 };
}) as unknown as typeof exec);
// The process snapshot the descendant walk reads.
vi.mocked(execFile).mockImplementation(((file: string, _args: string[], _options: unknown, callback: unknown) => {
setImmediate(() => (callback as (e: null, out: string) => void)(null, file === 'ps' ? PS : ''));
return { on: vi.fn(), kill: vi.fn(), pid: 12345 };
}) as unknown as typeof execFile);
// Every process dies at its first real signal, so no wait runs its full length.
const gone = new Set<number>();
kill = vi.spyOn(process, 'kill').mockImplementation(((pid: number, signal?: string | number) => {
if (signal !== 0) {
signals.push([pid, signal]);
gone.add(Math.abs(pid));
} else if (gone.has(Math.abs(pid))) {
throw Object.assign(new Error('kill ESRCH'), { code: 'ESRCH' });
}
return true;
}) as typeof process.kill);
});
afterEach(() => {
kill.mockRestore();
vi.restoreAllMocks();
});
async function manager(recordedPid: number) {
const vitest = process.env.VITEST;
vi.resetModules();
delete process.env.VITEST;
const { TmuxManager } = await import('../src/tmux-manager.js');
process.env.VITEST = vitest;
const m = new TmuxManager();
m.registerSession({
sessionId: 'feed1234',
muxName: 'codeman-feed1234',
pid: recordedPid,
createdAt: Date.now(),
workingDir: '/tmp',
mode: 'claude',
attached: false,
} as MuxSession);
return m;
}
const closedByTmux = () => commands.some((c) => c.includes('kill-session -t "codeman-feed1234"'));
// The control: without it, a guard that refused every kill would pass the rest.
it('still signals the process tree of a real pane', async () => {
const m = await manager(4242);
expect(await m.killSession('feed1234')).toBe(true);
expect(signals).toContainEqual([4243, 'SIGTERM']);
expect(signals).toContainEqual([-4242, 'SIGTERM']);
expect(signals.every(([pid]) => [4242, 4243].includes(Math.abs(pid)))).toBe(true);
expect(closedByTmux()).toBe(true);
m.destroy();
});
for (const pid of [0, 1]) {
it(`signals nothing for pid ${pid}, and tmux still closes the session`, async () => {
panePid = `${pid}\n`;
const m = await manager(pid);
expect(await m.killSession('feed1234')).toBe(true);
expect(signals).toEqual([]);
expect(closedByTmux()).toBe(true);
expect(m.getSession('feed1234')).toBeUndefined();
m.destroy();
});
}
it('signals nothing when tmux gives no answer and the record holds 0', async () => {
panePid = '\n';
const m = await manager(0);
expect(await m.killSession('feed1234')).toBe(true);
expect(signals).toEqual([]);
expect(closedByTmux()).toBe(true);
m.destroy();
});
it('survives the real route: the pane list at server start records 0, then the tab is closed', async () => {
panePid = '0\n';
const m = await manager(4242);
await m.reconcileSessions();
expect(m.getSession('feed1234')?.pid).toBe(0); // what master did next was walk it
expect(await m.killSession('feed1234')).toBe(true);
expect(signals).toEqual([]);
expect(closedByTmux()).toBe(true);
m.destroy();
});
});
+6 -19
View File
@@ -146,14 +146,11 @@ describe('collectDescendants', () => {
* even with both caps bypassed. * even with both caps bypassed.
*/ */
describe('TmuxManager uses the bounded walk', () => { describe('TmuxManager uses the bounded walk', () => {
/** A pane's pid. Never 0 or 1: the kill path walks nothing for those (kill-pid-guard.test.ts). */ /** Build a tree `width` wide and `depth` deep, rooted at 1. */
const ROOT = 1000;
/** Build a tree `width` wide and `depth` deep, rooted at ROOT. */
function bigTree(width: number, depth: number): Map<number, number[]> { function bigTree(width: number, depth: number): Map<number, number[]> {
const t = new Map<number, number[]>(); const t = new Map<number, number[]>();
let next = ROOT + 1; let next = 2;
let frontier = [ROOT]; let frontier = [1];
for (let d = 0; d < depth; d += 1) { for (let d = 0; d < depth; d += 1) {
const nf: number[] = []; const nf: number[] = [];
for (const p of frontier) { for (const p of frontier) {
@@ -166,7 +163,7 @@ describe('TmuxManager uses the bounded walk', () => {
return t; return t;
} }
async function walkVia(fixture: Map<number, number[]>, root = ROOT): Promise<number[]> { async function walkVia(fixture: Map<number, number[]>): Promise<number[]> {
const { TmuxManager } = await import('../src/tmux-manager.js'); const { TmuxManager } = await import('../src/tmux-manager.js');
const Klass = TmuxManager as unknown as { const Klass = TmuxManager as unknown as {
refreshProcSnapshot(): Promise<Map<number, number[]>>; refreshProcSnapshot(): Promise<Map<number, number[]>>;
@@ -177,7 +174,7 @@ describe('TmuxManager uses the bounded walk', () => {
Klass.procSnapshot = { at: Date.now(), byParent: fixture }; Klass.procSnapshot = { at: Date.now(), byParent: fixture };
try { try {
const mgr = new TmuxManager(); const mgr = new TmuxManager();
return await (mgr as unknown as { getChildPidsFresh(pid: number): Promise<number[]> }).getChildPidsFresh(root); return await (mgr as unknown as { getChildPidsFresh(pid: number): Promise<number[]> }).getChildPidsFresh(1);
} finally { } finally {
Klass.refreshProcSnapshot = original; Klass.refreshProcSnapshot = original;
Klass.procSnapshot = null; Klass.procSnapshot = null;
@@ -193,7 +190,7 @@ describe('TmuxManager uses the bounded walk', () => {
it('honours the depth cap on a deep chain', async () => { it('honours the depth cap on a deep chain', async () => {
const chainTree = new Map<number, number[]>(); const chainTree = new Map<number, number[]>();
for (let i = ROOT; i < ROOT + 39; i += 1) chainTree.set(i, [i + 1]); for (let i = 1; i < 40; i += 1) chainTree.set(i, [i + 1]);
const out = await walkVia(chainTree); const out = await walkVia(chainTree);
@@ -206,16 +203,6 @@ describe('TmuxManager uses the bounded walk', () => {
const out = await walkVia(bigTree(4, 6)); const out = await walkVia(bigTree(4, 6));
expect(out.length).toBeLessThanOrEqual(PROC_WALK_MAX_NODES); expect(out.length).toBeLessThanOrEqual(PROC_WALK_MAX_NODES);
}); });
it.each([0, 1])('walks nothing below pid %i, whose children are the whole machine', async (root) => {
const machine = new Map([
[0, [1, 2]],
[1, [900]],
[900, [901]],
]);
expect(await walkVia(machine, root)).toEqual([]);
expect(await walkVia(machine, 900)).toEqual([901]);
});
}); });
describe('descendantsInPaneGroup (a shared daemon outlives the pane that started it)', () => { describe('descendantsInPaneGroup (a shared daemon outlives the pane that started it)', () => {
+23
View File
@@ -345,6 +345,29 @@ describe('tab layouts by case and ledger (static)', () => {
); );
}); });
it('keeps the working spinner on a ledger cell', () => {
// The bar replaces the status dot, but it is green for idle and working
// alike, and the spinner is the dot's own ::after ring: hiding every dot
// left a working session with no mark at all.
const hides: string[] = [];
postcss.parse(css).walkAtRules('media', (media: AtRule) => {
if (media.params !== '(min-width: 768px)') return;
media.walkRules((rule: Rule) => {
if (!rule.selector.includes('.tabs-ledger')) return;
if (!rule.nodes.some((n) => n.type === 'decl' && n.prop === 'display' && n.value === 'none')) return;
hides.push(...rule.selectors.filter((s) => s.includes('.tab-status')));
});
});
expect(hides.length).toBeGreaterThan(0);
for (const selector of hides) {
// Each one either spares a busy dot or is the exited-agent cell, whose
// ring the classic strip hides too.
expect(selector.endsWith('.tab-status:not(.busy)') || selector.includes('.tab-agent-exited')).toBe(true);
}
// The ring the cell keeps is the shared one every strip draws.
expect(css).toMatch(/\.session-tab \.tab-status\.busy::after \{[^}]*animation: tab-load-spin/);
});
it('dissolves the boxes into the one chip row on phones', () => { it('dissolves the boxes into the one chip row on phones', () => {
expect(mobileCss).toMatch( expect(mobileCss).toMatch(
/:where\(\.header\) \.session-tabs-host > \.session-tabs\.tabs-clusters > \.tab-cluster \{\s*display: contents;/ /:where\(\.header\) \.session-tabs-host > \.session-tabs\.tabs-clusters > \.tab-cluster \{\s*display: contents;/