Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement: override default cmdk filter

Scott Wilson8b883316bfcf
diff --git a/frontend/src/components/v3/generic/Command/Command.tsx b/frontend/src/components/v3/generic/Command/Command.tsx
index 16f6640993..97a8ca543d 100644
--- a/frontend/src/components/v3/generic/Command/Command.tsx
+++ b/frontend/src/components/v3/generic/Command/Command.tsx
@@ -7,10 +7,20 @@ import { SearchIcon } from "lucide-react";
import { cn } from "../../utils";
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../Dialog";
-function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
+function Command({
+ className,
+ filter = (value: string, search: string, keywords?: string[]) => {
+ const searchLower = search.toLowerCase();
+ if (value.toLowerCase().includes(searchLower)) return 1;
+ if (keywords?.some((k) => k.toLowerCase().includes(searchLower))) return 1;
+ return 0;
+ },
+ ...props
+}: React.ComponentProps<typeof CommandPrimitive>) {
return (
<CommandPrimitive
data-slot="command"
+ filter={filter}
className={cn(
"text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md bg-popover outline-0",
className