-
Notifications
You must be signed in to change notification settings - Fork 11
🤖 refactor: make command palette a workspace switcher by default #477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Refinement: Only Switching, No MutationsRefined the default filter to be even more focused - now shows only workspace switching commands (
These management commands are still accessible via Rationale:
Testing: // Default view: Only ws:switch:* commands
testFiltering("") // → ["Switch to Workspace A", "Switch to Workspace B"] ✅
// With > prefix: All commands including mutations
testFiltering(">") // → All 8+ commands including create/delete/rename ✅ |
|
Fixed the cmdk filtering issue for |
|
fyi @ThomasK33 — I think this is a good compromise |
Make the command palette primarily a workspace switcher while keeping all commands accessible via prefix keys. This focuses the palette on the most common use case (switching workspaces) without sacrificing functionality. **Changes:** - Default view shows only workspace commands (switch, create, rename, etc.) - Type `>` prefix to see all commands across all sections - Type `/` prefix for slash commands (existing behavior) - Updated placeholder text to reflect new behavior **Code quality improvements:** - Extracted repeated state reset logic into `resetPaletteState()` helper - Exported command section names as `COMMAND_SECTIONS` constant - Removed unused `searchQuery` variable - Updated documentation and Storybook stories **Documentation:** - Added command palette section to docs/keybinds.md explaining three modes - Updated Storybook story with accurate feature descriptions _Generated with `cmux`_
Changed the default filter to only show `ws:switch:*` commands, excluding workspace mutations like create, delete, and rename. These management commands are still accessible via the `>` prefix. **Why:** - Workspace switching is the primary use case - Create/delete/rename are mutations that should require explicit intent - Keeps the default palette extremely focused and fast **Changes:** - Filter by command ID prefix `ws:switch:*` instead of section name - Updated documentation to clarify "switching" vs "workspace management" - Updated Storybook story descriptions
Fixed an issue where typing `>abc` wouldn't filter commands because
`shouldUseCmdkFilter` was set to false for command queries. Now cmdk
filtering is enabled for `>` queries so users can search through all commands.
Addresses Codex review comment about unsearchable "all commands" mode.
**Before:**
- `shouldFilter={false}` for `>` queries
- Custom filter was never called
- Typing `>abc` showed all commands unfiltered
**After:**
- `shouldFilter={true}` for `>` queries
- Custom filter strips `>` prefix and filters normally
- Typing `>abc` narrows down to matching commands
bb8102c to
23eea4b
Compare
Makes the command palette primarily a workspace switcher by default, with all commands still accessible via prefix keys.
Motivation
The command palette was showing all commands by default, but workspace switching is the most common use case. This change optimizes for the common case while keeping everything accessible.
Changes
Behavior
>prefix: Shows all commands across all sections (Navigation, Chat, Modes, Projects, Help)/prefix: Shows slash commands for chat input (existing behavior)Code Quality
Took this opportunity to clean up surrounding code:
resetPaletteState()helper - State reset logic was duplicated 4 times across the componentCOMMAND_SECTIONSconstant - Section names are now centralized and type-safesearchQuerywas declared but never used>prefix in cmdk filteringDocumentation
docs/keybinds.mdexplaining the three modesTesting
Before/After
Before:
After:
>to instantly see all other commands when neededGenerated with
cmux