From 96f89718a7ceec8b3aea9d764a5f5cc1501420e3 Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Mon, 5 Oct 2026 01:57:25 +0200 Subject: [PATCH] feat(tabs,header): group tabs by state and add header stats styles (#426) Two directions from Discussion #426, each a per-device setting and the new default. Tab Grouping (tabGrouping: 'state' | 'none', default 'state', option C): tabs are grouped needs you (red, plus failed sessions), waiting (yellow), working and idle (also ended, exited panes and web tabs), most urgent on top. The desktop header strip draws a row per group with its label and count in a left gutter; the flat vertical rail and the sidebar draw a section per group; tablets keep their scrolling row with inline dividers; phones keep the chip row in group order without headings. Classification is the home screens' own (_mobileOverviewState/_mobileOverviewExit), the fold into four groups is pure in CodemanTabTriage (constants.js). It is flex `order` plus aria-hidden heading/break elements reconciled in place after both render paths, never a DOM reorder, so Alt+N, the keyboard walk and drag keep reading tab order; a drop is refused across groups. Named groups in the vertical rail take precedence. Header Stats Style (headerStatsStyle: 'classic' | 'compact' | 'tiles', default 'tiles', option G): tiles give WS, CPU, MEM and each plan window a label-over-value tile with a bar underneath; compact is one WS/CPU/MEM pill with sparklines plus a plan-ring pill; classic is the header as before. Desktop only (classic below 768px and in solo windows). The clustered styles move #connectionIndicator into #headerSystemStats and #planUsageChip after it, and classic moves them back to comment anchors; WS stays out of a hidden System Stats pill. The extra parts are always rendered and hidden by default in CSS, so classic is unchanged. Tests: test/tab-triage.test.ts, test/header-stats-style.test.ts; three source pins in test/tab-rail-order.test.ts follow renamed lines. Co-Authored-By: Claude Opus 5.5 (1M context) --- CLAUDE.md | 4 + docs/architecture-invariants.md | 18 ++ docs/wiki/Settings-Reference.md | 6 +- docs/wiki/The-Dashboard.md | 42 +++- src/web/public/app.js | 212 ++++++++++++++++- src/web/public/constants.js | 123 ++++++++++ src/web/public/i18n.js | 1 + src/web/public/index.html | 29 ++- src/web/public/mobile.css | 8 + src/web/public/panels-ui.js | 26 +++ src/web/public/settings-ui.js | 84 ++++++- src/web/public/styles.css | 370 ++++++++++++++++++++++++++++++ src/web/schemas.ts | 16 ++ test/header-stats-style.test.ts | 219 ++++++++++++++++++ test/tab-rail-order.test.ts | 21 +- test/tab-triage.test.ts | 390 ++++++++++++++++++++++++++++++++ 16 files changed, 1543 insertions(+), 26 deletions(-) create mode 100644 test/header-stats-style.test.ts create mode 100644 test/tab-triage.test.ts diff --git a/CLAUDE.md b/CLAUDE.md index 1ab43603..eb30b5ff 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -330,6 +330,10 @@ 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 `