Refactor command dispatch and command implementation ownership from monolithic files into focused command modules.
Problem
The command area had grown into a mix of central dispatch, large implementation files, and a commands::shared tree that was not truly shared. Several public methods were kept alive only because tests referenced them, not because any command handler or production path called them. That made it hard to see which command owned which behavior and made dead code look like reusable API.
Current work plan
Part 1 summary
The first PR focuses on the command structure itself:
- Reorganized commands toward the focused folder shape:
<command>_command.rs, <command>_impl.rs, and mod.rs.
- Removed the
commands::shared tree because it was not a real shared command layer anymore.
- Deleted dead-code paths and public methods that were only referenced by tests.
- Removed placeholder config handler modules and tests that only protected unused public APIs.
- Moved real cross-module behavior out of
commands into neutral TUI modules:
- config persistence
- config action handling
- model routing / auto model selection
- share export/upload behavior
- conversation reset state
- Kept command handlers as the command entry points. UI and runtime code now call neutral modules instead of reaching into command internals.
Why this split matters
This keeps the first PR focused on command ownership and dead-code cleanup. The remaining user_commands work is still important, but it is a separate concern and should be reviewed as its own follow-up instead of being mixed into the broader command-group restructuring.
Paulo Aboim Pinto
Refactor command dispatch and command implementation ownership from monolithic files into focused command modules.
Problem
The command area had grown into a mix of central dispatch, large implementation files, and a
commands::sharedtree that was not truly shared. Several public methods were kept alive only because tests referenced them, not because any command handler or production path called them. That made it hard to see which command owned which behavior and made dead code look like reusable API.Current work plan
commands::sharedownership, move real non-command shared behavior outsidecommands, and localize command implementations. Draft PR: Refactor TUI command groups into focused implementations #2851user_commandsseparately.Part 1 summary
The first PR focuses on the command structure itself:
<command>_command.rs,<command>_impl.rs, andmod.rs.commands::sharedtree because it was not a real shared command layer anymore.commandsinto neutral TUI modules:Why this split matters
This keeps the first PR focused on command ownership and dead-code cleanup. The remaining
user_commandswork is still important, but it is a separate concern and should be reviewed as its own follow-up instead of being mixed into the broader command-group restructuring.Paulo Aboim Pinto