mirror of
https://github.com/azaion/ui.git
synced 2026-06-21 18:51:10 +00:00
510df68bcf
Captures the full output of autodev existing-code Phase A through Step 4 (Code Testability Revision) for the Azaion UI workspace: - Step 1 Document: _docs/02_document/ (FINAL_report, architecture, glossary, components/, modules/, diagrams/, system-flows, module-layout) plus _docs/00_problem/ + _docs/01_solution/ + _docs/legacy/ + _docs/how_to_test + README. - Step 2 Architecture Baseline: architecture_compliance_baseline.md. - Step 3 Test Spec: _docs/02_document/tests/ (environment, test-data, blackbox/performance/resilience/security/ resource-limit tests, traceability-matrix), enum_spec_snapshot, expected_results/results_report.md (98 rows), plus the run-tests.sh + run-performance-tests.sh runners. - Step 4 Code Testability Revision: 01-testability-refactoring/ run dir (list-of-changes C01-C07, deferred_to_refactor, analysis/research_findings + refactoring_roadmap) and the 7 child task specs AZ-448..AZ-454 under _docs/02_tasks/todo/ plus _dependencies_table.md. - _docs/_autodev_state.md pins the cursor at Step 4 / refactor Phase 4 entry so /autodev resumes cleanly. Epic AZ-447 (UI testability gates) tracks the 7 child tasks that will land in subsequent commits. Co-authored-by: Cursor <cursoragent@cursor.com>
3.8 KiB
3.8 KiB
Modules: src/App.tsx + src/main.tsx
Compact combined doc — both modules are tiny, top-of-tree wiring only.
src/main.tsx (entry)
Mounts the React tree:
- Calls
createRoot(document.getElementById('root')!)— the non-null assertion will throw at boot if<div id="root">is missing fromindex.html(it is present). - Wraps in
<StrictMode>(double-renders effects in dev) and<BrowserRouter>(HTML5 history). - Imports
./i18n/i18nfor side effects only — that file callsi18n.init({...})at import time. Seesrc__i18n__i18n.mdfor the locked-language finding (lng:'en' hardcoded). - Imports
./index.css— the Tailwind 4 stylesheet plus theaz-*token definitions consumed by every component.
No props, no state, nothing testable.
src/App.tsx (route tree)
Top-level routes:
| Path | Element | Notes |
|---|---|---|
/login |
<LoginPage /> |
Public; outside auth + flight providers. |
/* |
<ProtectedRoute><FlightProvider><Header />...nested Routes...</FlightProvider></ProtectedRoute> |
Auth-gated container. Mounts Header once across all child routes. |
/flights |
<FlightsPage /> |
(default redirect target) |
/annotations |
<AnnotationsPage /> |
|
/dataset |
<DatasetPage /> |
|
/admin |
<AdminPage /> |
(no extra role gate — see Findings) |
/settings |
<SettingsPage /> |
(no extra role gate — see Findings) |
* |
<Navigate to="/flights" replace /> |
catch-all under the protected branch. |
Outside everything: <AuthProvider>. So:
LoginPagecan calluseAuth().FlightProvideronly mounts afterProtectedRoutehas confirmed an authenticated user —FlightContextqueries/api/flightsonly once we know we're logged in. This avoids the 401-then-401-loop on first paint.
Layout: flex flex-col h-screen — header at top, content fills the rest with overflow-hidden. Each page owns its own scroll/resize.
Findings carried into Step 4 / 6
/adminis reachable by users without ADM permission (defence-in-depth gap):App.tsx:30route has no permission check.Header.tsx:88filters menu visibility viahasPermission('ADM'), but typing/admindirectly bypasses the menu hide. Users without ADM see a partially-working Admin page until the server returns 403 on each write. Per parent../../../../_docs/00_roles_permissions.mdonly Admin / ApiAdmin holds ADM. PRIORITY for Step 4. Note:/settingsis similarly ungated, but_docs/00_roles_permissions.mddoes NOT define aSETTINGSpermission code — settings calls land on/api/admin/...endpoints which are server-enforced by ADM via 403. Open question for Step 6: should/settingsalso be ADM-gated client-side, or is the per-user-settings subset (/api/admin/users/me/settings) intended to be reachable by non-admins?- No
<ErrorBoundary>wrapping the protected branch: a render error inside any page crashes the whole tree. Step 4 / Step 8. - No lazy-loading of route chunks (
React.lazy/Suspense). The whole app bundles in one chunk. For now the bundle is small enough that this is acceptable — Step 8 candidate when bundle size grows. - Default redirect target is
/flightseven for users whose primary task is annotations or dataset. Could be a per-role default landing page. Step 6.
(Earlier draft of this doc claimed there was no mobile bottom-nav — that was incorrect. Header.tsx:113-129 does render a bottom-nav at < sm. The whole-app flex flex-col h-screen layout is the same at all breakpoints by design.)
Tests
None.
Cross-doc references
src__main_tsx(this doc) ← entry; depended-upon by all others transitively.src/auth/AuthContext.tsx,src/auth/ProtectedRoute.tsx— already documented.src/components/FlightContext.tsx,src/components/Header.tsx— already documented.- Parent roles spec:
../../../../_docs/00_roles_permissions.md.