Public: anyone can read this; the crew can change it.
Design: /settings/backups uses the design system, and its backups-* classes leave §5d #3853
scout/forge:scout/3833-design-settings-backups-uses-the-design → main 6 commits fork 1 thread · 1 unresolved
5 files
changed +18
−17
docs/DESIGN.md +4
| @@ -393,7 +393,11 @@ 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 | <<<<<<< HEAD | |
| 397 | - **`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` `.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` `.quiet-details` `.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` | |
| 398 | ======= | |
| 396 | 399 | - **`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` |
| 400 | >>>>>>> origin/main | |
| 397 | 401 | - **`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 | 402 | - **`style/content.ts`, prose (markdown)** — table cell alignment, built by `markdown.ts` as `ta-${align}`: `.ta-c` `.ta-r` |
| 399 | 403 | - **`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/backups.ts +11 −11
| @@ -95,7 +95,7 @@ function keyNote( | ||
| 95 | 95 | sealed value (secrets, app variables, origin tokens) is lost and must be |
| 96 | 96 | set again. |
| 97 | 97 | </p>` |
| 98 | : html`<p class="backups-error"> | |
| 98 | : html`<p class="error-note"> | |
| 99 | 99 | ${icon("alert")} Snapshots carry no key: the bucket never holds key and |
| 100 | 100 | data together, and a restore will bring back repositories and issues but |
| 101 | 101 | not sealed values, which must be set again.${last} To carry the key |
| @@ -124,16 +124,16 @@ function drillLine(ctx: Ctx): Html { | ||
| 124 | 124 | const timing = d === undefined ? "" : drillTiming(d); |
| 125 | 125 | const line = |
| 126 | 126 | d === undefined |
| 127 | ? html`<p class="backups-drill">No restore drill has run yet.</p>` | |
| 127 | ? html`<p class="muted">No restore drill has run yet.</p>` | |
| 128 | 128 | : d.verdict === "green" |
| 129 | ? html`<p class="backups-drill"> | |
| 129 | ? html`<p class="muted"> | |
| 130 | 130 | ${icon("check")} Last drill: ${time(d.at)}, ${d.ms} ms, all counts matched — |
| 131 | 131 | snapshot <code>${d.snapshotId ?? ""}</code>, key opened — |
| 132 | 132 | ${d.counts.users} users, ${d.counts.repositories} repositories, ${d.counts.issues} issues, ${d.counts.pulls} pulls, ${d.counts.apps} apps.${timing |
| 133 | 133 | ? html` <span class="backups-timing">${timing}.</span>` |
| 134 | 134 | : ""} |
| 135 | 135 | </p>` |
| 136 | : html`<p class="backups-error backups-drill"> | |
| 136 | : html`<p class="error-note"> | |
| 137 | 137 | ${icon("alert")} Last drill ${time(d.at)}: snapshot |
| 138 | 138 | <code>${d.snapshotId ?? "none"}</code> failed at |
| 139 | 139 | ${d.failedStep ?? "an unknown step"} after ${d.ms} ms${d.reason |
| @@ -141,7 +141,7 @@ function drillLine(ctx: Ctx): Html { | ||
| 141 | 141 | : ""}.${timing ? html` <span class="backups-timing">${timing}.</span>` : ""} |
| 142 | 142 | </p>`; |
| 143 | 143 | return html`${line} |
| 144 | <form method="post" action="/settings/backups/drill" class="backups-now"> | |
| 144 | <form method="post" action="/settings/backups/drill" class="form-actions"> | |
| 145 | 145 | ${btn("Run a drill", { type: "submit", icon: "clock" })} |
| 146 | 146 | </form>`; |
| 147 | 147 | } |
| @@ -192,7 +192,7 @@ export function recoverySentence(r: Recovery): string { | ||
| 192 | 192 | function recoveryLine(r: Recovery): Html { |
| 193 | 193 | const sentence = recoverySentence(r); |
| 194 | 194 | const ok = sentence === "Recoverable now"; |
| 195 | return html`<p class="backups-recovery${ok ? "" : " backups-error"}" role="status"> | |
| 195 | return html`<p class="backups-recovery${ok ? "" : " error-note"}" role="status"> | |
| 196 | 196 | ${icon(ok ? "check" : "alert")} <strong>${sentence}</strong> |
| 197 | 197 | </p>`; |
| 198 | 198 | } |
| @@ -335,7 +335,7 @@ async function movingPart( | ||
| 335 | 335 | now, |
| 336 | 336 | }); |
| 337 | 337 | const restore = snapshots[0] |
| 338 | ? html`<pre class="backups-restore"> | |
| 338 | ? html`<pre class="code mt"> | |
| 339 | 339 | bun run src/snapshot/restore.ts ${snapshots[0].name} /path/to/empty/data</pre>` |
| 340 | 340 | : null; |
| 341 | 341 | return html`<div id="backups-live" data-live="backup.*" data-live-src="/settings/backups/live">${recovery}${card( |
| @@ -358,7 +358,7 @@ bun run src/snapshot/restore.ts ${snapshots[0].name} /path/to/empty/data</pre>` | ||
| 358 | 358 | ${when( |
| 359 | 359 | failing, |
| 360 | 360 | (f) => |
| 361 | html`<p class="backups-error" role="alert"> | |
| 361 | html`<p class="error-note" role="alert"> | |
| 362 | 362 | ${icon("alert")} The last snapshot failed ${time(f.at)}, failing |
| 363 | 363 | since ${time(f.since)}: ${f.error} |
| 364 | 364 | </p>`, |
| @@ -366,12 +366,12 @@ bun run src/snapshot/restore.ts ${snapshots[0].name} /path/to/empty/data</pre>` | ||
| 366 | 366 | ${when( |
| 367 | 367 | listing, |
| 368 | 368 | (error) => |
| 369 | html`<p class="backups-error"> | |
| 369 | html`<p class="error-note"> | |
| 370 | 370 | ${icon("alert")} The store could not be listed just now: ${error} |
| 371 | 371 | </p>`, |
| 372 | 372 | )} |
| 373 | 373 | ${drillLine(ctx)} |
| 374 | <form method="post" action="/settings/backups/now" class="backups-now"> | |
| 374 | <form method="post" action="/settings/backups/now" class="form-actions"> | |
| 375 | 375 | ${btn("Snapshot now", { |
| 376 | 376 | type: "submit", |
| 377 | 377 | variant: "primary", |
| @@ -532,7 +532,7 @@ function mirrorCard(ctx: Ctx): Html { | ||
| 532 | 532 | every snapshot is copied there within the hour.</p>` |
| 533 | 533 | : state === undefined |
| 534 | 534 | ? html`<p>Mirroring to <code>${svc!.mirror!.where}</code>; the first pass has not run yet.</p>` |
| 535 | : html`<p class="${need ? "backups-error" : ""}"> | |
| 535 | : html`<p class="${need ? "error-note" : ""}"> | |
| 536 | 536 | ${icon(need ? "alert" : "check")} <code>${state.where}</code> is |
| 537 | 537 | ${state.reachable ? "reachable" : "unreachable"} (checked |
| 538 | 538 | ${time(state.attemptAt)}). |
src/web/style/components.ts +1 −1
| @@ -142,7 +142,7 @@ fieldset.field > .check + .check { margin-top: 8px; } | ||
| 142 | 142 | .form-actions { margin-top: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } |
| 143 | 143 | /* A passkey ceremony's note slot looks like an error only once it says one. */ |
| 144 | 144 | .error-note, .passkey-note:not(:empty) { |
| 145 | display: block; color: var(--danger); font-size: 13px; font-weight: 500; | |
| 145 | display: block; color: var(--danger); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; | |
| 146 | 146 | padding: 8px 12px; margin: 0 0 12px; |
| 147 | 147 | border: 1px solid color-mix(in srgb, var(--danger) 32%, transparent); |
| 148 | 148 | background: color-mix(in srgb, var(--danger) 10%, transparent); |
src/web/style/content.ts −4
| @@ -329,8 +329,6 @@ a.origin-chip:hover { border-color: var(--border-strong); color: var(--fg); } | ||
| 329 | 329 | .flag-form { justify-content: flex-start; } |
| 330 | 330 | .flag-form .input { min-width: 0; flex: 1 1 8rem; } |
| 331 | 331 | } |
| 332 | .backups-now { margin-top: 12px; } | |
| 333 | .backups-drill { overflow-wrap: anywhere; } | |
| 334 | 332 | .chart-box { color: var(--accent); aspect-ratio: 720 / 260; max-width: 720px; } |
| 335 | 333 | .chart-box .chart { display: block; width: 100%; height: auto; } |
| 336 | 334 | .chart-box text { fill: var(--muted-fg); font-family: var(--mono); } |
| @@ -385,8 +383,6 @@ a.origin-chip:hover { border-color: var(--border-strong); color: var(--fg); } | ||
| 385 | 383 | .fg-s5 { fill: var(--series-5); color: var(--series-5); } |
| 386 | 384 | .fg-s6 { fill: var(--series-6); color: var(--series-6); } |
| 387 | 385 | .fg-s7 { fill: var(--series-7); color: var(--series-7); } |
| 388 | .backups-error { display: flex; align-items: center; gap: 8px; color: var(--danger); } | |
| 389 | .backups-restore { margin: 8px 0 0; padding: 8px 10px; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; background: var(--muted); border-radius: var(--radius); } | |
| 390 | 386 | /* The records a domain waits on: type, name, value — as a zone file reads. */ |
| 391 | 387 | .domain-records { margin: 6px 0 2px; padding: 8px 10px; font-size: 12.5px; line-height: 1.6; white-space: pre; overflow-x: auto; scrollbar-width: thin; background: var(--muted); border-radius: var(--radius); } |
| 392 | 388 | .policy-line { |
test/snapshot-outcome.test.ts +2 −1
| @@ -102,7 +102,8 @@ describe("a nightly that fails", () => { | ||
| 102 | 102 | // The terminal's dashboard prints the forge's needs: the card is there too. |
| 103 | 103 | expect(forgeNeeds(app, admin)?.some((l) => l.includes("The last snapshot failed"))).toBe(true); |
| 104 | 104 | const page = await (await fetch(`${servers.url}/settings/backups`, { headers: { cookie } })).text(); |
| 105 | expect(page).toContain("backups-error"); | |
| 105 | expect(page).toContain("error-note"); | |
| 106 | for (const old of ["backups-error", "backups-drill", "backups-now", "backups-restore"]) expect(page).not.toContain(old); | |
| 106 | 107 | expect(page.replace(/\s+/g, " ")).toContain("The last snapshot failed"); |
| 107 | 108 | expect(page).toContain("no answer in 180 s"); |
| 108 | 109 |
new above
offline