refactor(commands): extract registry and parser helpers#2888
Conversation
There was a problem hiding this comment.
aboimpinto has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
Thanks @aboimpinto for taking the time to contribute. This repository is currently observing a maintainer-managed contribution gate in dry-run mode, so this pull request is staying open. When enforcement is enabled, pull requests from contributors who are not listed in Please read |
There was a problem hiding this comment.
Code Review
This pull request refactors the command system by extracting the command registry metadata and lookup helpers into a new registry module, and the slash command parsing logic into a new parse module. The review feedback highlights opportunities to optimize performance by reducing redundant string allocations: first, by stripping the prefix before converting to lowercase in parse_slash_command, and second, by removing unnecessary to_ascii_lowercase() calls on statically defined lowercase command names and aliases in suggest_command_names.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
aboimpinto has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
aboimpinto has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
Merged — thank you @aboimpinto. This was a textbook Layer 3: pure code-motion into Green light for Layer 4 (group-owned command modules) on the same base ( |
Refs #2791.
Refs #2870.
Reference / proof PR: #2851.
Summary
This is Layer 3 of the staged command-boundary refactor. It keeps command dispatch behavior unchanged while moving shared command helper ownership out of
commands/mod.rs.What Changed
CommandInfo,COMMANDS, command lookup, and unknown-command suggestion ranking intocommands/registry.rs.commands/parse.rsfor slash command parsing and argument preservation.commands/mod.rs; group-owned command files remain a later layer.Out Of Scope
user_commandsrefactor.Validation
cargo fmtcargo check -p codewhale-tuicargo test -p codewhale-tui commands::- 415 passedcargo test --workspacegit diff --checkPaulo Aboim Pinto