mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 05:42:19 +00:00
refactor(admin): the console speaks the Settings vocabulary without an accent
Twenty-six of twenty-eight admin files already used the Settings card and header. What made the console read as its own system was everything on top of that: three hand-rolled cards, a header slot that meant five different things, and a heading the frame took but never painted. - `SectionFrame` drops `title` and `subtitle`. Seventeen call sites passed both into a component that has rendered neither since v1.18.6.1 — the shell reads the same keys itself. A prop contract nothing honours is a promise the next reader believes. - The invite card, the four host-metric headers, and the `/admin` welcome card stop hand-rolling `bg-card border rounded-xl` shells with their own padding steps and their own heading weights. `text-sm` as a card title on the first card of a page, directly above a correct one, was the first thing the eye landed on. - The header status slot carries status. The backups run, the invite create, the danger-zone wipe, and the user filters come out of it; the app-log refresh stays but reads as the secondary it is. - Loading states paint their card and header. Encryption returned a bare spinner row and then a card, so the section jumped when the status landed — the fix `coach-feedback-section.tsx` already carried, applied where it was missing. Same for the notification-status card. - One label/value tile. `StatusItem`, the encryption section's private `Stat`, the user-management inline panels and the backups upload box were four fills and three paddings for one role. - The overview stopped printing the running version, build SHA and build time twice, thirty pixels apart. The version tile owns build identity — it is the one that checks for a newer release; the snapshot owns what is running. - `ai-server-key` had three paragraphs stacked in a muted `text-xs` slot; one sentence stays there and the two that carry information move into the body as foreground. The central-codex consent copy moves the same way, and its disconnect is `variant="destructive"` — which `ConfirmButton` refused to accept, so every destructive confirm in the tree had been hand-tinting an outline instead. - Leftovers: the `-mt-2` correcting the card's own rhythm, two alpha hovers on text, `text-[10px]` badges, the redundant `space-y-6` wrapper, the empty state repeating the header's CTA, and the `mt-6` a card added inside a frame that already spaces its children.
This commit is contained in:
1 parent
b2e1aa0cde
commit
330f60115a
27 files changed
+472
-569
No files matched your search
@@ -6,7 +6,10 @@ import { renderToStaticMarkup } from "react-dom/server";
|
||||
* `StatusCardGrid` (the section-card grid the maintainer described as redundant
|
||||
* with the sidebar nav). The status-card component itself was removed
|
||||
* from the codebase. This test guards the *new* overview composition:
|
||||
* a welcome card, the system snapshot, and the recent-audit preview.
|
||||
* the version tile, the system snapshot, and the recent-audit preview. The
|
||||
* welcome card went with the grid: it greeted the reader and told them they
|
||||
* were signed in as an administrator, on a route only an administrator can
|
||||
* reach.
|
||||
*
|
||||
* The file kept its old name so git history follows it. Nothing else
|
||||
* imports `status-card-grid`.
|
||||
@@ -71,12 +74,10 @@ describe("/admin overview composition", () => {
|
||||
expect(html).not.toContain("Open backups");
|
||||
});
|
||||
|
||||
it("renders the welcome card with the admin's username", () => {
|
||||
it("renders no welcome card", () => {
|
||||
const html = render(<AdminOverviewPage />);
|
||||
// `welcomeTitle` interpolates the username; the mocked auth hook
|
||||
// returns "testuser".
|
||||
expect(html).toContain("Welcome, testuser");
|
||||
expect(html).toContain("admin-overview-welcome-heading");
|
||||
expect(html).not.toContain("Welcome, testuser");
|
||||
expect(html).not.toContain("admin-overview-welcome-heading");
|
||||
});
|
||||
|
||||
it("renders the system snapshot section heading", () => {
|
||||
|
||||
Reference in new issue
Block a user