refactor(frontend): migrate agent stat-window selector to createTabStrip (#1464 step 1)

Replaces the agent stats page's bespoke window-tab click handler with the
shared createTabStrip (@hive/shared/tabs.js). The selector is now
hash-routed — #1h / #24h / … become deep-linkable and survive
back/forward navigation.

- window buttons use data-tab (was data-w); the strip resolves them by
  that convention and toggles .hive-tab--active + aria-selected.
- onShow(w) sets currentWindow + reloads stats; the strip's initial show
  fires it once, so the explicit loadStats() in DOMContentLoaded is
  dropped (avoids a double fetch).
- the selector keeps its distinct pill look — agent.css now targets
  .window-tabs button.hive-tab--active (was .active), not the shared
  .hive-tab text-tab base. It's a pure data-selector with no panes;
  createTabStrip skips the absent [data-tab-pane] gracefully.

Behaviour-preserving; aria-selected is now standardised on the buttons.
This commit is contained in:
iris 2026-06-08 22:32:17 +02:00 committed by mara
commit 0680f87d3d
3 changed files with 20 additions and 21 deletions

View file

@ -1000,7 +1000,10 @@ pre.diff {
font-family: inherit;
cursor: pointer;
}
.window-tabs button.active {
/* Active window: createTabStrip (@hive/shared/tabs.js) toggles
`.hive-tab--active`. The window selector keeps its own pill look rather
than the shared `.hive-tab` text-tab base. */
.window-tabs button.hive-tab--active {
background: var(--purple-dim);
border-color: var(--purple);
color: var(--purple);