You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4.4 KiB
4.4 KiB
Frontend Audit Report (Partial)
Scope and limits
- Audited
frontend/srcagainst:/Users/oabrivard/Projects/rust/ai_synth/docs/requirements.md/Users/oabrivard/Projects/rust/ai_synth/docs/functional_specs.md/Users/oabrivard/Projects/rust/ai_synth/docs/technical_specs.md/Users/oabrivard/Projects/rust/ai_synth/docs/dev_guidelines.md
- Validation:
tsc --noEmitpassedvitestblocked by missing optional package@rollup/rollup-darwin-x64
Clarification Questions
- Should fallback category label be
Autre(functional spec) orDivers(current behavior)? - Is the "use
Buttoncomponent instead of raw<button>" rule strict or only for primary actions?
Prioritized Findings
P1
-
Article history filter values are out of contract with documented statuses/source types.
- Evidence:
/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/ArticleHistory.tsx:18,/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/ArticleHistory.tsx:28,/Users/oabrivard/Projects/rust/ai_synth/docs/technical_specs.md:249,/Users/oabrivard/Projects/rust/ai_synth/docs/technical_specs.md:251 - Direction: centralize allowed enums and mirror backend contract.
- Evidence:
-
i18n guideline is violated by hardcoded French strings in JSX/logic.
- Evidence:
/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/ArticleHistory.tsx:140,/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/ArticleHistory.tsx:308,/Users/oabrivard/Projects/rust/ai_synth/frontend/src/components/settings/SettingsBraveSearch.tsx:58,/Users/oabrivard/Projects/rust/ai_synth/frontend/src/components/ApiKeyManager.tsx:132,/Users/oabrivard/Projects/rust/ai_synth/docs/dev_guidelines.md:196 - Direction: move all user-facing strings to
/Users/oabrivard/Projects/rust/ai_synth/frontend/src/i18n/fr.ts.
- Evidence:
-
SSE lifecycle cleanup is fragile and may leave open connections.
- Evidence:
/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/GenerateSynthesis.tsx:225,/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/GenerateSynthesis.tsx:241,/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/GenerateSynthesis.tsx:251,/Users/oabrivard/Projects/rust/ai_synth/frontend/src/utils/sse.ts:156 - Direction: own connection lifecycle in page-level
onCleanup; keep SSE utility side-effect free.
- Evidence:
P2
-
State mutation occurs during render in admin providers.
- Evidence:
/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/admin/Providers.tsx:559 - Direction: initialize edit state in dedicated
createEffect.
- Evidence:
-
Frontend complexity is too high in several page components.
- Evidence:
/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/ThemeManager.tsx,/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/admin/Providers.tsx,/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/Settings.tsx,/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/SynthesisDetail.tsx,/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/GenerateSynthesis.tsx - Direction: extract composables/hooks and split large UI sections.
- Evidence:
-
API layer is bypassed in places with raw
fetch.- Evidence:
/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/GenerateSynthesis.tsx:241,/Users/oabrivard/Projects/rust/ai_synth/frontend/src/api/client.ts:25 - Direction: add typed API method and remove direct fetch from pages.
- Evidence:
P3
-
Dead reactive effect and redundant flow in article history.
- Evidence:
/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/ArticleHistory.tsx:91 - Direction: replace with
createResourcekeyed by filters/page or remove no-op effect.
- Evidence:
-
Style guideline drift (imports, raw button usage).
- Evidence:
/Users/oabrivard/Projects/rust/ai_synth/frontend/src/index.tsx:4,/Users/oabrivard/Projects/rust/ai_synth/frontend/src/api/themes.ts:1,/Users/oabrivard/Projects/rust/ai_synth/frontend/src/pages/Home.tsx:196,/Users/oabrivard/Projects/rust/ai_synth/docs/dev_guidelines.md:181,/Users/oabrivard/Projects/rust/ai_synth/docs/dev_guidelines.md:207 - Direction: add ESLint rules/codemods for import alias and button policy.
- Evidence:
Immediate High-Impact Refactoring Order
- Fix
ArticleHistorycontract mismatches for enums/labels. - Normalize i18n usage and remove hardcoded strings.
- Refactor SSE lifecycle ownership in generation flow.
- Split
ThemeManagerandadmin/Providersinto hooks + presentational components. - Enforce conventions with lint rules.