Skip to content

feat(console): real-mode nav/route gating (hide no-backend screens) #68

Description

@hitakshiA

Epic: #58 · Step B (Real-mode nav/route gating) — the last step.

Now that the backend-backed features are wired (auth #60, onboarding #63, treasury #65, payroll #66), make real mode honest: expose only the screens that actually talk to the eERC backend, and keep the full console in demo mode as the product vision. This is a gating/routing change — no new feature work.

Which screens have a real backend (KEEP in real mode)

  • Treasury (/treasury) — org-scoped, wired.
  • Payroll (/payroll) — run lifecycle, wired.
  • Settings & team (/settings) — PARTIAL: keep the org info + team/members (backed by /orgs/:id/members); hide the no-backend cards inside it (integrations, approval policies) in real mode.
  • Onboarding is the entry (already gated by RootGate).

No backend → hide in real mode (stay demo-only)

Overview/Dashboard (/), Contractors (/contractors), Invoices (/invoices), Approvals (/approvals), Auditor access / Grants (/grants), Audit log (/audit), and Pay / one-off payment (/pay — the screen whose per-account balance was stubbed in #65; no /payments engine exists). These render from demo stubs only.

Changes

  • app/Shell.tsx — the sidebar NavItems are filtered by mode: in real mode (!DEMO_MODE) render only the KEEP set (Treasury, Payroll, Settings); demo mode renders the full set unchanged. Do the same for any command-palette list in app/CommandBar.tsx.
  • Routes — in real mode, the hidden screens' routes must not render a broken screen: redirect them to the real-mode default (/treasury). Keep all routes in demo mode. (Find the route table — likely in Shell.tsx or an App/router file — and gate it on DEMO_MODE.)
  • Real-mode landing — default/index route resolves to Treasury in real mode (Overview has no backend). Demo keeps Overview as the landing.
  • screens/Settings.tsx — in real mode, render only the backed sections (org, team/members); hide the integrations + approval-policy cards. Demo shows all.
  • Prefer a single small helper (e.g. an exported REAL_MODE_ROUTES/isRealBackedRoute or a navItems array filtered by DEMO_MODE) over scattering DEMO_MODE checks. Keep it obvious and centralized.

Non-goals

Don't delete the hidden screens or their demo data — they must still work under VITE_DEMO_MODE=1. Don't build a real Overview/dashboard (no backend for it) — just land on Treasury in real mode. No changes to the wired features themselves.

Definition of done

  • Real build (pnpm --filter @benzo/console build, no demo flag): nav shows only Treasury / Payroll / Settings; visiting /contractors, /invoices, /approvals, /grants, /audit, /pay, / redirects to /treasury.
  • Demo build (VITE_DEMO_MODE=1): full nav + all screens exactly as today.
  • Add/extend a test asserting the real-mode nav set and a redirect (e.g. /invoices/treasury when !DEMO_MODE).
  • Gates: typecheck · test · build · VITE_DEMO_MODE=1 build · pnpm exec biome lint . all green.

Operating rules

No git (can't commit). Match the codebase style. End with (1) a one-line conventional-commit message and (2) the exact git add <paths> list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions