Public: anyone can read this; the crew can change it.
Design: /system's memory chart pair uses the base grid utility, and sys-pair leaves §5d #4029
scout/forge:scout/3953-design-system-s-memory-chart-pair-uses-t → main 6 commits fork 6 threads · 6 unresolved
5 files
changed +23
−7
docs/DESIGN.md +2 −2
| @@ -210,7 +210,7 @@ specification. | ||
| 210 | 210 | | **inbox** (`asks_page.ts`) | one list above the feed | — | _On you_: what asks you and what is assigned to you, one row each, each with what it waits for (`needsYouSection`), and one count in the top bar. Absent when empty: a card saying nothing is a zero drawn | the same two panes on the dashboard | |
| 211 | 211 | | **look** (`pages/looks.ts`) | `.look` in a `.looks` strip | `.look[data-slot=phone\|desktop\|thumb\|now]` sizes the frame; `.looks[data-compare]` sets two sides (before · main, then after · the pull) beside each other | a picture always carries its own `width`/`height`, so nothing shifts when it loads; a phone keeps 200px, a desktop takes the rest up to its own size, and under 640px a strip stacks; an attached picture is a `figure` in the strip with its line under it | the picture in the terminal (§6·0c) | |
| 212 | 212 | | **board** (`pages/board.ts`) | `.board` (`.board-grid`, `.board-region`) | `data-wall` (across the room: no keys, no pointer, larger), `data-focus=working\|landed\|decided\|today` | the one whole-screen layout: four live regions fill a second monitor ≥1100px and each list scrolls on its own, one column below; above the panels only a collapsed one-line `#notes` (`<details>`: closed by default, an open list stays open across live swaps), the strips below them; inside, only §5 parts (list card rows, badges, meters, `kbd`); a swapped region's heading wears `data-fresh` for a moment | four panes, one focused by its number | |
| 213 | | **stacked bar chart** `windowSvg()` (`fleet-graph.ts`) | `.plots`, `.plot` (`.plot-name`), `.plot-legend` | bars wear `fg-sN`, the `--series-N` token | server-drawn SVG with `width`/`height` set, so it holds its box before the stylesheet; gridlines `--border`, figures `--muted-fg` in mono, panel names `--faint`; `role="img"` with an `aria-label` totalling it, a `<title>` per bar, and a table of the same numbers beside it | a table of the same numbers | | |
| 213 | | **stacked bar chart** `windowSvg()` (`fleet-graph.ts`) | `.plots`, `.plot` (`.plot-name`), `.plot-legend` | bars wear `fg-sN`, the `--series-N` token | server-drawn SVG; `.plots` is also the two-up grid of /system's memory charts, side by side from 680 px; the SVG carries `width`/`height`, so it holds its box before the stylesheet; gridlines `--border`, figures `--muted-fg` in mono, panel names `--faint`; `role="img"` with an `aria-label` totalling it, a `<title>` per bar, and a table of the same numbers beside it | a table of the same numbers | | |
| 214 | 214 | |
| 215 | 215 | Two things are deliberately **not** in the vocabulary: skeleton loaders (the |
| 216 | 216 | server renders whole pages — there is nothing to skeletonise) and a custom |
| @@ -393,7 +393,7 @@ gone, so this list only shrinks. | ||
| 393 | 393 | - **`style/base.ts`** — the page shell (topbar, main, footer) and the layout and text utilities every page leans on: `.bar` `.bare` `.foot` `.grow` `.hide-lg` `.hide-sm` `.js-only` `.live-pill` `.mark` `.mb` `.mt` `.muted` `.narrow` `.narrow-wide` `.num` `.reduced` `.shell` `.shell-wide` `.skip` `.small` `.spacer` `.sr-only` `.stack` `.stack-tight` `.topbar` `.topbar-tools` `.truncate` `.wordmark` |
| 394 | 394 | - **`style/components.ts`** — parts of the §5 components that the table does not spell out — the palette's list, the menu's items, a dialog's head and foot, comments, the theme picker — and a few small helpers beside them: `.cat` `.clone` `.clone-text` `.comment` `.comment-body` `.comment-form` `.dash` `.dialog-body` `.dialog-foot` `.dialog-head` `.empty-title` `.error-note` `.field-row` `.form-actions` `.hex` `.ico` `.ico-loader` `.list` `.live-status` `.menu-item` `.menu-panel` `.menu-sep` `.menu-title` `.palette-empty` `.palette-foot` `.palette-group` `.palette-heading` `.palette-input` `.palette-item` `.palette-list` `.passkey` `.passkey-lead` `.passkey-note` `.passkey-off` `.passkey-on` `.preview` `.sep` `.split` `.sprite` `.swatch` `.table-scroll` `.tell-here` `.theme-apply` `.theme-option` `.tick` `.timeline` `.tl-dot` `.toast-body` `.topbar-search` |
| 395 | 395 | - **`style/components.ts`, settings rows** — a list whose rows are settings (limits, capacity): the `<ul class="list setting-list">` lets title and meta wrap instead of ellipsizing, and a row's controls take their own line under 640px. `.row-fields` is the form in that row's trail (input, Save, Default): always visible, never hover-gated, wrapping under the text before it would clip. Use both for any page whose rows show a name, a current value, and a control to change it; use `.row-actions` only for secondary actions (delete, wake, pin, revoke). Flags, telemetry, cloud, people, crew roles and subscription headroom/budget use `.row-fields`. Classes: `.row-fields` `.setting-list` |
| 396 | - **`style/content.ts`, page furniture** — what frames a page's content: page and repo heads, the merge box, the front page and its tiles, explore, backups, boards, the fleet chart's series colours, following, lineage: `.about` `.act` `.app-shelf` `.app-tile` `.app-tile-body` `.app-tile-desc` `.app-tile-look` `.app-tile-name` `.backups-drill` `.backups-error` `.backups-now` `.backups-restore` `.bform` `.bgrid` `.big` `.bmanage` `.boards-result` `.bp-h2` `.bp-h3` `.bp-w2` `.bp-w3` `.break` `.bt-bar` `.bt-grid` `.bt-group` `.bt-hist` `.bt-name` `.bt-procs` `.bt-row` `.bt-val` `.chart` `.chart-box` `.commit-body` `.commit-head` `.connect-more` `.connect-path` `.domain-records` `.explore-filters` `.explore-line` `.explore-main` `.explore-name` `.explore-row` `.fg-s0` `.fg-s1` `.fg-s2` `.fg-s3` `.fg-s4` `.fg-s5` `.fg-s6` `.fg-s7` `.filters` `.flag-form` `.following` `.following-actions` `.following-eyebrow` `.following-foot` `.following-head` `.following-sentence` `.fork-bar` `.front-admin` `.front-controls` `.front-crew` `.front-featured` `.front-featured-body` `.front-featured-look` `.front-issues` `.front-live` `.front-more` `.front-pick` `.front-pin-any` `.front-weights` `.frozen` `.frozen-form` `.frozen-sentence` `.handoff` `.handoff-links` `.headroom` `.hero` `.hero-terminal` `.issue-head` `.issue-meta` `.kv` `.lineage` `.lineage-children` `.lineage-here` `.merge-box` `.merge-form` `.merge-headline` `.merge-sub` `.mirror-form` `.number` `.origin-link` `.origin-mark` `.origin-name` `.origin-row` `.owner` `.page-head` `.path-head` `.policy-line` `.qf` `.repo-actions` `.repo-audience` `.repo-desc` `.repo-layout` `.repo-lineage` `.repo-title` `.search` `.slash` `.stage-detail` `.stage-dot` `.steps` `.sub` `.sys-pair` `.table-wrap` `.terminal-line` `.tok` `.tree-row` `.tree-total` `.wall-cells` `.where-sep` | |
| 396 | - **`style/content.ts`, page furniture** — what frames a page's content: page and repo heads, the merge box, the front page and its tiles, explore, backups, boards, the fleet chart's series colours, following, lineage: `.about` `.act` `.app-shelf` `.app-tile` `.app-tile-body` `.app-tile-desc` `.app-tile-look` `.app-tile-name` `.backups-drill` `.backups-error` `.backups-now` `.backups-restore` `.bform` `.bgrid` `.big` `.bmanage` `.boards-result` `.bp-h2` `.bp-h3` `.bp-w2` `.bp-w3` `.break` `.bt-bar` `.bt-grid` `.bt-group` `.bt-hist` `.bt-name` `.bt-procs` `.bt-row` `.bt-val` `.chart` `.chart-box` `.commit-body` `.commit-head` `.connect-more` `.connect-path` `.domain-records` `.explore-filters` `.explore-line` `.explore-main` `.explore-name` `.explore-row` `.fg-s0` `.fg-s1` `.fg-s2` `.fg-s3` `.fg-s4` `.fg-s5` `.fg-s6` `.fg-s7` `.filters` `.flag-form` `.following` `.following-actions` `.following-eyebrow` `.following-foot` `.following-head` `.following-sentence` `.fork-bar` `.front-admin` `.front-controls` `.front-crew` `.front-featured` `.front-featured-body` `.front-featured-look` `.front-issues` `.front-live` `.front-more` `.front-pick` `.front-pin-any` `.front-weights` `.frozen` `.frozen-form` `.frozen-sentence` `.handoff` `.handoff-links` `.headroom` `.hero` `.hero-terminal` `.issue-head` `.issue-meta` `.kv` `.lineage` `.lineage-children` `.lineage-here` `.merge-box` `.merge-form` `.merge-headline` `.merge-sub` `.mirror-form` `.number` `.origin-link` `.origin-mark` `.origin-name` `.origin-row` `.owner` `.page-head` `.path-head` `.policy-line` `.qf` `.repo-actions` `.repo-audience` `.repo-desc` `.repo-layout` `.repo-lineage` `.repo-title` `.search` `.slash` `.stage-detail` `.stage-dot` `.steps` `.sub` `.table-wrap` `.terminal-line` `.tok` `.tree-row` `.tree-total` `.wall-cells` `.where-sep` | |
| 397 | 397 | - **`style/content.ts`, code view** — the source view and the syntax-highlight token classes `highlight-html.ts` builds as `tok-${kind}`: `.blob-view` `.ln` `.tok-attribute` `.tok-comment` `.tok-constant` `.tok-decorator` `.tok-deleted` `.tok-emphasis` `.tok-function` `.tok-heading` `.tok-inserted` `.tok-keyword` `.tok-link` `.tok-meta` `.tok-number` `.tok-operator` `.tok-plain` `.tok-property` `.tok-punctuation` `.tok-regex` `.tok-string` `.tok-tag` `.tok-type` `.tok-variable` |
| 398 | 398 | - **`style/content.ts`, prose (markdown)** — table cell alignment, built by `markdown.ts` as `ta-${align}`: `.ta-c` `.ta-r` |
| 399 | 399 | - **`style/content.ts`, diff viewer** — the diff table: its gutters, line kinds, file head and inline review comments: `.add` `.del` `.dh` `.diff` `.diff-body` `.diff-head` `.diff-note` `.diff-path` `.diff-stat` `.diff-stub` `.diff-summary` `.diff-table` `.dl` `.dl-review` `.dn` `.dn-comment` `.nonl` `.rc-hidden` `.rc-resolve` `.rc-resolved` `.wd` |
src/web/pages/system.ts +1 −1
| @@ -76,7 +76,7 @@ function memorySection(ctx: Ctx): Html { | ||
| 76 | 76 | ); |
| 77 | 77 | return hours.length === 0 |
| 78 | 78 | ? empty({ icon: "activity", title: "No samples yet", note: "The forge samples its memory every minute; the first hour appears shortly." }) |
| 79 | : html`<div class="sys-pair">${series("RSS (MiB, hourly mean)", (h) => h.rssMean)}${series("JS heap (MiB, hourly mean)", (h) => h.heapMean)}</div> | |
| 79 | : html`<div class="plots">${series("RSS (MiB, hourly mean)", (h) => h.rssMean)}${series("JS heap (MiB, hourly mean)", (h) => h.heapMean)}</div> | |
| 80 | 80 | <div class="table-scroll"><table class="table" aria-label="Forge memory by hour"> |
| 81 | 81 | <thead><tr><th scope="col">Hour (UTC)</th><th scope="col" class="num">RSS mean</th><th scope="col" class="num">RSS max</th><th scope="col" class="num">Heap mean</th><th scope="col" class="num">Heap max</th></tr></thead> |
| 82 | 82 | <tbody>${hours.map((h) => html`<tr><td class="mono">${hhmm(h.at)}</td><td class="num mono">${mib(h.rssMean)}</td><td class="num mono">${mib(h.rssMax)}</td><td class="num mono">${mib(h.heapMean)}</td><td class="num mono">${mib(h.heapMax)}</td></tr>`)}</tbody> |
src/web/style/components.ts +2 −2
| @@ -258,7 +258,7 @@ progress:not(.tests-bar)::-moz-progress-bar { background: var(--success); } | ||
| 258 | 258 | .dot[data-series="7"] { background: var(--series-7); } |
| 259 | 259 | |
| 260 | 260 | /* ---- stacked bar chart: series stacked per bucket, drawn as SVG on the server ---- */ |
outdated
Lowering the minimum to 320px also changes when the fleet-graph panels go two-up. Check that they still read well at 680-760px. |
||
| 261 | .plots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; margin: 0 0 16px; } | |
| 261 | .plots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; margin: 0 0 16px; } | |
| 262 | 262 | .plots figcaption { font-size: 13px; font-weight: 600; margin: 0 0 4px; display: flex; gap: 8px; align-items: baseline; } |
| 263 | 263 | .plot { display: block; width: 100%; height: auto; } |
| 264 | 264 | .plot line { stroke: var(--border); stroke-width: 1; } |
| @@ -329,7 +329,7 @@ a.sha:hover { color: var(--accent); } | ||
| 329 | 329 | /* Cards stacked in normal flow space themselves. Inside a container that |
| 330 | 330 | already manages its own spacing with gap, that margin would double it. */ |
| 331 | 331 | .card + .card { margin-top: 12px; } |
| 332 | :is(.stack, .dash, .split, .timeline) > .card + .card { margin-top: 0; } | |
| 332 | :is(.stack, .dash, .split, .timeline, .plots) > .card + .card { margin-top: 0; } | |
| 333 | 333 | .card-head { |
| 334 | 334 | display: flex; align-items: center; gap: 8px; flex-wrap: wrap; |
| 335 | 335 | padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--muted); |
src/web/style/content.ts −2
| @@ -363,8 +363,6 @@ a.origin-chip:hover { border-color: var(--border-strong); color: var(--fg); } | ||
| 363 | 363 | .bt-procs { font-size: 12.5px; } |
| 364 | 364 | .bt-procs th, .bt-procs td { padding: 2px 8px; white-space: nowrap; } |
| 365 | 365 | .bt-group th, .bt-group td { background: var(--muted); font-weight: 600; } |
| 366 | .sys-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; } | |
| 367 | .sys-pair .chart-box { max-width: none; } | |
| 368 | 366 | .bgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; } |
| 369 | 367 | .bp-w2 { grid-column: span 2; } |
| 370 | 368 | .bp-w3 { grid-column: span 3; } |
test/system-memory.test.ts +18
| @@ -7,6 +7,7 @@ import { afterAll, beforeAll, describe, expect, test } from "bun:test"; | ||
| 7 | 7 | import { mkdtemp, rm } from "node:fs/promises"; |
| 8 | 8 | import { tmpdir } from "node:os"; |
| 9 | 9 | import { join } from "node:path"; |
| 10 | import { components } from "../src/web/style/components.ts"; | |
| 10 | 11 | import { createApp } from "../src/app.ts"; |
| 11 | 12 | import { HOUR_MS, memoryHours, recordMemory } from "../src/boards/memory.ts"; |
| 12 | 13 | import { createToken } from "../src/core/tokens.ts"; |
| @@ -105,3 +106,20 @@ describe("reaching /system", () => { | ||
| 105 | 106 | expect(await res.text()).toContain("<h1>"); |
| 106 | 107 | }); |
| 107 | 108 | }); |
| 109 | ||
outdated
Describe title cites #3953. Name the behaviour instead of an issue number. |
||
| 110 | describe("memory chart pair layout (#3953)", () => { | |
| 111 | test("the charts sit in the base .plots grid and sys-pair is gone", async () => { | |
| 112 | recordMemory(app.db, 100 * MiB, 50 * MiB, Date.now()); | |
| 113 | const body = await (await get("alice")).text(); | |
| 114 | expect(body).toContain('<div class="plots">'); | |
| 115 | expect(body).not.toContain("sys-pair"); | |
| 116 | expect(body).toContain("RSS (MiB, hourly mean)"); | |
| 117 | expect(body).toContain("JS heap (MiB, hourly mean)"); | |
| 118 | }); | |
| 119 | ||
| 120 | test("the second card in the grid takes no stacked margin, so the pair aligns", () => { | |
| 121 | const rule = components.split("\n").find((l) => l.includes("> .card + .card")); | |
This finds the rule by grepping for "> .card + .card" in the CSS string, so it breaks if the rule is reformatted. Matching the selector list more loosely would be sturdier. |
||
| 122 | expect(rule).toContain(".plots"); | |
| 123 | expect(rule).toContain("margin-top: 0"); | |
| 124 | }); | |
| 125 | }); |
new above
offline
Garbled: "side by side from 680 px with width/height set". The width/height clause belongs to the SVG sentence; split them.