Parent issue: #21
Context
useAppController.ts and useHomeController.ts are 800+ line controllers mixing multiple concerns. Extracting focused hooks improves testability and readability.
Scope
Extract these hooks into separate files under src/features/*/hooks/:
From useHomeController (~889 lines)
useKeyboardShortcuts — global keyboard shortcut registration and handling
useDragDrop — sidebar drag-and-drop logic (reorder conversations, move files)
From useAppController
useAppInit — app initialization sequence (vault check, model load, onboarding state)
Guidelines
- Each hook should have a clear input/output interface
- Keep the same behavior — this is a refactor, not a feature change
- The parent controller should import and compose the extracted hooks
- Add a brief JSDoc comment describing the hook's purpose
Files
src/features/layout/controllers/useAppController.ts
src/features/chat/controllers/useHomeController.ts
Parent issue: #21
Context
useAppController.tsanduseHomeController.tsare 800+ line controllers mixing multiple concerns. Extracting focused hooks improves testability and readability.Scope
Extract these hooks into separate files under
src/features/*/hooks/:From useHomeController (~889 lines)
useKeyboardShortcuts— global keyboard shortcut registration and handlinguseDragDrop— sidebar drag-and-drop logic (reorder conversations, move files)From useAppController
useAppInit— app initialization sequence (vault check, model load, onboarding state)Guidelines
Files
src/features/layout/controllers/useAppController.tssrc/features/chat/controllers/useHomeController.ts