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>
4.5 KiB
00 — Foundation
1. High-Level Overview
Purpose: Pure leaf modules every other component depends on — TypeScript domain types, framework-agnostic React hooks, and i18next setup. No HTTP, no React tree, no business logic.
Architectural Pattern: Foundation / shared kernel.
Upstream dependencies: none (intra-repo). External: i18next, react-i18next, react.
Downstream consumers: every other src/ component.
2. Internal Interfaces
src/types/index.ts
| Export | Kind | Purpose |
|---|---|---|
DetectionClass, Annotation, Affiliation, CombatReadiness, AnnotationStatus, AnnotationSource, MediaStatus, Flight, Waypoint, DatasetItem, User, Permission, etc. |
type / enum | Shared domain shape used by api/, providers, and every feature page. |
CAVEAT — cross-cutting Step 4 work. State.json records 4 enum-drift findings against the parent suite spec (
AnnotationStatus,Affiliation,CombatReadiness,MediaStatus) plus aWaypointshape mismatch. Owner of fix: this single file. The full target shapes live in_docs/02_document/modules/src__features__annotations.mdfindings #27–34 andsrc__features__flights.mdfinding #20.
src/hooks/useDebounce.ts
| Export | Signature | Purpose |
|---|---|---|
useDebounce<T>(value: T, delay: number): T |
hook | Debounced value mirror. Used by Annotations search and Dataset filters. |
src/hooks/useResizablePanel.ts
| Export | Signature | Purpose |
|---|---|---|
useResizablePanel(initialWidth: number, opts): { width, dragHandleProps } |
hook | Mouse-drag-resizable side panel. Used by Annotations and Dataset pages. Width is not persisted (finding #11 in src__features__annotations.md). |
src/i18n/i18n.ts
| Export | Kind | Purpose |
|---|---|---|
| (default side-effect) | i18next init | Loads en.json + ua.json, wires react-i18next. Imported once by main.tsx for its side effect. |
CAVEAT.
lng: 'en'is hardcoded; no language detector or persistence.ua.jsonexists as a translation target but is not selectable at runtime (finding #1 insrc__i18n__i18n.md). This is a Step 4 testability/configurability fix.
5. Implementation Details
| Module | Notes |
|---|---|
types/index.ts |
Plain TypeScript. No runtime code. |
useDebounce |
setTimeout + clearTimeout in useEffect. |
useResizablePanel |
mousemove listener attached to window while dragging; min/max width clamped. |
i18n/i18n.ts |
i18next + ICU plurals. Bundles loaded synchronously (small JSONs, ~100 keys each). |
State Management: Stateless apart from the local hook state inside useDebounce / useResizablePanel. i18next's instance is module-level.
Key Dependencies:
| Library | Version | Purpose |
|---|---|---|
i18next |
(per package.json) |
Translation engine |
react-i18next |
(per package.json) |
React bindings; consumed via useTranslation in features |
react |
19 | Hooks runtime |
7. Caveats & Edge Cases
- Enum drift findings (cross-cutting). See state.json notes 2026-05-10 02:01Z and 02:13Z. Step 4 must reconcile against .NET service before patching
types/index.ts. i18ninit is synchronous; if either bundle fails to load the app crashes at startup. No fallback.useResizablePaneldoes not persist user-chosen width; resets every page nav.
8. Dependency Graph
Must be implemented after: nothing (Layer 0).
Can be implemented in parallel with: itself (the 4 modules are independent).
Blocks: every other component in this workspace.
6. Extensions and Helpers
features/annotations/classColors.ts was originally drafted as part of 06_annotations, but per the Step 2 BLOCKING gate it has been lifted into its own component, 11_class-colors (sibling shared kernel — see components/11_class-colors/description.md). The physical file location is unchanged — only the conceptual ownership moved. The proper physical home (a src/shared/ or src/components/detection/ directory) is deferred to Step 2.5 / Step 4 / Step 8.
Module Inventory
| Path | Module Doc |
|---|---|
src/types/index.ts |
_docs/02_document/modules/src__types__index.md |
src/hooks/useDebounce.ts |
_docs/02_document/modules/src__hooks__useDebounce.md |
src/hooks/useResizablePanel.ts |
_docs/02_document/modules/src__hooks__useResizablePanel.md |
src/i18n/i18n.ts |
_docs/02_document/modules/src__i18n__i18n.md |