Public: anyone can read this; the crew can change it.

Design: /settings/backups uses the design system, and its backups-* classes leave §5d #3853

Parked opened this
Closed without merging

scout/forge:scout/3833-design-settings-backups-uses-the-design → main 6 commits fork 1 thread · 1 unresolved

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
5 files changed +18 −17
docs/DESIGN.md +4
@@ -393,7 +393,11 @@ gone, so this list only shrinks.
393393 - **`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`
394394 - **`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`
395395 - **`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 =======
396399 - **`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
397401 - **`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`
398402 - **`style/content.ts`, prose (markdown)** — table cell alignment, built by `markdown.ts` as `ta-${align}`: `.ta-c` `.ta-r`
399403 - **`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(
9595 sealed value (secrets, app variables, origin tokens) is lost and must be
9696 set again.
9797 </p>`
98 : html`<p class="backups-error">
98 : html`<p class="error-note">
9999 ${icon("alert")} Snapshots carry no key: the bucket never holds key and
100100 data together, and a restore will bring back repositories and issues but
101101 not sealed values, which must be set again.${last} To carry the key
@@ -124,16 +124,16 @@ function drillLine(ctx: Ctx): Html {
124124 const timing = d === undefined ? "" : drillTiming(d);
125125 const line =
126126 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>`
128128 : d.verdict === "green"
129 ? html`<p class="backups-drill">
129 ? html`<p class="muted">
130130 ${icon("check")} Last drill: ${time(d.at)}, ${d.ms} ms, all counts matched —
131131 snapshot <code>${d.snapshotId ?? ""}</code>, key opened —
132132 ${d.counts.users} users, ${d.counts.repositories} repositories, ${d.counts.issues} issues, ${d.counts.pulls} pulls, ${d.counts.apps} apps.${timing
133133 ? html` <span class="backups-timing">${timing}.</span>`
134134 : ""}
135135 </p>`
136 : html`<p class="backups-error backups-drill">
136 : html`<p class="error-note">
137137 ${icon("alert")} Last drill ${time(d.at)}: snapshot
138138 <code>${d.snapshotId ?? "none"}</code> failed at
139139 ${d.failedStep ?? "an unknown step"} after ${d.ms} ms${d.reason
@@ -141,7 +141,7 @@ function drillLine(ctx: Ctx): Html {
141141 : ""}.${timing ? html` <span class="backups-timing">${timing}.</span>` : ""}
142142 </p>`;
143143 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">
145145 ${btn("Run a drill", { type: "submit", icon: "clock" })}
146146 </form>`;
147147 }
@@ -192,7 +192,7 @@ export function recoverySentence(r: Recovery): string {
192192 function recoveryLine(r: Recovery): Html {
193193 const sentence = recoverySentence(r);
194194 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">
196196 ${icon(ok ? "check" : "alert")} <strong>${sentence}</strong>
197197 </p>`;
198198 }
@@ -335,7 +335,7 @@ async function movingPart(
335335 now,
336336 });
337337 const restore = snapshots[0]
338 ? html`<pre class="backups-restore">
338 ? html`<pre class="code mt">
339339 bun run src/snapshot/restore.ts ${snapshots[0].name} /path/to/empty/data</pre>`
340340 : null;
341341 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>`
358358 ${when(
359359 failing,
360360 (f) =>
361 html`<p class="backups-error" role="alert">
361 html`<p class="error-note" role="alert">
362362 ${icon("alert")} The last snapshot failed ${time(f.at)}, failing
363363 since ${time(f.since)}: ${f.error}
364364 </p>`,
@@ -366,12 +366,12 @@ bun run src/snapshot/restore.ts ${snapshots[0].name} /path/to/empty/data</pre>`
366366 ${when(
367367 listing,
368368 (error) =>
369 html`<p class="backups-error">
369 html`<p class="error-note">
370370 ${icon("alert")} The store could not be listed just now: ${error}
371371 </p>`,
372372 )}
373373 ${drillLine(ctx)}
374 <form method="post" action="/settings/backups/now" class="backups-now">
374 <form method="post" action="/settings/backups/now" class="form-actions">
375375 ${btn("Snapshot now", {
376376 type: "submit",
377377 variant: "primary",
@@ -532,7 +532,7 @@ function mirrorCard(ctx: Ctx): Html {
532532 every snapshot is copied there within the hour.</p>`
533533 : state === undefined
534534 ? 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" : ""}">
536536 ${icon(need ? "alert" : "check")} <code>${state.where}</code> is
537537 ${state.reachable ? "reachable" : "unreachable"} (checked
538538 ${time(state.attemptAt)}).
src/web/style/components.ts +1 −1
@@ -142,7 +142,7 @@ fieldset.field > .check + .check { margin-top: 8px; }
142142 .form-actions { margin-top: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
143143 /* A passkey ceremony's note slot looks like an error only once it says one. */
144144 .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;
146146 padding: 8px 12px; margin: 0 0 12px;
147147 border: 1px solid color-mix(in srgb, var(--danger) 32%, transparent);
148148 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); }
329329 .flag-form { justify-content: flex-start; }
330330 .flag-form .input { min-width: 0; flex: 1 1 8rem; }
331331 }
332 .backups-now { margin-top: 12px; }
333 .backups-drill { overflow-wrap: anywhere; }
334332 .chart-box { color: var(--accent); aspect-ratio: 720 / 260; max-width: 720px; }
335333 .chart-box .chart { display: block; width: 100%; height: auto; }
336334 .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); }
385383 .fg-s5 { fill: var(--series-5); color: var(--series-5); }
386384 .fg-s6 { fill: var(--series-6); color: var(--series-6); }
387385 .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); }
390386 /* The records a domain waits on: type, name, value — as a zone file reads. */
391387 .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); }
392388 .policy-line {
test/snapshot-outcome.test.ts +2 −1
@@ -102,7 +102,8 @@ describe("a nightly that fails", () => {
102102 // The terminal's dashboard prints the forge's needs: the card is there too.
103103 expect(forgeNeeds(app, admin)?.some((l) => l.includes("The last snapshot failed"))).toBe(true);
104104 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);
106107 expect(page.replace(/\s+/g, " ")).toContain("The last snapshot failed");
107108 expect(page).toContain("no answer in 180 s");
108109

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs