hyperhive/frontend/packages/dashboard/src/logs.css
iris c8ed190ccc fix(logs): log output scrolls internally instead of scrolling the page
Closes #2720 (partial — logs scroll fix).

Make body.logs-shell a full-viewport flex column so the visible .logs-pane
fills the remaining height and .journal-output (already flex:1 overflow:auto)
scrolls its content. Also handle the AUDIT tab's <div> output the same way.
The tab bar and toolbar stay anchored at the top; only the log text scrolls.
2026-07-26 17:20:48 +02:00

266 lines
6.9 KiB
CSS

/* ─── /logs.html — log viewer ──────────────────────────────────────
Same minimal-chrome pattern as /flow.html but with a sub-tab strip
instead of a full dashboard tabbar. */
body.logs-shell {
margin: 0;
padding: 0;
/* Full-viewport flex column so the log pane can scroll internally
instead of the whole page scrolling. The sticky-top wrapper and
page-header shrink to their natural height; .logs-main takes the
rest and each visible .logs-pane fills it. */
height: 100dvh;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* Base tab styling now lives in @hive/shared/tabs.css (.hive-tab*). The
logs strip only adds a layout delta: fill the header row next to the
← home back-link. `min-width: 0` lets this flex:1 nav shrink below its
intrinsic content width instead of being bumped onto its own row under
the back-link (the `.page-header` is explicitly nowrap; see chrome.css). */
.logs-tabbar {
flex: 1;
min-width: 0;
}
.logs-main {
padding: 1.2em 1.5em 0;
flex: 1 1 0;
min-height: 0;
display: flex;
flex-direction: column;
}
.logs-pane[hidden] { display: none; }
.logs-pane {
flex: 1 1 0;
min-height: 0;
display: flex;
flex-direction: column;
padding-bottom: 1.2em;
}
/* The AUDIT tab uses a <div> for its list instead of a <pre>, so give
it the same flex-grow + internal scroll that .journal-output already has. */
#audit-list {
flex: 1 1 0;
min-height: 0;
overflow-y: auto;
}
.logs-toolbar {
display: flex;
gap: 0.6em;
align-items: center;
margin-bottom: 0.9em;
flex-wrap: wrap;
}
/* ─── per-container journald + build-log viewers ──────────────────
Both open inside the logs page: a toolbar above a scrollable
output area. `.journal-*` classes power the agent and system log
tabs; `.build-logs-*` power the build tab. */
.journal-controls {
flex: 0 0 auto;
display: flex;
gap: 0.5em;
align-items: center;
}
.journal-unit {
font-family: inherit;
font-size: 0.9em;
background: var(--bg-elev);
color: var(--fg);
border: 1px solid var(--border);
padding: 0.2em 0.4em;
}
.logs-toolbar .journal-unit {
background: var(--border);
border-color: var(--purple-dim);
border-radius: 4px;
padding: 0.25em 0.5em;
font-size: 0.85em;
}
.journal-refresh { font-size: 0.75em; padding: 0.15em 0.5em; }
/* "fetched N ago" chip next to the refresh button on AGENT + SYSTEM tabs. */
.logs-fetch-ts { font-size: 0.8em; color: var(--muted); }
.journal-output {
margin: 0;
background: var(--crust);
color: var(--fg);
border: 1px solid var(--purple-dim);
padding: 0.5em 0.7em;
flex: 1 1 0;
min-height: 0;
overflow: auto;
font-size: 0.85em;
line-height: 1.4;
white-space: pre;
word-break: normal;
}
/* ─── build-log list ──────────────────────────────────────────────
Build tab: toolbar above a scrollable list of log header rows;
clicking a row expands full stdout+stderr inline. */
.build-logs-panel {
display: flex;
flex-direction: column;
height: 100%;
gap: 0.4em;
}
.build-logs-toolbar {
flex: 0 0 auto;
display: flex;
gap: 0.5em;
align-items: center;
}
.build-logs-refresh { font-size: 0.75em; padding: 0.15em 0.5em; }
.build-logs-list {
list-style: none;
padding: 0;
margin: 0;
overflow-y: auto;
flex: 1 1 0;
min-height: 0;
}
.build-logs-loading,
.build-logs-empty,
.build-logs-error {
color: var(--muted);
font-size: 0.85em;
padding: 0.3em 0;
}
.build-logs-error { color: var(--red); }
.build-logs-item {
border-bottom: 1px solid var(--border);
padding: 0.15em 0;
}
.build-logs-row-btn {
display: flex;
flex-wrap: wrap;
gap: 0.4em;
align-items: baseline;
width: 100%;
background: none;
border: none;
color: var(--fg);
font-family: inherit;
font-size: 0.85em;
text-align: left;
padding: 0.25em 0.4em;
cursor: pointer;
border-radius: 3px;
}
.build-logs-row-btn:hover { background: var(--bg-elev); }
.build-logs-kind { font-weight: 600; }
.build-logs-age { font-size: 0.88em; }
.build-logs-cmdline {
color: var(--muted);
font-size: 0.82em;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 40em;
}
.build-logs-detail { padding: 0 0.4em 0.4em; }
.build-logs-output {
margin: 0.3em 0 0;
padding: 0.4em 0.6em;
background: var(--crust);
color: var(--fg);
border: 1px solid var(--purple-dim);
font-size: 0.82em;
line-height: 1.4;
white-space: pre-wrap;
word-break: break-word;
overflow-x: auto;
max-height: 30em;
overflow-y: auto;
}
.build-logs-dl {
color: var(--muted);
font-size: 0.8em;
text-decoration: none;
border: 1px solid var(--purple-dim);
padding: 0.1em 0.4em;
border-radius: 2px;
margin-top: 0.3em;
display: none;
}
.build-logs-dl:not([hidden]) { display: inline-block; }
.build-logs-dl:hover { color: var(--fg); border-color: var(--purple-dim); }
.build-logs-live-badge { margin-bottom: 0.4em; }
@keyframes live-pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.45; }
}
.build-logs-live-badge.badge-running { animation: live-pulse 1.4s ease-in-out infinite; }
.build-logs-runtime { font-size: 0.85em; color: var(--muted); }
/* ─── AUDIT tab — privileged-actions audit trail table ──────────────── */
.audit-filter {
flex: 1 1 18em;
min-width: 0;
padding: 0.35em 0.6em;
background: var(--bg-elev);
color: var(--fg);
border: 1px solid var(--border);
border-radius: 4px;
font-family: inherit;
font-size: 0.9em;
}
.audit-table-wrap { overflow-x: auto; }
.audit-table {
width: 100%;
border-collapse: collapse;
font-size: 0.88em;
}
.audit-table th,
.audit-table td {
text-align: left;
padding: 0.4em 0.7em;
border-bottom: 1px solid var(--border);
vertical-align: top;
}
.audit-table th {
color: var(--muted);
font-weight: bold;
text-transform: uppercase;
letter-spacing: 0.06em;
font-size: 0.82em;
white-space: nowrap;
}
.audit-table tbody tr:hover {
background: color-mix(in srgb, var(--bg-elev) 45%, transparent);
}
.audit-when, .audit-when-th { white-space: nowrap; }
.audit-agent { font-weight: bold; white-space: nowrap; }
.audit-action { font-family: monospace; white-space: nowrap; }
.audit-target { white-space: nowrap; }
.audit-detail { word-break: break-word; }
.audit-outcome-th, .audit-outcome-td { white-space: nowrap; }
.audit-outcome {
display: inline-block;
padding: 0 0.5em;
border-radius: 999px;
font-size: 0.82em;
font-weight: bold;
white-space: nowrap;
}
.audit-outcome-ok {
background: color-mix(in srgb, var(--green) 22%, transparent);
color: var(--green);
}
.audit-outcome-err {
background: color-mix(in srgb, var(--red) 22%, transparent);
color: var(--red);
}
.audit-outcome-denied {
background: color-mix(in srgb, var(--yellow) 22%, transparent);
color: var(--yellow);
}