You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 88da4e0
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(admin): dashboard lists share one table, badge and message fields (#599)
Part of #544. Stacked on #564 (`fix/550-notice-icons`), which also edits
`crates/ui/src/admin`: retarget to `main` once it merges.
The dashboard's components wrote three things out again and again:
- **Tables.** Each list repeated the same empty line, `table-wrap`,
`thead` and `tbody` around its rows: keys, deliveries, clients,
accounts, an account's sessions, invitations, announcements and audit
checkpoints. Now `data_table` takes the headings, the empty line and
whether there are rows, and each list writes only its rows.
- **Badges.** Seven places built a `(tone, label)` tuple and read it as
`.0` and `.1`. Now they return a named `Badge`, and the `badge`
component renders it. A client's listed status keeps its own match,
since a typed `ClientStatus` there is still an open decision.
- **Message fields.** The message page and the announcement form copied
the same subject and text inputs. Now both use `message_fields`, which
focuses the subject only on the message page, as before.
The alert card's own `badge` function becomes `alert_badge`, because the
component now has that name. `data_table`'s child makes the audit page's
view slightly larger, which pushed its render future over Clippy's
`large_futures` limit, so `web/admin/audit.rs` boxes that render, as the
dashboard does for its other large pages.
- Tests merged or removed: none.
- Files edited outside the Admin area: none.
- Proof that the markup is unchanged: a scratch test, not committed,
rendered 69 dashboard pages against the scratch database before and
after. Together with #593's change, this covered every list touched
here, filled and empty, the account page with its sessions, the message
page and the announcement form. After normalizing IDs, timestamps and
the order of rows created in the same instant, the HTML is identical. A
second scratch render in `sourceorigin-ui` covered the alert cards in
every state (needing attention, investigating, monitoring, cleared), the
previous alerts and the update fields' select. The output is
byte-identical.
Checks: `just fmt`; `cargo clippy -p sourceorigin-ui -p auth-service
--all-targets` with and without `--all-features` (`-D warnings`); `cargo
doc -D warnings -p sourceorigin-ui`; `cargo test --doc -p
sourceorigin-ui`; `just test -p sourceorigin-ui --all-features`; `just
db test -E 'test(/^web::admin::/)'`; `just rust unused`; `just docs
screenshots`: it rewrote only `admin/overview.png`, the known
nondeterministic one, and `account/data.png`, which is already stale on
`main` (its top bar lacks the search box and bell the settings pages now
have); neither page is touched here.
> [!NOTE]
> Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus
5.5 (via T3 Code)
<small>"The email starts with “Hello,” and ends with “SourceOrigin”. Separate paragraphs with a blank line. Links are written out in full: mail apps make them clickable."</small>
0 commit comments