Problem
Several files exceed healthy size limits: generation.ts (~400 lines), model.ts (~427 lines), SettingsOverlay.tsx (~804 lines), model_manager/mod.rs (~1,271 lines). This hurts maintainability and makes AI-assisted editing unreliable.
Scope
- Frontend: Reduce
generation.ts and model.ts below 250 lines each. Extract useGenerationForm() hook. Split SettingsOverlay.tsx into section components. Decouple FormBody field props from the whole form object.
- Backend: Split
model_manager/mod.rs into submodules (download.rs, delete.rs, events.rs, mirror.rs).
- Tests: Add unit tests for new modules and slices.
Acceptance criteria
Problem
Several files exceed healthy size limits:
generation.ts(~400 lines),model.ts(~427 lines),SettingsOverlay.tsx(~804 lines),model_manager/mod.rs(~1,271 lines). This hurts maintainability and makes AI-assisted editing unreliable.Scope
generation.tsandmodel.tsbelow 250 lines each. ExtractuseGenerationForm()hook. SplitSettingsOverlay.tsxinto section components. DecoupleFormBodyfield props from the whole form object.model_manager/mod.rsinto submodules (download.rs,delete.rs,events.rs,mirror.rs).Acceptance criteria
generation.tsandmodel.tseach under 250 linesSettingsOverlay.tsxsplit into focused section componentsmodel_manager/mod.rsdelegates to submodules