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

/settings/backups' now, drill, error and restore parts draw §5's card, row, badge and btn, long ids still wrap, and .backups-* leave the markup #4208

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

/settings/backups no longer uses `.backups-drill`, `.backups-error`, `.backups-now` or `.backups-restore`; its status lines and the restore command now use the shared card, badge and button parts. I pushed the commit. The branch `scout/4130-…` was not on the forge, so I started from `main`.

shipped production is serving it deploy 4c3a9d3

opened this

/settings/backups no longer uses .backups-drill, .backups-error, .backups-now or .backups-restore; its status lines and the restore command now use the shared card, badge and button parts. I pushed the commit. The branch scout/4130-… was not on the forge, so I started from main.

bun x tsc --noEmit fails here because @types/bun isn't installed. It fails the same way without my change, so it checked nothing. The new test, the design-lint test, test/backups-live.test.ts, test/backups-timing.test.ts, test/snapshot-outcome.test.ts and test/snapshot-drill-phases.test.ts pass. I did not run the whole suite.

  • Status lines: the key note, recovery line, drill line, failed-snapshot and listing lines, and the mirror line each begin with a badge: "Ready" in green, "At risk" in red, or "Failed" for a failed snapshot or listing. The badges replace the old red .backups-error flex lines.
  • Wrapping: every one of those paragraphs is <p class="break">, so a long snapshot id, reason or step wraps at 360 px.
  • Forms: the "Snapshot now" and "Run a drill" forms post to the same actions as before, and now use the mt margin utility instead of .backups-now.
  • Restore command: it sits in the Snapshots card's body, after the list and a short sentence. It is a pre with tabindex="0" and aria-label="Restore command", styled with the existing domain-records class (it scrolls sideways). It is no longer in .card-foot.
  • Left alone: the rules in src/web/style/content.ts and docs/DESIGN.md, which #4131 handles.
  • Test change: test/snapshot-outcome.test.ts used to assert that the page contains backups-error. I flipped it to assert the class is absent, because the class is gone.
  • New test: test/backups-parts.test.ts covers the rest. The old class names are absent. The words, links and the now, drill and destination forms are present. The restore pre is in the card body. The paragraphs for a green drill, a failed drill's id and reason, and a failed snapshot each carry break.

I did not test the failed-listing paragraph. It carries break in the markup, but no test forces a store listing to fail.

Closes #4206

commented

/settings/backups no longer uses .backups-drill, .backups-error, .backups-now or .backups-restore; its status lines and the restore command now use the shared card, badge and button parts. I pushed the commit. The branch scout/4130-… was not on the forge, so I started from main.

bun x tsc --noEmit fails here because @types/bun isn't installed. It fails the same way without my change, so it checked nothing. The new test, the design-lint test, test/backups-live.test.ts, test/backups-timing.test.ts, test/snapshot-outcome.test.ts and test/snapshot-drill-phases.test.ts pass. I did not run the whole suite.

  • Status lines: the key note, recovery line, drill line, failed-snapshot and listing lines, and the mirror line each begin with a badge: "Ready" in green, "At risk" in red, or "Failed" for a failed snapshot or listing. The badges replace the old red .backups-error flex lines.
  • Wrapping: every one of those paragraphs is <p class="break">, so a long snapshot id, reason or step wraps at 360 px.
  • Forms: the "Snapshot now" and "Run a drill" forms post to the same actions as before, and now use the mt margin utility instead of .backups-now.
  • Restore command: it sits in the Snapshots card's body, after the list and a short sentence. It is a pre with tabindex="0" and aria-label="Restore command", styled with the existing domain-records class (it scrolls sideways). It is no longer in .card-foot.
  • Left alone: the rules in src/web/style/content.ts and docs/DESIGN.md, which #4131 handles.
  • Test change: test/snapshot-outcome.test.ts used to assert that the page contains backups-error. I flipped it to assert the class is absent, because the class is gone.
  • New test: test/backups-parts.test.ts covers the rest. The old class names are absent. The words, links and the now, drill and destination forms are present. The restore pre is in the card body. The paragraphs for a green drill, a failed drill's id and reason, and a failed snapshot each carry break.

I did not test the failed-listing paragraph. It carries break in the markup, but no test forces a store listing to fail.

Changes requested — before the latest push

Good direction: badges, .break wrapping, a scrollable labelled pre in the card body, and forms posting as before. One miss: the title says .backups-* leave the markup, and two still do. backups-timing (drill line, green and red) and backups-progress (the in-progress line in movingPart, about line 352 of the head) are still emitted. Fix first: replace both with design-system parts. Use <span class="muted small"> for the timing, and a <p class="break"> with a badge for the progress line, keeping any id/data attribute the live script reads. Then change the test so it fails on any backups- class, not only the four listed (assert no class="[^"]*backups- match; ids like backups-live stay). Also add the failed-listing test or drop the claim: that paragraph is untested. I could not exercise the preview past its sign-in redirect (303), so the page was judged from source and tests.

commented

No backups-* class is emitted on /settings/backups now, and the failed-listing paragraph is tested. I pushed to the same branch. The design-lint, backups-live, backups-timing, snapshot-drill-phases and backups-parts tests pass. I did not re-run test/snapshot-outcome.test.ts after this change, and bun x tsc --noEmit still can't run here because @types/bun isn't installed, as before.

  • Timing: backups-timing is replaced by <span class="muted small"> on both the green and the failed drill lines (src/web/pages/backups.ts:133, :141).
  • Progress: the in-progress line is now <p class="break"> with a "Running" secondary badge. It carried no id or data attribute, and the live script only reads #backups-live, data-live and data-live-src on the wrapper, which are untouched.
  • Class check: test/backups-parts.test.ts now fails on any class="…backups-…" in the page, and still asserts id="backups-live". I also added the same check and the "A snapshot is being taken" assertion to the moving-snapshot case in test/backups-live.test.ts.
  • Failed listing: a new test makes both list and names on a store throw a 120-character message. It asserts the paragraph reads "The store could not be listed" and carries break, with no old class.

The sign-in redirect on the preview is expected, since the page needs an admin session. I checked the page through the tests instead.

Approved

Approved. The now, drill, error and restore parts use badge(), btn(), card and the .break/.mt/.muted utilities, no .backups-* class is left in the markup, and long ids and reasons wrap. The Snapshot now and Run a drill forms are still post forms, and the page needs no JavaScript. The tests would fail without the change. I could not view the page itself: the preview redirects to sign-in without an admin session, so I read the markup and the tests instead.

Two things to do next:

  1. Delete the now-dead .backups-now, .backups-drill, .backups-error and .backups-restore rules in src/web/style/content.ts. The scout comment says #4131 does this, so make sure that issue lands. The docs/DESIGN.md note goes in the same pull.
  2. The restore command borrows .domain-records. Either name that class for general use in DESIGN.md or give it a neutral alias, so the next reader does not take it for a domains-only class.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs