Skip to content

refactor(cli): remove generated /admin console shell from site generator#86

Merged
rrrodzilla merged 2 commits into
mainfrom
dev
May 29, 2026
Merged

refactor(cli): remove generated /admin console shell from site generator#86
rrrodzilla merged 2 commits into
mainfrom
dev

Conversation

@rrrodzilla
Copy link
Copy Markdown
Contributor

Summary

The runtime-dynamic admin console (the old /admin/* shell — schema catalog, generic CRUD, user management) moves to the standalone schemaforge-console repo, where it ships as versioned packages so a fix reaches every operator via a bump instead of a regenerate-and-redeploy. The CLI's site generate command stays and still emits the /app/* typed scaffold, the login page, the accessibility page, and the generated client.

Scope was deliberately narrow: remove only the /admin/* shell, keep everything /app/*. No backend changes — serve/bootstrap-admin/--admin-user seed the initial auth user, never served the console UI.

Changes

  • Delete templates/site/src/admin/ (9 jinja files) and the ADMIN_TEMPLATES const + emit loop in commands/site/mod.rs.
  • Relocate the helpers the kept /app shell still needs out of the deleted admin client into generated/api-client.ts.jinja: listSchemas, isSystemSchema, a minimal SchemaResponse/ListSchemasResponse (the sidebar nav stays runtime read-access-filtered, not a static list), and getMeta/MetaResponse (login branding).
  • Rewire App.tsx: drop the Admin sidebar section, the admin-permissions query, the AdminLayout import and the /admin/* route; repoint the home, tenant-switch, and search redirects to `/app/${defaultEntity}` (already exported by the route manifest).
  • Point login.tsx at the generated client; tidy stale admin wording in route-manifest, accessibility, and auth.ts.
  • Tests: site_generate.rs now asserts no src/admin/ is emitted and the home redirect targets /app/; site_e2e smoke + a11y specs repointed to /app/* (the /app scaffold has no delete or user-management UI — those moved to the console).
  • Docs: docs/site-guide.md, README.md, Taskfile.yml admin-console references dropped with a pointer to schemaforge-console; fixed a broken See also link and a stale index.html page-title claim.

Verification

  • cargo nextest run -p schema-forge-cli334/334 pass (including the rewritten generator assertions)
  • cargo clippy -p schema-forge-cli --all-targetsclean
  • Regenerated site/ from the demo schemas: no src/admin/ dir, zero @/admin / /admin references, all relocated helpers present, login + App.tsx rewired
  • tsc build resolves every relocation and redirect in this change

Pre-existing issues (NOT addressed here, unrelated to this change)

  1. Workspace cargo fmt drift — rustfmt 1.8.0 reports 63 CLI-crate diffs in files this PR never touches (e.g. cli.rs). Deliberately not folded in to keep this diff focused.
  2. tsc error in the generated siteApp.tsx's <Toaster toastOptions={{ ariaLive }}> is invalid for the installed sonner version (present in main too). Left alone because it sits in the WCAG 4.1.3 a11y-rationale block.

The runtime-dynamic admin console moves to the standalone
schemaforge-console repo (versioned packages so a fix reaches every
operator via a bump, not a regenerate+redeploy). The CLI's `site
generate` command stays and still emits the `/app/*` typed scaffold,
login, accessibility page, and generated client.

- Delete templates/site/src/admin/ (9 jinja files) and the
  ADMIN_TEMPLATES const + emit loop in commands/site/mod.rs.
- Relocate the helpers the kept /app shell still needs out of the
  admin client into generated/api-client.ts.jinja: listSchemas,
  isSystemSchema, minimal SchemaResponse/ListSchemasResponse (the
  sidebar nav stays runtime read-access-filtered) and getMeta/
  MetaResponse (login branding).
- Rewire App.tsx: drop the Admin sidebar section, admin-permissions
  query, AdminLayout import and /admin/* route; repoint the home,
  tenant-switch, and search redirects to /app/${defaultEntity}.
- Point login.tsx at the generated client; tidy stale admin wording.
- site_generate.rs asserts no src/admin/ is emitted and the home
  redirect targets /app/; site_e2e smoke + a11y specs repointed to
  /app/* (the /app scaffold has no delete or user-management UI).
- Docs/Taskfile/README: drop admin-console references with a pointer
  to schemaforge-console; fix a broken link and a stale page title.
The /app list toolbar's filter-field <select> had no accessible name,
tripping axe's critical `select-name` rule (WCAG 4.1.2 / 1.3.1). The
old e2e a11y walk only scanned the removed /admin shell, so the gap was
never covered; repointing the scan to /app/* surfaced it.

Add `aria-label="Filter field"` to the select (matching the existing
"Rows per page" select) and `aria-label="Filter value"` to the filter
input, whose placeholder alone is not a robust accessible name.
@rrrodzilla rrrodzilla merged commit e9d61ec into main May 29, 2026
1 check passed
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