Frontend Surface Ownership Map
Goal
Define canonical ownership for user, org-admin, and super-admin frontend surfaces before deleting any duplicate routes or components.Current Route Surfaces
frontend/src/app/dashboard/page.tsx- Primary user-facing communication dashboard route.
- Owns user self-service analytics view.
frontend/src/app/chat/page.tsx- Primary user simulation/chat runtime route.
- Composes user dashboard widgets from
components/dashboard/*.
frontend/src/app/org-admin/page.tsx- Primary organization admin route.
- Renders
OrgAdminPageContainerfromfeatures/org-admin, which mountsOrgDashboard.
frontend/src/app/admin/page.tsx- Primary super-admin route.
- Owns cross-organization and system-level management surfaces.
- Reuses
OrgDashboardfromfeatures/org-adminwhen super admin drills into selected org.
Current Component Ownership
frontend/src/components/admin/*- Super-admin-only management modules (users, organizations, workdays, analytics, logs, health, simulation).
frontend/src/components/dashboard/*- User-facing dashboard widgets (personal metrics, tasks, messages, etc.).
frontend/src/features/org-admin/*- Canonical org-admin UI:
OrgDashboard, org chrome, simulation entry from org context, org admin guard hook.
- Canonical org-admin UI:
components/dashboard/ and legacy components/org-admin/ has been removed.
Overlap and Risk Areas
- Role-surface overlap:
admin/page.tsximports both super-admin modules and org dashboard module. - Naming overlap:
components/dashboard/*hosts user widgets; avoid adding org-admin-specific modules there—usefeatures/org-admin.
Canonical Ownership Rules (current)
- Super-admin pages: route under
app/admin/*, components undercomponents/admin/*. - Org-admin pages: route under
app/org-admin/*, implementation underfeatures/org-admin/*. - User pages: routes under
app/chatandapp/dashboard, components undercomponents/dashboard/*.
Test Placement Convention (enforced)
- Frontend tests are colocated (
*.test.tsx,*.integration.test.tsx). - New
__tests__/trees are disallowed for frontend source. - Enforcement contract:
tests/contract/test_repo_structure_hygiene.py.
Migration Order (No Behavior Change)
- Keep route contracts stable (
/admin,/org-admin,/dashboard,/chat). - Prefer new org-admin UI work in
features/org-admin; re-export from there if a shared entry is needed elsewhere. - Rename/refactor user-only dashboard widgets explicitly (avoid mixing org-admin concerns into
components/dashboard/). - Preserve stable route contracts and avoid duplicate admin entrypoints.
Deletion Criteria
- Any deprecated component path removable only after:
- no imports in runtime/test code,
- no docs references,
- no role-regression in admin/org-admin routing smoke tests.