refactor(frontend): extract the page-chrome into @hive/shared (#1464 step 3)

The standalone pages (/flow, /logs, /stats, /settings) all share the same
sticky back-link header, but its CSS lived in the dashboard's common.css
under the misnomer `.logs-*` (the comment even noted it was used by more
than logs). Promote it to a first-class shared component.

- new @hive/shared/chrome.css with neutral `.page-header` / `.page-back` /
  `.page-title` (cohering with the `.page-content` gutter wrapper);
  exported from the shared package and @imported into common.css next to
  base/terminal/tabs.css.
- rename the four pages' header markup `.logs-*` → `.page-*`.
- drop the old `.logs-*` chrome block from common.css; refresh the stale
  doc comments in settings.css / stats.css / dashboard.css.

CSS-only, behaviour/visual-neutral (same rules, new names + home). The
dashboard keeps its own richer sticky `.dashboard-chrome`; unifying the
per-agent UI's `.stats-nav` chrome is a larger follow-up, deferred.

Part of #1464 step 3.
This commit is contained in:
iris 2026-06-09 09:13:35 +02:00
commit 49a0a0d15f
10 changed files with 71 additions and 51 deletions

View file

@ -3,6 +3,7 @@
@import "@hive/shared/base.css";
@import "@hive/shared/terminal.css";
@import "@hive/shared/tabs.css";
@import "@hive/shared/chrome.css";
/* global typography
Element-level rules shared across all three pages (index, flow,
@ -220,38 +221,9 @@ code {
color: var(--fg);
}
/* page chrome: header + back link (flow + logs pages)
.logs-header / .logs-back / .logs-title are used by both
/flow.html and /logs.html the same frosted sticky bar pattern. */
.logs-header {
position: sticky;
top: 0;
z-index: 25;
background: color-mix(in srgb, var(--bg) 92%, transparent);
-webkit-backdrop-filter: blur(8px) saturate(120%);
backdrop-filter: blur(8px) saturate(120%);
border-bottom: 1px solid var(--purple-dim);
display: flex;
align-items: center;
gap: 1.5em;
padding: 0.5em 1.5em;
}
.logs-back {
color: var(--purple);
text-decoration: none;
font-size: 0.88em;
white-space: nowrap;
flex: none;
}
.logs-back:hover { text-decoration: underline; }
.logs-title {
color: var(--subtext0);
font-size: 0.85em;
letter-spacing: 0.05em;
flex: none;
}
/* page chrome (.page-header / .page-back / .page-title the standalone
pages' sticky back-link bar) moved to @hive/shared/chrome.css, imported
at the top of this file. */
/* operator inbox + message rows
.inbox and .msg-* are rendered by common.js (renderInbox) and

View file

@ -32,9 +32,10 @@ body.dashboard-shell {
margin: 0 0 1em;
}
/* home back-link to the H0M3 hub. Small purple link top-left of the
chrome, mirroring the .logs-back treatment the sub-pages use so the
navigation reads consistently. Full chrome unification (a shared,
reusable tab/back-link component) is a later step. */
chrome, mirroring the .page-back treatment the standalone pages use
(now shared from @hive/shared/chrome.css) so the navigation reads
consistently. The dashboard keeps this richer sticky chrome of its
own rather than folding into the simple page header. */
.dash-home-back {
display: inline-block;
color: var(--purple);

View file

@ -16,9 +16,9 @@
No full tabbar — the flow page is a dedicated full-viewport
terminal surface; navigating back to the menu is the only chrome
needed. Pages link back to H0M3, not the dashboard. -->
<header class="logs-header">
<a class="logs-back" href="/">← home</a>
<span class="logs-title">FL0W</span>
<header class="page-header">
<a class="page-back" href="/">← home</a>
<span class="page-title">FL0W</span>
<select id="flow-agent-filter" class="flow-filter" title="filter timeline by agent" aria-label="filter timeline by agent">
<option value="">all agents</option>
</select>

View file

@ -15,8 +15,8 @@
<!-- Minimal chrome: back link + sub-tab strip.
Same pattern as flow.html — no full dashboard tabbar. Back link
points to the H0M3 hub (served at /), not the dashboard. -->
<header class="logs-header">
<a class="logs-back" href="/">← home</a>
<header class="page-header">
<a class="page-back" href="/">← home</a>
<nav class="hive-tabbar logs-tabbar" id="logs-tabbar" role="tablist">
<a class="hive-tab" id="logs-tab-build" href="#build" role="tab"
aria-controls="logs-pane-build" data-tab="build">

View file

@ -1,9 +1,9 @@
/* /settings.html operator-local preferences
Extracted from the dashboard S3TT1NGS tab. Same
minimal-chrome pattern as /flow.html and /logs.html: the back-link
header + title (.logs-header / .logs-back / .logs-title) live in
common.css; only the page body padding + the notif-toggle row are
page-specific and live here. */
header + title (.page-header / .page-back / .page-title) live in
@hive/shared/chrome.css; only the page body padding + the notif-toggle
row are page-specific and live here. */
body.settings-shell {
margin: 0;

View file

@ -15,9 +15,9 @@
<!-- Minimal chrome: back link + title. Same pattern as flow.html /
logs.html — no full dashboard tabbar. Back link points to the
H0M3 hub (served at /), not the dashboard. -->
<header class="logs-header">
<a class="logs-back" href="/">← home</a>
<span class="logs-title">S3TT1NGS</span>
<header class="page-header">
<a class="page-back" href="/">← home</a>
<span class="page-title">S3TT1NGS</span>
</header>
<main class="settings-main">

View file

@ -1,7 +1,8 @@
/* /stats.html hive-wide turn-stats rollup
Extracted from the dashboard ST4TS tab. Same minimal-
chrome pattern as /flow.html and /logs.html: the back-link header +
title (.logs-header / .logs-back / .logs-title) live in common.css.
title (.page-header / .page-back / .page-title) live in
@hive/shared/chrome.css.
`.hive-stats-table` also lives in common.css it's shared with the
dashboard SYST3M C0NT41N3R L04D table. Only the ST4TS-specific
window selector, summary chips, and bars are page-specific. */

View file

@ -15,9 +15,9 @@
<!-- Minimal chrome: back link + title. Same pattern as flow.html /
logs.html — no full dashboard tabbar. Back link points to the
H0M3 hub (served at /), not the dashboard. -->
<header class="logs-header">
<a class="logs-back" href="/">← home</a>
<span class="logs-title">ST4TS</span>
<header class="page-header">
<a class="page-back" href="/">← home</a>
<span class="page-title">ST4TS</span>
</header>
<main class="stats-main">

View file

@ -13,7 +13,8 @@
"./colors.css": "./src/colors.css",
"./theme.css": "./src/theme.css",
"./base.css": "./src/base.css",
"./terminal.css": "./src/terminal.css"
"./terminal.css": "./src/terminal.css",
"./chrome.css": "./src/chrome.css"
},
"files": [
"src/"

View file

@ -0,0 +1,45 @@
/* page chrome: back-link header
The minimal sticky "frosted bar" header used by every standalone page
reached from the H0M3 hub /flow, /logs, /stats, /settings. A back
link to H0M3 on the left, then either a page title or (on /logs) a
createTabStrip sub-tab nav. The operator dashboard uses its own richer
sticky chrome (`.dashboard-chrome`); these classes cover the simple
pages.
Shared across packages via @hive/shared so a new page only links the
stylesheet + writes the three-element header markup:
<header class="page-header">
<a class="page-back" href="/"> home</a>
<span class="page-title">TITLE</span>
</header>
*/
.page-header {
position: sticky;
top: 0;
z-index: 25;
background: color-mix(in srgb, var(--bg) 92%, transparent);
-webkit-backdrop-filter: blur(8px) saturate(120%);
backdrop-filter: blur(8px) saturate(120%);
border-bottom: 1px solid var(--purple-dim);
display: flex;
align-items: center;
gap: 1.5em;
padding: 0.5em 1.5em;
}
.page-back {
color: var(--purple);
text-decoration: none;
font-size: 0.88em;
white-space: nowrap;
flex: none;
}
.page-back:hover { text-decoration: underline; }
.page-title {
color: var(--subtext0);
font-size: 0.85em;
letter-spacing: 0.05em;
flex: none;
}