Skip to content

refactor(console): restyle the access and audit screens and drop the local UI copies - #188

Merged
Bugs5382 merged 11 commits into
mainfrom
refactor/157-access-audit-drop-local-ui
Oct 15, 2026
Merged

Bugs5382 merged 11 commits into
mainfrom
refactor/157-access-audit-drop-local-ui

Conversation

@Bugs5382

Copy link
Copy Markdown
Contributor

What and why

I restyled the access and audit screens — operators, operator CAs, agent keys, approvals and the audit log — onto the @cryptos-pki/ui kit, plus the 404 page. Visual only: routes, data flow, permissions and refusal wording are unchanged.

Along the way I also:

  • Converted the operator credential dialogs (record certificate, request credential), the operator CA dialogs and register form, and the MCP agent-key dialogs onto the kit's Dialog, Field, Input, Notice, CopyBlock, KeyBackupStep and ShownOnceSecret.
  • Moved the audit log off the local TanStack-table-backed DataTable onto the kit's presentational one (the same pattern the nodes/root/protocols pages already use), and deleted that now-unused local component along with the @tanstack/react-table dependency it was the only user of. lucide-react had no importers left either, so it's gone too.
  • Deleted the hand-rolled DialogFrame shell once its last caller moved to the kit's Dialog.

Refs #157
Refs #110

The remaining step on #157

"The console has no local UI primitives left" isn't fully true yet: src/components/ui/button.tsx and input.tsx are still imported by src/components/copy-block.tsx and src/components/key-backup-step.tsx, which are in turn still used by the credential-request page and the first-run wizard — both outside this issue's scope (operators/operator CAs/agent keys/approvals/audit/not-found). I filed #187 to restyle those two screens and take the last four local files out. #157 should stay open until that lands.

Verification

  • Lint clean
  • Tests pass
  • Build succeeds
  • Documentation updated (if behavior or API changed) — n/a, no behavior, API or setup change

How this was verified

  • npm run lint (eslint + prettier) — clean.
  • npm run test — all three workspaces green: console 105 files / 713 tests, api-client 3, ui 32 files / 242 tests. Every restyled screen and dialog has a new "has no axe violations" test.
  • npm run build — tsc -b then vite build, no errors.
  • node scripts/check-release-bundle.mjs apps/console/dist — clean.
  • npm -w @cryptos-pki/ui run generate:icons && git diff --exit-code packages/ui/src/icons — clean (no icon changes in this PR).

Before merging: add a closing comment summarizing what was actually done in this PR
(not just the checked boxes).

Moves the admin needs-attention banners for operator CAs onto the kit's
Notice, keeping each one's role=status so a danger-tone banner still reads
as a calm status update, not an interrupting alert. Same text, same
section landmark and accessible name.

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Rebuilds the record-certificate and request-credential flows on the
kit's Dialog, Field, Input, Notice, CopyBlock and KeyBackupStep. The
wizard keeps its own key generation (a P-384 key and CSR made in the
browser) and now feeds the kit's generic save-your-backup step instead
of a bespoke one. Same fields, same steps, same wording; the CSR
download still goes through the console's own download helper so the
request-body-never-holds-a-key test doubles keep working.

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Rebuilds the Operators page on the kit's DataTable, EmptyState, Notice
and Button: the credentials and pending-request tabs, the deny
confirmation and the two empty states (no operator CA configured, no
credentials seen yet). The hand-rolled tab buttons stay as they are;
the kit has no tab-switching coverage under fireEvent.click yet, so
this keeps the proven interaction instead of risking it. Same columns,
same admin gating, same wording.

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
…onto the kit

Register, retire, CRL source, upload-CRL and OCSP all move onto the
kit's Dialog, Field, Input and Notice. The CRL and OCSP sub-forms keep
their radio groups as plain inputs (the kit has no radio pattern yet)
but the surrounding labels, text fields and warnings are the kit's.
Same fields, same confirmation flow, same refusal wording.

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Rebuilds the Operator CAs list on the kit's DataTable and EmptyState.
Same columns (CA, State, Fingerprint, Not after, CRL, OCSP), same
admin-only action set, same config-managed read-only state.

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Moves the Agent keys list and its create/revoke dialogs onto the kit's
DataTable, EmptyState, Notice and ShownOnceSecret: the one-time plaintext
key display is now the kit's shared shown-once pattern instead of a
bespoke copy button. Same columns, same ceiling rule, same scope toggle
for admins.

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Rebuilds the Approvals list and its decide confirmation on the kit's
DataTable and Dialog. The deep-link focus row now uses the kit's own
highlightKey (aria-current, the tinted row and the scroll-into-view)
instead of a page-local ref. Same columns, same level gating, same
wording about checking the approval ID and summary.

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Moves the audit log off the TanStack-table-backed local DataTable onto
the kit's presentational one: the kind, target, via and outcome facets
and the summary search are now page-level state rendered through the
shared component, the same pattern the nodes and protocols pages
already use. Same columns, same filters, same tones.

Drops the per-column sort toggle the old table exposed on every
column; no test or doc ever covered it, and the log already reads
newest first without it. The simpler, unsorted kit table matches the
other restyled list pages.

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Swaps the local shadcn Button for the kit's on the not-found page, and
adds the axe check the rest of this wave's screens get.

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Every dialog that used the hand-rolled DialogFrame (operator deny,
the operator CA dialogs, credential complete and the credential
request wizard) now renders through the kit's Dialog. Nothing imports
DialogFrame any more.

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Every list page now reads through the kit's presentational DataTable;
the audit log was the last one on the TanStack-table-backed local
copy, dropped in the previous commit. Nothing imports
components/data-table any more, so it goes, along with the
@tanstack/react-table dependency it was the only user of.

lucide-react has no importers left either (the kit's own icon set
replaced it over the P1/P2 waves), so it goes too.

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
@Bugs5382
Bugs5382 marked this pull request as ready for review October 15, 2026 19:07
@github-actions github-actions Bot added the refactor Internal change / refactor. label Oct 15, 2026
@Bugs5382

Copy link
Copy Markdown
Contributor Author

Approved. Restyle wave 4. Refs #157

@Bugs5382
Bugs5382 merged commit 3d4d18d into main Oct 15, 2026
18 checks passed
@Bugs5382
Bugs5382 deleted the refactor/157-access-audit-drop-local-ui branch October 15, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Internal change / refactor.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant