Skip to content

feat(layout): add config-only mode for non-technical admin UIs#75

Merged
zeevdr merged 3 commits into
mainfrom
feat/config-only-mode
May 31, 2026
Merged

feat(layout): add config-only mode for non-technical admin UIs#75
zeevdr merged 3 commits into
mainfrom
feat/config-only-mode

Conversation

@zeevdr

@zeevdr zeevdr commented May 31, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds LAYOUT_MODE=config-only for non-technical admin UIs that should feel like a product settings page — the landing page is the config editor for a pre-selected tenant, with no schema or tenant navigation.
  • Guards against accidental superadmin access by defaulting to the admin role and filtering superadmin out of the debug role selector in this mode.
  • Uses a separate ConfigOnlyLayout (header-only, no sidebar) with its own route tree to avoid path conflicts with the full-featured Layout.

Test plan

  • LAYOUT_MODE=config-only TENANT_ID=<uuid> — landing page redirects to /tenants/<uuid> (no sidebar, header shows logo + app name + dark mode toggle)
  • Role dropdown in debug bar shows only admin and user (no superadmin)
  • Stale superadmin session in localStorage is capped to admin on load
  • LAYOUT_MODE=full — all existing routes and sidebar unaffected
  • LAYOUT_MODE=embed — embed layout unaffected
  • All 24 unit tests pass (npx vitest run)

Closes #11

Adds a new LAYOUT_MODE=config-only that lands directly on the config
editor for a pre-selected tenant, with no sidebar navigation and no
superadmin role option. Intended for demo admin panels that should feel
like a product settings page rather than a developer tool.

- ConfigOnlyLayout: header-only shell (logo, app name, debug bar, dark
  mode toggle) with no sidebar
- Auth: defaults to admin role in config-only mode; caps any stored
  superadmin session to admin on load
- AuthBar: filters superadmin from the role dropdown in config-only mode
- App routing: config-only mode gets its own route tree to avoid
  conflicting with the full Layout's /tenants/:id routes

Closes #11

Co-Authored-By: Claude <noreply@anthropic.com>
@zeevdr zeevdr added this to the Beta Readiness milestone May 31, 2026
@zeevdr zeevdr added size: M Moderate — a day or two, clear scope priority: P2 Nice-to-have labels May 31, 2026
@codecov

codecov Bot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

zeevdr and others added 2 commits May 31, 2026 09:23
Adds unit tests for the new config-only branches in loadAuth (superadmin
cap, default role fallback) and a render test for ConfigOnlyLayout
(header identity, no sidebar nav) to satisfy the Codecov patch threshold.

Co-Authored-By: Claude <noreply@anthropic.com>
Covers the new config-only routing branch and the re-indented standard
Layout routes in App.tsx, bringing App.tsx branch coverage to 100% and
pushing patch coverage above the Codecov 80% threshold.

Co-Authored-By: Claude <noreply@anthropic.com>
@zeevdr zeevdr merged commit ae3c18d into main May 31, 2026
10 checks passed
@zeevdr zeevdr deleted the feat/config-only-mode branch May 31, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: P2 Nice-to-have size: M Moderate — a day or two, clear scope

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config-only mode: land directly on config editor

1 participant