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.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Palette: its catalog is /api/search-index (next to the colour /api/palettes), keys tested
Claudeb17324b29585
diff --git a/src/app/api/palette/route.ts b/src/app/api/search-index/route.tssimilarity index 100%rename from src/app/api/palette/route.tsrename to src/app/api/search-index/route.tsdiff --git a/src/components/command-palette.tsx b/src/components/command-palette.tsxindex a0a1acf6..7a108b16 100644--- a/src/components/command-palette.tsx+++ b/src/components/command-palette.tsx@@ -125,7 +125,7 @@ function PaletteBody({ onPick, onOpenRecent }: { onPick: (e: PaletteEntry) => vo// The apps, motions, effects and models load on first open (and stay for the session).const index = useQuery({queryKey: ["palette-index"],- queryFn: async () => (await fetch("/api/palette")).json() as Promise<PaletteIndex>,+ queryFn: async () => (await fetch("/api/search-index")).json() as Promise<PaletteIndex>,staleTime: Infinity,});const recent = useGenerations({ q: dq || undefined, limit: 5, statuses: ["succeeded"] }, { keepPrevious: true });diff --git a/src/lib/command-search.ts b/src/lib/command-search.tsindex 001d791a..644a022e 100644--- a/src/lib/command-search.ts+++ b/src/lib/command-search.ts@@ -144,7 +144,7 @@ export function rankPalette(entries: PaletteEntry[], query: string, limits: Reco.map(({ kind, label, entries }) => ({ kind, label, entries }));}-/** The slim catalog the palette loads on first open (GET /api/palette). */+/** The slim catalog the palette loads on first open (GET /api/search-index). */export interface PaletteIndex {apps: PalettePreset[];motions: PalettePreset[];diff --git a/src/lib/palette-index.ts b/src/lib/palette-index.tsindex c514f10e..c3008350 100644--- a/src/lib/palette-index.ts+++ b/src/lib/palette-index.ts@@ -1,5 +1,5 @@/**- * The slim catalog behind the ⌘K palette (GET /api/palette): names, categories and where each item+ * The slim catalog behind the ⌘K palette (GET /api/search-index): names, categories and where each item* opens. Built on the server from the catalog, so the palette never ships prompt templates or routes.*/import { APPS, EFFECTS, MODELS, MOTIONS } from "@/lib/catalog";diff --git a/tests/keys.test.ts b/tests/keys.test.tsnew file mode 100644index 00000000..d9c1a456--- /dev/null+++ b/tests/keys.test.ts@@ -0,0 +1,20 @@+import { afterEach, describe, expect, it, vi } from "vitest";+import { isApplePlatform, modKey } from "@/lib/keys";++describe("modifier key name", () => {+ afterEach(() => vi.unstubAllGlobals());++ it("says ⌘ on Apple devices and Ctrl elsewhere", () => {+ for (const p of ["MacIntel", "iPhone", "iPad", "iPod touch"]) expect(isApplePlatform(p)).toBe(true);+ for (const p of ["Win32", "Linux x86_64", "Linux armv8l", ""]) expect(isApplePlatform(p)).toBe(false);+ });++ it("reads the browser's platform, and says Ctrl where there is none (the server)", () => {+ vi.stubGlobal("navigator", undefined);+ expect(modKey()).toBe("Ctrl");+ vi.stubGlobal("navigator", { platform: "MacIntel" });+ expect(modKey()).toBe("⌘");+ vi.stubGlobal("navigator", { platform: "Win32" });+ expect(modKey()).toBe("Ctrl");+ });+});