Skip to content

Commit 23eea4b

Browse files
committed
fix: enable cmdk filtering for > queries
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
1 parent 593eec0 commit 23eea4b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/components/CommandPalette.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type { CommandAction } from "@/contexts/CommandRegistryContext";
55
import { formatKeybind, KEYBINDS, isEditableElement, matchesKeybind } from "@/utils/ui/keybinds";
66
import { getSlashCommandSuggestions } from "@/utils/slashCommands/suggestions";
77
import { CUSTOM_EVENTS } from "@/constants/events";
8-
import { COMMAND_SECTIONS } from "@/utils/commands/sources";
98

109
interface CommandPaletteProps {
1110
getSlashContext?: () => { providerNames: string[]; workspaceId?: string };
@@ -312,9 +311,8 @@ export const CommandPalette: React.FC<CommandPaletteProps> = ({ getSlashContext
312311

313312
const isSlashQuery = !currentField && query.trim().startsWith("/");
314313
const isCommandQuery = !currentField && query.trim().startsWith(">");
315-
const shouldUseCmdkFilter = currentField
316-
? currentField.type === "select"
317-
: !isSlashQuery && !isCommandQuery;
314+
// Enable cmdk filtering for all cases except slash queries (which we handle manually)
315+
const shouldUseCmdkFilter = currentField ? currentField.type === "select" : !isSlashQuery;
318316

319317
let groups: PaletteGroup[] = generalResults.groups;
320318
let emptyText: string | undefined = generalResults.emptyText;

0 commit comments

Comments
 (0)