-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
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
- App struct fields organized with clear sections
- Each input handler extracted to its own module
- No behavioral changes (pure refactor)
- All existing tests still pass
- Each module < 300 lines
- New modules are independently unit-testable
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels