Clean frontend app entrypoint
This commit is contained in:
@@ -7,6 +7,13 @@
|
||||
|
||||
# Changelog
|
||||
|
||||
## Sprint 42 App entrypoint cleanup (2026-06-17)
|
||||
|
||||
- Removed the stale `FormEvent`/`useState` React imports from `frontend/src/App.tsx`.
|
||||
- Removed the UTF-8 BOM from the frontend entrypoint so future text patches and static checks are stable.
|
||||
- Added a regression test that keeps `App.tsx` free of the stale imports and BOM.
|
||||
- No behavior, API contracts, migrations, provider fetching or AI behavior changed.
|
||||
|
||||
## Sprint 41 Demo workflow hook decomposition (2026-06-17)
|
||||
|
||||
- Moved offline demo workflow orchestration from `App.tsx` into `frontend/src/hooks/useDemoWorkflow.ts`.
|
||||
|
||||
@@ -27,6 +27,17 @@ def test_app_uses_shared_orchestration_hooks() -> None:
|
||||
assert "externalApi" not in app
|
||||
|
||||
|
||||
def test_app_entrypoint_has_clean_encoding_and_react_imports() -> None:
|
||||
app_path = ROOT / "frontend" / "src" / "App.tsx"
|
||||
app_bytes = app_path.read_bytes()
|
||||
app = app_path.read_text(encoding="utf-8")
|
||||
|
||||
assert not app_bytes.startswith(b"\xef\xbb\xbf")
|
||||
assert "import { useEffect, useMemo } from 'react'" in app
|
||||
assert "FormEvent" not in app
|
||||
assert "useState" not in app
|
||||
|
||||
|
||||
def test_demo_workflow_hook_owns_demo_api_and_cross_module_selection() -> None:
|
||||
hook = (ROOT / "frontend" / "src" / "hooks" / "useDemoWorkflow.ts").read_text(encoding="utf-8")
|
||||
|
||||
|
||||
@@ -1,3 +1,32 @@
|
||||
## Sprint 42 App entrypoint cleanup (2026-06-17)
|
||||
|
||||
Changed:
|
||||
- Removed the stale `FormEvent`/`useState` React imports from `frontend/src/App.tsx`.
|
||||
- Removed the UTF-8 BOM from `App.tsx` so patches and static checks use normal UTF-8 text.
|
||||
- Added a regression test that verifies the clean entrypoint encoding and React import set.
|
||||
- Recorded the current `App.tsx` size audit: 622 lines after the orchestration hook decomposition passes.
|
||||
|
||||
Validation:
|
||||
- `cd backend && python -m pytest tests/test_sprint39_frontend_orchestration_hooks.py -q` passed: 8 tests.
|
||||
- `python -m compileall backend/app` passed.
|
||||
- `cd backend && python -m pytest -W error::DeprecationWarning` passed: 192 tests.
|
||||
- `bash scripts/run_readiness_check.sh` passed.
|
||||
- `cd frontend && npm run typecheck` passed.
|
||||
- `cd frontend && npm run build` passed.
|
||||
- `cd backend && python -m alembic heads` passed: `202606120900 (head)`.
|
||||
- `cd backend && python -m alembic upgrade head --sql` passed.
|
||||
- `bash -n scripts/live_migration_smoke.sh` passed.
|
||||
|
||||
Open:
|
||||
- Tower deployment and runtime smoke should run before considering this pass deployed.
|
||||
|
||||
Limitations:
|
||||
- No UX behavior, API contracts, migrations, provider fetching or AI behavior changed.
|
||||
- `App.tsx` remains a large composition root; the remaining size is primarily panel wiring and hook outputs.
|
||||
|
||||
Next recommended pass:
|
||||
- Optional bootstrap-effect extraction if another no-behavior size reduction is useful.
|
||||
|
||||
## Sprint 41 Demo workflow hook decomposition (2026-06-17)
|
||||
|
||||
Changed:
|
||||
|
||||
+2
-1
@@ -54,7 +54,8 @@ This file now starts with the current implementation status. Older preparation/b
|
||||
- [x] Provider, change-detection and map-workspace orchestration hook decomposition.
|
||||
- [x] Project/area/dataset cross-load orchestration hook decomposition.
|
||||
- [x] Demo workflow orchestration hook decomposition.
|
||||
- [ ] Final `App.tsx` import/encoding cleanup and size audit.
|
||||
- [x] Final `App.tsx` import/encoding cleanup and size audit.
|
||||
- [ ] Optional final bootstrap-effect extraction if `App.tsx` orchestration needs another size reduction.
|
||||
|
||||
## Sprint 8 status
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FormEvent, useEffect, useMemo, useState } from 'react'
|
||||
import { useEffect, useMemo } from 'react'
|
||||
import './styles/app.css'
|
||||
import { ChangeDetectionPanel } from './components/analysis/ChangeDetectionPanel'
|
||||
import { DatasetDetailPanel } from './components/datasets/DatasetDetailPanel'
|
||||
|
||||
Reference in New Issue
Block a user