refactor(cli): remove generated /admin console shell from site generator#86
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The runtime-dynamic admin console (the old
/admin/*shell — schema catalog, generic CRUD, user management) moves to the standaloneschemaforge-consolerepo, where it ships as versioned packages so a fix reaches every operator via a bump instead of a regenerate-and-redeploy. The CLI'ssite generatecommand 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-userseed the initial auth user, never served the console UI.Changes
templates/site/src/admin/(9 jinja files) and theADMIN_TEMPLATESconst + emit loop incommands/site/mod.rs./appshell still needs out of the deleted admin client intogenerated/api-client.ts.jinja:listSchemas,isSystemSchema, a minimalSchemaResponse/ListSchemasResponse(the sidebar nav stays runtime read-access-filtered, not a static list), andgetMeta/MetaResponse(login branding).App.tsx: drop the Admin sidebar section, the admin-permissions query, theAdminLayoutimport and the/admin/*route; repoint the home, tenant-switch, and search redirects to`/app/${defaultEntity}`(already exported by the route manifest).login.tsxat the generated client; tidy stale admin wording inroute-manifest,accessibility, andauth.ts.site_generate.rsnow asserts nosrc/admin/is emitted and the home redirect targets/app/;site_e2esmoke + a11y specs repointed to/app/*(the/appscaffold has no delete or user-management UI — those moved to the console).docs/site-guide.md,README.md,Taskfile.ymladmin-console references dropped with a pointer toschemaforge-console; fixed a brokenSee alsolink and a staleindex.htmlpage-title claim.Verification
cargo nextest run -p schema-forge-cli— 334/334 pass (including the rewritten generator assertions)cargo clippy -p schema-forge-cli --all-targets— cleansite/from the demo schemas: nosrc/admin/dir, zero@/admin//adminreferences, all relocated helpers present, login + App.tsx rewiredtscbuild resolves every relocation and redirect in this changePre-existing issues (NOT addressed here, unrelated to this change)
cargo fmtdrift — 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.tscerror in the generated site —App.tsx's<Toaster toastOptions={{ ariaLive }}>is invalid for the installed sonner version (present inmaintoo). Left alone because it sits in the WCAG 4.1.3 a11y-rationale block.