Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Palette: Enter always acts on what was typed

Claude3d72d1d91200
diff --git a/src/components/command-palette.tsx b/src/components/command-palette.tsx
index 7a108b16..62612620 100644
--- a/src/components/command-palette.tsx
+++ b/src/components/command-palette.tsx
@@ -3,7 +3,7 @@
import { useQuery } from "@tanstack/react-query";
import { Bell, Clapperboard, Cpu, Film, KeyRound, LayoutGrid, Loader2, Plus, Server, Settings2, ShieldCheck, Sparkles, Wand2, type LucideIcon } from "lucide-react";
import { useRouter } from "next/navigation";
-import { createContext, lazy, Suspense, useCallback, useContext, useDeferredValue, useEffect, useMemo, useState } from "react";
+import { createContext, lazy, Suspense, useCallback, useContext, useEffect, useMemo, useState } from "react";
import { NAV } from "@/components/nav-items";
import { MediaThumb } from "@/components/studio/result-media";
import { CommandDialog, CommandEmpty, CommandGroup, CommandItem, CommandList } from "@/components/ui/command";
@@ -119,7 +119,8 @@ function Hints() {
/** What the palette lists and searches; mounted only while it's open. */
function PaletteBody({ onPick, onOpenRecent }: { onPick: (e: PaletteEntry) => void; onOpenRecent: (g: Generation) => void }) {
const [q, setQ] = useState("");
- const query = useDeferredValue(q);
+ // Not deferred: ranking ~900 entries takes a millisecond, and Enter must act on the list for what was typed.
+ const query = q;
const dq = useDebounced(q.trim(), 200);
const mode = useEngineMode();
// The apps, motions, effects and models load on first open (and stay for the session).
diff --git a/tests/e2e/shell.mjs b/tests/e2e/shell.mjs
index 6c7043de..5c02c77e 100644
--- a/tests/e2e/shell.mjs
+++ b/tests/e2e/shell.mjs
@@ -67,6 +67,8 @@ try {
const dialog = page.getByRole("dialog", { name: "Search Fuobe" });
await dialog.waitFor();
await page.keyboard.type("cinma");
+ // The start list (which also lists Cinema Studio) gives way to the matches.
+ await dialog.getByRole("option", { name: /^New creation/ }).waitFor({ state: "detached" });
await dialog.getByRole("option", { name: /^Cinema Studio/ }).first().waitFor();
await page.keyboard.press("Enter");
await page.waitForURL((u) => new URL(u).pathname === "/cinema", { timeout: 20_000 });