You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Command built from semantic types keeps padded name/description/category, so GetCommandsByCategory misses it until a save/reload #146
Command has two constructors, and they normalize differently.
The string constructor (Keybinding/Models/Command.cs ~L236-239) trims the name, description and category, and maps a blank description or category to null.
CommandRegistry.GetCommandsByCategory (Services/CommandRegistry.cs ~L60-62) trims its input and compares with OrdinalIgnoreCase, so a stored category with padding never matches.
After SaveAsync() and a reload, the command is rebuilt through the string constructor and trimmed, and it then appears under "Editing". The same command behaves differently before and after a round-trip.
Suggested fix / acceptance criteria
Have the semantic constructor apply the same normalization as the string constructor: trim the name, description and category, and turn a blank description or category into null. Ideally both constructors share one helper.
Add tests alongside CommandIdWhitespaceTests: padded name and category are trimmed, a whitespace-only description or category becomes null, and GetCommandsByCategory("Editing") finds the command without a save and reload.
Priority: Medium. A command built through the semantic-type constructor behaves differently before and after a save and reload, and category lookup silently misses it. It's a correctness bug with a small, well-defined fix. The trigger is caller-supplied padding, so it isn't common.
Area / suggested assignment:Keybinding/Models/Command.cs constructors and CommandRegistry.GetCommandsByCategory
Activity
matt-edmondson commentedon Sep 29, 2026
Triage
Keybinding/Models/Command.csconstructors andCommandRegistry.GetCommandsByCategoryGetCommandsByCategory(null)inconsistency). Both are in the same lookup path and could share a single normalization helper.Generated by Claude Code