Skip to content

Code splitting: store slices, GenerationPanel hook, SettingsOverlay split, model_manager submodules #53

Description

@thedavidweng

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

  • generation.ts and model.ts each under 250 lines
  • SettingsOverlay.tsx split into focused section components
  • model_manager/mod.rs delegates to submodules
  • New unit tests cover extracted logic
  • All existing tests pass, no regressions

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions