The header bar, the nav row with its sliding underline, the settings menu slot, the skip link and the content column move out of the swarm UI's Shell into a router-free AppShell in @hive/shared, with their CSS. It takes the brand, the nav items, the current location and the link component, plus slots for extra tabs, settings entries and menus. The swarm UI's Shell keeps what is its own on top of it: the open agent-terminal tabs (their CSS moves to DynamicTabs.css), the swarm's settings, links and user menus, the swarm name and the full-bleed routes. No visible change; this is the base for the hive UI to reuse the same chrome.
258 lines
8.3 KiB
CSS
258 lines
8.3 KiB
CSS
/* <AppShell> — header bar + nav row + the content column every route
|
|
renders into. Colour vars come from @hive/shared's theme.css, the base16
|
|
slots every hyperhive UI uses.
|
|
|
|
`flex-wrap` on the header and nav rather than a hamburger/collapse
|
|
menu: a narrow viewport (phone or a tiled desktop window) wraps onto
|
|
a second line instead of overflowing — "don't break, don't
|
|
over-invest" is the explicit scope here, not full mobile navigation
|
|
redesign.
|
|
|
|
Page-switch animation (see AppShell.tsx's file-top comment for the JS
|
|
half): both the nav indicator's slide and the page-body pop follow
|
|
the same three-rule motion-guard shape `@hive/shared/motion-apply.js`'s
|
|
own doc comment specifies — a base rule,
|
|
`@media (prefers-reduced-motion: reduce)` to respect the OS default,
|
|
`:root[data-motion='reduce']` as the explicit override (same
|
|
specificity as the media rule, so source order after it wins), then
|
|
`:root[data-motion='allow']` last to re-enable despite an OS-level
|
|
reduce preference. */
|
|
/* Sticky + frosted glass (mara: "sticky header bar ... frosted glass")
|
|
— same `color-mix` + `backdrop-filter` recipe `.terminal-wrap`/
|
|
`.ui-badge` (@hive/shared) already use, dark-only same as those (a
|
|
light bg behind glass washes out; `--glass-clear` in theme.css).
|
|
`z-index` keeps it above `.shell-body` once content scrolls underneath. */
|
|
.shell-header {
|
|
display: flex;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
gap: 1.5em;
|
|
padding: 0.75em 1.25em;
|
|
border-bottom: 1px solid var(--border);
|
|
background: color-mix(
|
|
in srgb,
|
|
var(--bg-elev) calc(100% - 20% * var(--glass-clear)),
|
|
transparent
|
|
);
|
|
-webkit-backdrop-filter: var(--glass-filter);
|
|
backdrop-filter: var(--glass-filter);
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 10;
|
|
}
|
|
/* The swarm name links to the start page; the link adds no look of its own,
|
|
so the brand's accent and glow (on the span inside) are all that show. */
|
|
.shell-brand-link {
|
|
color: inherit;
|
|
text-decoration: none;
|
|
}
|
|
.shell-brand {
|
|
font-weight: 600;
|
|
/* Base colour only — AppShell.tsx overrides it inline to the same
|
|
currently-active-tab accent `.shell-nav-indicator` uses (falling
|
|
back to this `--purple` before the first measurement lands, which
|
|
is also the "hives" default route's own accent, so there's no
|
|
visible mismatch at first paint). Transition lives here, same
|
|
140ms hop cadence + the same three-rule motion guard as the
|
|
indicator, so this and the indicator read as one thing changing,
|
|
not two independently-synced ones. */
|
|
color: var(--purple);
|
|
letter-spacing: 0.02em;
|
|
transition: color 140ms ease;
|
|
}
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.shell-brand {
|
|
transition: none;
|
|
}
|
|
}
|
|
:root[data-motion="reduce"] .shell-brand {
|
|
transition: none;
|
|
}
|
|
:root[data-motion="allow"] .shell-brand {
|
|
transition: color 140ms ease;
|
|
}
|
|
.shell-nav {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 1em;
|
|
position: relative; /* anchor for .shell-nav-indicator */
|
|
}
|
|
/* A narrow screen (40em, the one width breakpoint the swarm UI has): the brand
|
|
and the header's menus share the first row, and the nav takes the second as
|
|
one row that scrolls sideways, instead of wrapping into two or three rows
|
|
that cover a third of a phone. */
|
|
@media (max-width: 40em) {
|
|
.shell-header {
|
|
gap: 0.25em 0.75em;
|
|
padding: 0.5em 0.75em;
|
|
}
|
|
.shell-header-actions {
|
|
order: 1;
|
|
}
|
|
.shell-nav {
|
|
order: 2;
|
|
flex: 1 0 100%;
|
|
flex-wrap: nowrap;
|
|
overflow-x: auto;
|
|
scrollbar-width: none;
|
|
}
|
|
.shell-nav::-webkit-scrollbar {
|
|
display: none;
|
|
}
|
|
.shell-nav-link,
|
|
.shell-tabs {
|
|
flex: none;
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
/* Holds `SettingsMenu` + `LinksMenu` — one `margin-left: auto` on the
|
|
wrapper, not one on each child (see AppShell.tsx's comment for why two
|
|
adjacent auto margins don't sit flush together). */
|
|
.shell-header-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.25em;
|
|
margin-left: auto;
|
|
}
|
|
/* Touch target and active-state underline are deliberately on two
|
|
different elements. An earlier version put both `min-height: 2.75em`
|
|
and `border-bottom` on the same box: centering the text within a
|
|
2.75em box pushes a bottom-edge border ~0.7em away from the text,
|
|
which argus caught by actually rendering it — a real visual
|
|
regression, not just a touch-target win. So: `.shell-nav-link` (the
|
|
`<a>`) owns the full-height tappable box (same 2.75em / ~44px WCAG
|
|
2.5.5 floor as the rest of the shared kit — this is the primary nav,
|
|
the single most-clicked/tapped element in the whole shell), and
|
|
`.shell-nav-link-text` (an inner span hugging just the text) owns
|
|
the underline, so the indicator stays directly under the label
|
|
regardless of how tall the tappable box around it is. */
|
|
.shell-nav-link {
|
|
display: flex;
|
|
align-items: center;
|
|
min-height: 2.75em;
|
|
color: var(--muted);
|
|
text-decoration: none;
|
|
}
|
|
.shell-nav-link:hover {
|
|
color: var(--fg);
|
|
}
|
|
.shell-nav-link-text {
|
|
padding-bottom: 0.25em; /* gap between the text and .shell-nav-indicator below it */
|
|
}
|
|
.shell-nav-link-active {
|
|
color: var(--fg);
|
|
}
|
|
/* Shared underline, one element instead of one border-bottom per link
|
|
— see AppShell.tsx's file-top comment. `left`/`top`/`width` are set
|
|
inline per-render from a real measurement; only the *transition*
|
|
between those values lives here. 140ms matches AppShell.tsx's `HOP_MS`
|
|
exactly, so one hop's CSS transition finishes right as the next
|
|
hop's JS-driven style update lands, instead of the two blending into
|
|
an averaged easing curve. */
|
|
.shell-nav-indicator {
|
|
position: absolute;
|
|
height: 2px;
|
|
border-radius: 1px;
|
|
transition:
|
|
left 140ms ease,
|
|
top 140ms ease,
|
|
width 140ms ease,
|
|
background-color 140ms ease;
|
|
}
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.shell-nav-indicator {
|
|
transition: none;
|
|
}
|
|
}
|
|
:root[data-motion="reduce"] .shell-nav-indicator {
|
|
transition: none;
|
|
}
|
|
:root[data-motion="allow"] .shell-nav-indicator {
|
|
transition:
|
|
left 140ms ease,
|
|
top 140ms ease,
|
|
width 140ms ease,
|
|
background-color 140ms ease;
|
|
}
|
|
/* Suppresses the transition for exactly one render — the indicator's
|
|
very first real position, so it snaps into place instead of visibly
|
|
growing from the unmounted `left:0/width:0/transparent` fallback (see
|
|
AppShell.tsx's `indicatorSettledOnce`). Two-class selector so it wins
|
|
over the plain `.shell-nav-indicator` rule above without `!important`,
|
|
same reasoning `:root[data-motion='reduce']`'s extra attribute
|
|
selector already relies on. */
|
|
.shell-nav-indicator.shell-nav-indicator-instant {
|
|
transition: none;
|
|
}
|
|
/* A skip link, drawn only while it has the keyboard focus. */
|
|
.shell-skip-link {
|
|
position: absolute;
|
|
left: 0.5em;
|
|
top: -4em;
|
|
z-index: 100;
|
|
padding: 0.5em 1em;
|
|
border-radius: 0.3em;
|
|
background: var(--bg-elev);
|
|
color: var(--fg);
|
|
border: 1px solid var(--purple);
|
|
}
|
|
.shell-skip-link:focus {
|
|
top: 0.5em;
|
|
}
|
|
/* The page container takes the focus when a page opens, and is not a control. */
|
|
.shell-body:focus {
|
|
outline: none;
|
|
}
|
|
|
|
/* One width for every tab's contents: 90em still centers with visible margins
|
|
on a typical desktop viewport; it isn't full-bleed. */
|
|
.shell-body {
|
|
max-width: 90em;
|
|
margin: 0 auto;
|
|
padding: 1.5em 1.25em;
|
|
/* Plain fade, deliberately — mara's call on review: a scale+overshoot
|
|
"pop" (this rule's first cut) read as too much for a first pass.
|
|
Keeping it simple leaves room to make this fancier later without
|
|
having shipped something to walk back first. */
|
|
animation: shell-page-enter 160ms ease;
|
|
}
|
|
/* Full-bleed route (the agent terminal): the shell becomes a viewport-high
|
|
column, the header keeps its natural height, and the body takes every
|
|
remaining pixel with no width cap or padding. `100dvh`, not `100vh` —
|
|
`vh` includes mobile browser chrome that is on screen. */
|
|
.shell-full {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100dvh;
|
|
}
|
|
.shell-full .shell-header {
|
|
flex-shrink: 0;
|
|
}
|
|
.shell-body-full {
|
|
flex: 1;
|
|
min-height: 0;
|
|
max-width: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
@keyframes shell-page-enter {
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.shell-body {
|
|
animation: none;
|
|
}
|
|
}
|
|
:root[data-motion="reduce"] .shell-body {
|
|
animation: none;
|
|
}
|
|
:root[data-motion="allow"] .shell-body {
|
|
animation: shell-page-enter 160ms ease;
|
|
}
|