Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/frontend/packages/dashboard/src/dashboard.css
iris c205c6115b frontend: one scale for z-index, corner radius and the floating-box shadow
z-index ran through eleven values (1 to 1100), border-radius through about
twenty and floating boxes had six different shadows, with no names, so each new
box picked its own. theme.css now defines --z-bar, --z-popover, --z-skip,
--z-modal, --z-toast, --radius-sm, --radius-md, --radius-pill and --shadow-pop,
and every stylesheet and the toast host use them. Corners and shadows move by
a pixel or two at most; the stacking order is unchanged. css-vars.md lists them.
2026-11-25 21:29:08 +01:00

559 lines
14 KiB
CSS

/* Dashboard-specific styles. common.css must be loaded first —
it defines the CSS custom properties, typography, and shared
component rules that this file depends on. */
@import "@hive/shared/jobq-rollup.css";
@import "@hive/shared/jobq-graph.css";
@import "@hive/shared/user-menu.css";
@import "@hive/shared/links-menu.css";
@import "@hive/shared/app-shell.css";
@import "@hive/shared/icon-button.css";
@import "@hive/shared/settings-menu.css";
@import "@hive/shared/solid-backgrounds.css";
/* ─── the dashboard page ───────────────────────────────────────────
The chrome (header, nav, settings) is `@hive/shared`'s AppShell, drawn by
shell.js; SSE stays alive across tab switches. See
docs/4-implementation/web-ui/dashboard.md::Chrome header + Tab strip. */
body.dashboard-shell {
/* Full-bleed body (no horizontal gutter). The 1.5em side gutter lives
in the shell's content column, so the footer spans the full width
edge-to-edge with no negative-margin breakout. `padding-bottom`
keeps a little breathing room above the viewport edge (overridden to
clear the selection bar via `.has-selection` below). No max-width cap
— wide screens use the full width rather than empty side margins. */
margin: 0;
padding-bottom: 1.5em;
}
.banner-thin {
text-align: center;
margin: 0;
padding: 0 1em;
font-size: 0.78em;
color: var(--purple-dim);
letter-spacing: 0.15em;
white-space: pre;
overflow: hidden;
text-overflow: ellipsis;
}
/* Tab pane visibility: shell.js sets the `hidden` attribute on every pane but
the one the URL hash names. */
.tab-pane[hidden] {
display: none;
}
.banner {
text-align: center;
margin: 0 0 1em 0;
font-size: 0.95em;
overflow-x: auto;
background: linear-gradient(
90deg,
var(--purple-dim) 0%,
var(--purple) 50%,
var(--purple-dim) 100%
);
background-size: 200% 100%;
background-position: 50% 0;
-webkit-background-clip: text;
background-clip: text;
color: transparent;
filter: drop-shadow(
0 0 6px color-mix(in srgb, var(--purple) 45%, transparent)
);
}
.banner.active {
animation: banner-shimmer 1.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
.banner.active {
animation: none;
}
}
:root[data-motion="reduce"] .banner.active {
animation: none;
}
:root[data-motion="allow"] .banner.active {
animation: banner-shimmer 1.8s linear infinite;
}
@keyframes banner-shimmer {
from {
background-position: 200% 0;
}
to {
background-position: -100% 0;
}
}
.role {
display: inline-block;
margin-left: 0.4em;
padding: 0.05em 0.5em;
border: 1px solid;
border-radius: 2px;
font-size: 0.8em;
letter-spacing: 0.1em;
text-transform: uppercase;
}
/* Container rows: a full-height square agent icon on the left, the
identity / actions / drill-in lines stacked in the card body on the
right. Pending rows dim everything except the pending indicator. */
.containers {
display: flex;
flex-direction: column;
gap: 0.4em;
}
.container-row {
padding: 0.6em 0.8em;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: color-mix(in srgb, var(--bg-elev) 55%, transparent);
transition:
opacity 200ms ease,
border-color 200ms ease;
}
.container-row:not(.tombstone) {
display: flex;
align-items: flex-start;
gap: 0.7em;
}
.container-row:not(.tombstone) > .container-icon {
position: relative;
overflow: hidden;
flex: none;
width: 5em;
aspect-ratio: 1;
border-radius: var(--radius-md);
background-color: color-mix(in srgb, var(--crust) 60%, transparent);
cursor: pointer;
transition:
box-shadow 120ms ease,
transform 120ms ease;
}
.container-row:not(.tombstone) > .container-icon:hover {
box-shadow: 0 0 0 2px var(--purple);
}
.container-row:not(.tombstone) > .container-icon:focus-visible {
outline: 2px solid var(--purple);
outline-offset: 2px;
}
.container-row.selected {
border-color: var(--purple);
box-shadow: inset 0 0 0 1px var(--purple);
background: color-mix(in srgb, var(--purple) 6%, transparent);
}
.container-row.selected > .container-icon {
box-shadow:
0 0 0 2px var(--purple),
0 0 12px -4px var(--purple);
}
.container-row:not(.tombstone) > .container-icon > .container-icon-img {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: contain;
}
.container-row:not(.tombstone) > .container-icon.icon-unreachable {
filter: grayscale(1);
opacity: 0.4;
}
.container-row .card-body {
flex: 1;
min-width: 0;
}
/* ── per-agent three-dot context menu ─────────────────────────────────────
Positioned after .card-body in the flex row. `<hive-agent-menu>`
(agent-menu/hive-agent-menu.js) is a light-DOM element with no shadow
root of its own — the generic dropdown mechanics (shadow attach,
open/close, positioning) live in the shared `<hive-menu>` component
instead (@hive/shared/hive-menu.js), which slots this element's
trigger/content nodes into position rather than moving them into its
own shadow root. That keeps these nodes in the ordinary light DOM the
whole way down, so this ordinary global stylesheet reaches them
directly — see hive-agent-menu.js's header for the full reasoning.
`hive-agent-menu` itself just needs the flex/alignment role the old
light-DOM `.agent-menu` wrapper div played in this row; the
`position: relative` an absolutely-positioned dropdown needs now lives
on `<hive-menu>`'s own `:host` instead, since that's the element whose
shadow tree the dropdown is actually positioned within. */
hive-agent-menu {
flex: none;
align-self: flex-start;
margin-top: 0.3em;
}
/* .agent-menu-btn carries no styling of its own anymore — the trigger is
a top-level `slot="trigger"` node inside <hive-menu>'s shadow tree, so
its base icon-button chrome now lives in hive-menu.css's
`::slotted([slot='trigger'])` rules instead (reachable and genuinely
generic — any <hive-menu> trigger gets the same treatment). The class
itself stays, just as an identification hook (aria-label/title
already carry the real semantics). */
/* Box chrome (background/border/radius/shadow/min-width/white-space) now
lives on <hive-menu>'s own `.menu-dropdown` wrapper (shadow-DOM-owned
markup, no slotting constraint) — this is just the `<ul>`'s own
list-reset + item padding, which only the caller (owning the actual
list markup) can set. */
.agent-menu-dropdown {
list-style: none;
margin: 0;
padding: 0.3em 0;
}
.agent-menu-item {
display: block;
width: 100%;
background: none;
border: none;
color: var(--fg);
font-family: inherit;
font-size: 0.88em;
letter-spacing: 0.04em;
text-align: left;
padding: 0.4em 0.9em;
cursor: pointer;
text-decoration: none;
box-sizing: border-box;
}
.agent-menu-item:hover {
background: var(--border);
color: var(--purple);
}
.agent-menu-sep {
height: 1px;
background: var(--purple-dim);
margin: 0.3em 0;
padding: 0;
}
/* Hover reveal: `--menu-btn-opacity` is forced to 1 while a hover
selector (or the trigger's own open state, set by <hive-menu>) applies
— inherits down through `hive-agent-menu` → `<hive-menu>` → the
trigger button same as any custom property, shadow trees included. */
.container-row:hover hive-agent-menu {
--menu-btn-opacity: 1;
}
/* Card actions dim while a row has any pending-state badge (transient-
driven only now — see agents.js's pending-badge derivation comment;
there is no separate queued-but-not-running row state to tell apart
from this one anymore). */
.container-row.pending-running .actions {
opacity: 0.4;
pointer-events: none;
}
.container-row.pending-running {
border-color: var(--amber);
background: color-mix(in srgb, var(--amber) 5%, transparent);
}
@keyframes container-icon-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.container-row.pending-running > .container-icon::after {
content: "";
position: absolute;
inset: 0;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: var(--amber);
animation: container-icon-spin 0.9s linear infinite;
pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
.container-row.pending-running > .container-icon::after {
animation: none;
}
}
:root[data-motion="reduce"]
.container-row.pending-running
> .container-icon::after {
animation: none;
}
:root[data-motion="allow"]
.container-row.pending-running
> .container-icon::after {
animation: container-icon-spin 0.9s linear infinite;
}
.container-row .head {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 0.5em;
margin-bottom: 0.4em;
}
.container-row .head .name {
font-size: 1.05em;
font-weight: bold;
}
.container-row .head .meta {
margin-left: auto;
}
.container-row .head .nav-strip {
display: inline-flex;
align-items: center;
flex-wrap: wrap;
gap: 0.35em;
}
.nav-link {
color: var(--muted);
font-size: 0.95em;
line-height: 1;
padding: 0.15em 0.35em;
border-radius: 3px;
text-decoration: none;
transition:
background 0.12s ease,
color 0.12s ease;
}
.nav-link:hover {
background: color-mix(in srgb, var(--purple) 12%, transparent);
color: var(--cyan);
text-shadow: 0 0 6px color-mix(in srgb, var(--cyan) 50%, transparent);
}
.container-row .actions {
display: flex;
flex-wrap: wrap;
gap: 0.4em;
}
.container-row .actions form.inline {
display: inline-block;
margin: 0;
}
.agent-status {
font-size: 0.82em;
color: var(--subtext0);
padding: 0.1em 0.3em 0.25em;
/* Row layout: the message can wrap to two lines and clamp; the age
stamp is a non-shrinking sibling so it is always shown (it wraps to
the next line if there is no room, but is never clipped away). */
display: flex;
flex-wrap: wrap;
align-items: baseline;
column-gap: 0.3em;
}
.agent-status .status-msg {
flex: 0 1 auto;
min-width: 0;
/* Wrap to at most two lines, then ellipsize the overflow. */
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
line-clamp: 2;
overflow: hidden;
overflow-wrap: anywhere;
}
.agent-status .status-icon {
opacity: 0.65;
}
.agent-status .status-age {
flex: 0 0 auto;
opacity: 0.5;
font-size: 0.9em;
white-space: nowrap;
}
.container-row.tombstone {
border-style: dashed;
background: color-mix(in srgb, var(--bg-elev) 35%, transparent);
opacity: 0.85;
}
.container-row.tombstone .name {
color: var(--muted);
}
/* K3PT ST4T3 caveat and the port-collision banner both moved to the
shared <hive-warn> component — amber/no-pulse for
the standing caveat (a pulsing banner that's always present just
teaches you to stop seeing it), `severity="red" pulse` for the port
collision (an incident, not a caveat). See kept.js/agents.js and
hive-warn.css for the actual styling now. */
/* Build-queue summary banner on the 4G3NTS tab moved to the shared
`JobqRollup` Preact component (`.jqr-*` classes, imported above) —
mounted by agents.js::initJobqRollup into #jobq-rollup-section. */
.pending-state {
color: var(--amber);
font-size: 0.85em;
letter-spacing: 0.08em;
text-transform: uppercase;
text-shadow: 0 0 6px color-mix(in srgb, var(--amber) 55%, transparent);
animation: badge-pulse 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
.pending-state {
animation: none;
}
}
:root[data-motion="reduce"] .pending-state {
animation: none;
}
:root[data-motion="allow"] .pending-state {
animation: badge-pulse 1.6s ease-in-out infinite;
}
@keyframes badge-pulse {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.7;
}
}
/* Inline drill-in triggers (logs / config repo / view diff). */
.drill-ins {
display: flex;
flex-wrap: wrap;
gap: 0.15em 1.1em;
margin-top: 0.4em;
}
.drill-ins .panel-trigger {
margin-top: 0;
}
ul form.inline {
display: inline-block;
}
.role-pending {
color: var(--amber);
border-color: var(--amber);
}
.btn-inline {
font-family: inherit;
background: transparent;
cursor: pointer;
margin-left: 0.4em;
}
/* Off-palette warm-amber hover tint: not an exact theme var (brighter than
--amber), left as a literal pending a dedicated named var. */
.btn-inline:hover {
background: rgba(255, 184, 77, 0.1);
}
.kind {
display: inline-block;
margin-left: 0.4em;
padding: 0.05em 0.5em;
border: 1px solid var(--purple-dim);
color: var(--purple-dim);
border-radius: 2px;
font-size: 0.75em;
letter-spacing: 0.1em;
text-transform: uppercase;
}
details {
margin-top: 0.5em;
}
summary {
cursor: pointer;
color: var(--muted);
font-size: 0.85em;
text-transform: uppercase;
letter-spacing: 0.1em;
}
summary:hover {
color: var(--purple);
}
.diff {
background: var(--bg-elev);
border: 1px solid var(--border);
padding: 0.8em;
margin-top: 0.4em;
overflow-x: auto;
font-size: 0.85em;
line-height: 1.4;
color: var(--muted);
white-space: pre;
}
.diff span {
display: block;
}
.diff .diff-add {
color: var(--green);
}
.diff .diff-del {
color: var(--red);
}
.diff .diff-hunk {
color: var(--cyan);
}
.diff .diff-file {
color: var(--purple);
font-weight: bold;
}
.diff .diff-ctx {
color: var(--fg);
}
footer {
margin-top: 4em;
text-align: center;
color: var(--muted);
font-size: 0.9em;
}
footer a {
color: var(--purple);
}
footer .banner-thin {
margin-bottom: 0.8em;
}
/* Selection bar — sticky-bottom strip for bulk actions. */
.selection-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: var(--z-bar);
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 0.6em;
padding: 0.55em 1em;
background: color-mix(
in srgb,
var(--bg) calc(100% - 26% * var(--glass-clear)),
transparent
);
-webkit-backdrop-filter: var(--glass-filter);
backdrop-filter: var(--glass-filter);
border-top: 1px solid var(--purple);
box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.4);
}
.selection-bar[hidden] {
display: none;
}
.selection-count {
color: var(--purple);
font-weight: bold;
letter-spacing: 0.05em;
}
.selection-names {
color: var(--muted);
font-size: 0.85em;
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.selection-actions {
display: inline-flex;
flex-wrap: wrap;
gap: 0.4em;
align-items: center;
}
/* Pad the dashboard body so the sticky bar doesn't cover the
bottom of the agent list. Only applies when bar is visible. */
body.dashboard-shell.has-selection {
padding-bottom: 4.5em;
}