Summary
Refactor src/ui/app.rs (~1,100 lines) into smaller, focused modules to improve maintainability, testability, and code navigation.
Motivation
app.rs is the largest file in the codebase and handles too many concerns:
- Application state management
- Connection dialog input handling
- Sidebar navigation logic
- Editor input dispatching
- Results pane navigation
- Export picker logic
- Async task management
- Toast notification system
This makes it difficult to understand, modify, or test individual features. As more features are added (autocomplete, transactions, vim mode), this file will only grow.
Proposed Refactoring
src/ui/
├── app.rs # Core App struct, state, and tick() loop (reduced to ~200 lines)
├── app/
│ ├── mod.rs # Re-exports
│ ├── connection.rs # Connection dialog state and input handling
│ ├── sidebar.rs # Sidebar navigation and schema interaction
│ ├── editor.rs # Editor input dispatching and query execution
│ ├── results.rs # Results pane navigation and sorting
│ ├── export.rs # Export picker state and logic
│ └── toast.rs # Toast notification system
├── components.rs # UI rendering (unchanged)
└── theme.rs # Theme system (unchanged)
Acceptance Criteria
Summary
Refactor
src/ui/app.rs(~1,100 lines) into smaller, focused modules to improve maintainability, testability, and code navigation.Motivation
app.rsis the largest file in the codebase and handles too many concerns:This makes it difficult to understand, modify, or test individual features. As more features are added (autocomplete, transactions, vim mode), this file will only grow.
Proposed Refactoring
Acceptance Criteria