[Arch] frontend/src/pages/Settings.tsx is a 988-line monolithic component #59
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: High | Category: Frontend
Settings()spans lines 229-1217: ~40 inlineuseStatehooks, a 155-linehandleSave, 7 inline section blocks covering unrelated feature areas.handleSavealso calls a raw uncheckedfetch()instead of the typedapi.tswrapper.Recommendation: Extract each section (Notifications, TrackingInbox, Scrapers, Parsers, General, System, About) into
frontend/src/pages/settings/*.tsx; keepSettings.tsxas a thin router. Fix the raw fetch to useapi.tsand checkresp.ok.Refactoring safety: Add a smoke test (render + save happy path) for at least one section before extracting.
Full detail:
docs/architecture-review.md§ C + § H.9Fixed on branch
architecture-rework, commit482c837: extracted each section intofrontend/src/pages/settings/*.tsx;Settings.tsxshrinks from 1,217 to 406 lines. Kept the shared settings state + singlehandleSavein the parent (matches existing UX — every section's "Save changes" saves the full payload), moved section-local UI state (show-password toggles, test-connection state, parser search) into each section component. Also fixed the raw uncheckedfetch("/api/settings", ...)calls by addingfetchSettings()/fetchScrapers()/updateSettings()tolib/api.ts. Verified:tsc,eslint,knip,vite buildall pass.