Skip to content

feat(ui): admin console UX rework — foundation + worst screens#26

Open
bodaay wants to merge 1 commit into
masterfrom
ui/admin-console-rework
Open

feat(ui): admin console UX rework — foundation + worst screens#26
bodaay wants to merge 1 commit into
masterfrom
ui/admin-console-rework

Conversation

@bodaay

@bodaay bodaay commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Admin console UX rework (phase 1)

Reworks the existing admin console to fix the structural issues a code+visual UX review surfaced (78 findings; this PR tackles the foundation + the worst screens). No new pages — those are a deliberate follow-up. Every change was verified screen-by-screen by driving the live console in a headless browser.

Foundation (every screen benefits)

  • Accessible Modalrole="dialog"/aria-modal, Escape-to-close, Tab focus-trap, focus restore on close, autofocus first field. All dialogs inherit it.
  • Hardened api() — a mid-session 401 clears the key and bounces to login (global event) instead of spraying red toasts; non-JSON (proxy 502/HTML) responses surface a friendly message instead of a JSON parse crash.
  • Reusable ConfirmModal + a useResource() hook (consistent loading/error).

Shell

  • Hash routing — refresh-safe, deep-linkable, Back/Forward work (was plain useState, so refresh/idle-logout/401 always dumped you on Dashboard).
  • Sidebar nav grouped into Access / Directory / System.
  • Theme toggle shows the current theme; theme applied before first paint (no FOUC).

Screens

  • AppAuthzEditor (marquee fix) — the raw role_permissions JSON textarea + free-text roles → a structured editor: each role is a card with permission chips (datalist of known perms); assignments pick from defined roles only (valid by construction); removing a role strips it from assignments; dirty-guard on close.
  • Appsrotate-secret, delete, and enabling require_assignment now go through ConfirmModal with blast-radius warnings; busy states + success toasts (no more silent toggles); loading/error/empty states.
  • Users — wired the dead-end actions the backend already supported: Edit Profile (PUT /users/{guid}), Unlock + a "Locked" status badge (PUT /unlock), richer status, loading/error states.
  • style.css — defined --muted/--burgundy/--border, referenced ~30× by app.js but never defined (latent bug; previously inherited).

Verified (headless-browser screenshots)

Structured Authz editor, rotate-secret confirm with warning, grouped nav + theme label, Users detail + Edit Profile modal, Roles/Dashboard unregressed.

Deferred (follow-up)

User merge/unmerge (needs multi-select), DB backup/restore controls, and the new per-app-admins + app-local-users panels.

UI-only (ui/dist/*) — no Go/API changes; go build/go vet clean.

🤖 Generated with Claude Code

Reworks the EXISTING admin console (no new pages yet — those come next) to fix the
structural issues a code+visual UX review surfaced, verified screen-by-screen in a
headless browser.

Foundation (benefits every screen):
- Accessible Modal: role/aria-modal, Escape-to-close, Tab focus-trap, focus
  restore, autofocus the first field. Every dialog inherits it.
- Hardened api(): a mid-session 401 clears the key and bounces to login via a
  global event instead of spraying red toasts; non-JSON (proxy 502) responses
  surface a friendly message instead of a JSON parse crash.
- Reusable ConfirmModal + a useResource() hook for consistent loading/error.

Shell:
- Hash routing — refresh-safe, deep-linkable, Back/Forward work (was plain
  useState, so refresh / idle-logout / 401 always dumped you on Dashboard).
- Sidebar nav grouped into Access / Directory / System sections.
- Theme toggle shows the CURRENT theme; theme applied before first paint (no FOUC).

Screens reworked:
- AppAuthzEditor (the marquee fix): replaced the raw role_permissions JSON
  textarea + free-text roles with a structured editor — each role is a card with
  permission chips (datalist of known perms); assignments pick from DEFINED roles
  only (valid by construction); removing a role strips it from assignments;
  dirty-guard prevents accidental discard.
- Apps: rotate-secret, delete, and ENABLING require_assignment now go through
  ConfirmModal with blast-radius warnings; busy states + success toasts so toggles
  aren't silent; loading/error/empty states.
- Users: wired the dead-end actions the backend already supported — Edit Profile
  (PUT /users/{guid}), Unlock + a "Locked" status badge (PUT /unlock), richer
  status, and loading/error states.
- style.css: defined --muted / --burgundy / --border, which app.js referenced
  ~30x but were never defined (latent bug — previously fell back to inherited
  colors).

Deferred to a follow-up: user merge/unmerge (needs a multi-select), DB
backup/restore controls, and the new per-app-admins + app-local-users panels.

UI-only (ui/dist/*); no Go/API changes. go build / go vet clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant