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
Studios and apps: fixes from the site check (batch 2)
Adarsh4eeb04e27345
diff --git a/src/components/preset-header.tsx b/src/components/preset-header.tsxindex 6b3f2aef..845d6133 100644--- a/src/components/preset-header.tsx+++ b/src/components/preset-header.tsx@@ -55,7 +55,7 @@ export function PresetHeader({</div><div className="min-w-0 flex-1"><p className="truncate font-heading text-[19px] leading-snug">{preset.name}</p>- <p className="line-clamp-2 text-[13px] text-muted-foreground">{presetHowTo(preset)}</p>+ <p className="line-clamp-2 text-[13px] text-muted-foreground max-sm:line-clamp-3">{presetHowTo(preset)}</p></div>{gpu && <HeaderPill badge={gpu} gpu={badges?.gpu} compact onOpen={() => openGpuSetup({ ref: `preset:${preset.id}`, name: preset.name })} />}<Popover>diff --git a/src/components/studio/composer.tsx b/src/components/studio/composer.tsxindex 4fee6597..ca93cc39 100644--- a/src/components/studio/composer.tsx+++ b/src/components/studio/composer.tsx@@ -83,7 +83,7 @@ import { SettingsChip } from "./settings-panel";import { ShotsEditor } from "./shots-editor";import { SketchTools } from "./sketch-tools";import { RECENT_MODELS, useStoredList } from "./stored-list";-import { useStartRequest, useStudio, type Draft } from "./studio-context";+import { usePresetUrl, useStartRequest, useStudio, type Draft } from "./studio-context";import { useEdgeFade } from "./use-edge-fade";import { useSignature } from "../palettes/use-signature";@@ -213,6 +213,7 @@ function slotButton(root: HTMLElement | null, key: string) {export function Composer({ docked }: { docked: boolean }) {const { config, draft: typed, setDraft, setSlot } = useStudio();const catalog = useCatalog();+ const presetUrl = usePresetUrl();const [engine, setEngine, engineMode] = useEngine();const create = useCreateGeneration();const [enhancing, setEnhancing] = useState(false);@@ -331,6 +332,7 @@ export function Composer({ docked }: { docked: boolean }) {// with the move's own settings (Focus Change: 6 s, silent). Another video model can be picked after it; it takes// the move's words. A move whose cloud route is a partner model's words leaves the person's model as it is.const pickPreset = (id?: string) => {+ presetUrl(id);if (!id) return setDraft({ presetId: undefined, mix: undefined, presetStrength: undefined });const picked = catalog.getPreset(id);const want = presetOriginal(picked, engine);@@ -351,6 +353,15 @@ export function Composer({ docked }: { docked: boolean }) {const route = presetParams(preset, engine);if (m) setDraft((d) => (d.modelId !== model.id ? {} : { modelId: m.id, params: { ...m.defaults, ...route, numOutputs: d.params.numOutputs, enhancePrompt: d.params.enhancePrompt, seed: d.params.seed }, ...lookCleared(model, m) }));}, [preset, engine, model, config.defaultModels, catalog, setDraft]);+ // A link to a camera motion or effect Fuobe doesn't have (?preset=nope): once every preset is known, the composer+ // drops it and says so, so the chip doesn't wait on it and a plain prompt runs.+ const unknownPreset = catalog.complete && !!draft.presetId && !takesLook && !preset;+ useEffect(() => {+ if (!unknownPreset) return;+ setDraft({ presetId: config.preset?.id, mix: undefined, presetStrength: undefined });+ presetUrl(undefined);+ toast("That camera motion or effect isn't available. Pick another one.", { id: "unknown-preset" });+ }, [unknownPreset, config.preset, presetUrl, setDraft]);// Single-purpose studios (Extend, Reframe, Edit video…) pin their operation.const studioOp = config.ops.length === 1 && !preset ? config.ops[0] : undefined;@@ -944,10 +955,10 @@ export function Composer({ docked }: { docked: boolean }) {</div>) : null}- {/* Toolbar: one row; it scrolls (with faded edges) when it doesn't fit. */}+ {/* Toolbar: one row on phones (it scrolls, with faded edges, when it does not fit); from sm up it wraps, so every chip shows. */}<div className="flex items-center gap-2">{/* Phones (below sm): "+", Settings (icon), the model (it shrinks to fit) and @; the other chips are in the settings sheet. */}- <div ref={chipRow} style={fade} data-composer-toolbar className="scrollbar-none -my-1 flex min-w-0 flex-1 items-center gap-1.5 overflow-x-auto py-1">+ <div ref={chipRow} style={fade} data-composer-toolbar className="scrollbar-none -my-1 flex min-w-0 flex-1 items-center gap-1.5 overflow-x-auto py-1 sm:flex-wrap sm:overflow-x-visible">{kinds.length > 0 && <AttachMenu kinds={kinds} onFiles={attach.attachFiles} onPick={attach.attach} />}{collapsed && showAttachments && attached.length > 0 && (<buttondiff --git a/src/components/studio/preset-chips.tsx b/src/components/studio/preset-chips.tsxindex 784d4b3d..c45b0420 100644--- a/src/components/studio/preset-chips.tsx+++ b/src/components/studio/preset-chips.tsx@@ -82,7 +82,7 @@ export function PresetChip({ type, value, onChange }: { type: "motion" | "effectconst Icon = selected ? (PRESET_ICONS[selected.look.icon] ?? Film) : value && !catalog.complete ? Loader2 : Film;const noun = type === "motion" ? "camera motion" : "effect";return (- <ClearableChip active={!!value} onClear={() => onChange(undefined)} clearLabel={`Clear ${noun}`}>+ <ClearableChip active={!!value} onClear={() => onChange(undefined)} clearLabel={`Clear ${selected?.name ?? noun}`}><Popoveropen={open}onOpenChange={(o) => {diff --git a/src/components/studio/studio-context.tsx b/src/components/studio/studio-context.tsxindex 6c968c06..f9060120 100644--- a/src/components/studio/studio-context.tsx+++ b/src/components/studio/studio-context.tsx@@ -174,6 +174,16 @@ export function useStartRequest(): number {return useContext(StartRequestCtx);}+/**+ * Puts the camera motion or effect the composer shows into the address (`?preset=`, gone once cleared), so a reload or+ * a shared link opens on it. The studio page provides it; elsewhere it does nothing.+ */+export const PresetUrlCtx = createContext<(id: string | undefined) => void>(() => {});++export function usePresetUrl(): (id: string | undefined) => void {+ return useContext(PresetUrlCtx);+}+/** Replace a slot value by key, updating only when it's the same upload (async upload callbacks). */export function slotUpdater(setSlot: Actions["setSlot"], key: SlotKey) {return (v: SlotValue | null) => setSlot(key, v);diff --git a/src/components/studio/studio-page.tsx b/src/components/studio/studio-page.tsxindex a54a3ee7..bf120189 100644--- a/src/components/studio/studio-page.tsx+++ b/src/components/studio/studio-page.tsx@@ -12,7 +12,7 @@ import { HeaderPill } from "@/components/gpu/readiness-chip";import { badgeFor, openGpuSetup, useGpuBadges } from "@/hooks/use-gpu";import type { Generation, MediaKind, ModelDef, Preset } from "@/lib/catalog/types";import { useEngine, useGenerations } from "@/lib/api";-import { claimStartToken, followEngineDefault, handoffKey, mergeHandoff, presetModel, promptShown, START_PARAM, withoutStart } from "@/lib/composer";+import { claimStartToken, followEngineDefault, handoffKey, mergeHandoff, presetModel, promptShown, START_PARAM, withoutStart, withPreset } from "@/lib/composer";import { positionsFrom } from "@/lib/catalog/keyframes";import { reuseSignature, withSignatureWords } from "@/lib/catalog/palettes";import { currentModelId, migrateRequest } from "@/lib/catalog/replaced";@@ -26,7 +26,7 @@ import { Composer } from "./composer";import { EngineSwitch } from "./engine-switch";import { Feed } from "./feed";import type { SlotValue } from "./media-slot";-import { StartRequestCtx, StudioProvider, useStudio, useStudioActions, type Draft, type StudioConfig } from "./studio-context";+import { PresetUrlCtx, StartRequestCtx, StudioProvider, usePresetUrl, useStudio, useStudioActions, type Draft, type StudioConfig } from "./studio-context";function kindOfUrl(url: string): MediaKind {if (/\.(mp4|webm|mov)(\?|$)/i.test(url)) return "video";@@ -196,6 +196,7 @@ const PresetHeader = dynamic(() => import("@/components/preset-header").then((m)function ActivePresetHeader() {const { config, draft, setDraft } = useStudio();const catalog = useCatalog();+ const presetUrl = usePresetUrl();const preset = draft.presetId ? catalog.getPreset(draft.presetId) : config.preset;if (!preset) return null;return (@@ -203,7 +204,14 @@ function ActivePresetHeader() {preset={preset}className="mb-3"modelName={(id) => catalog.getModel(id)?.name}- onClear={config.preset ? undefined : () => setDraft({ presetId: undefined, mix: undefined, presetStrength: undefined })}+ onClear={+ config.preset+ ? undefined+ : () => {+ presetUrl(undefined);+ setDraft({ presetId: undefined, mix: undefined, presetStrength: undefined });+ }+ }/>);}@@ -328,7 +336,7 @@ function StudioBody({ header, tabs }: { header?: React.ReactNode; tabs?: React.R<Feed items={items} onReuse={reuse} /></div>) : (- <div className="flex flex-col items-center pt-[16vh] text-center">+ <div className="flex flex-col items-center pt-6 text-center sm:pt-[16vh]"><h2 className="font-heading text-display text-balance">{config.hero}</h2>{config.subtitle && <p className="mt-2 max-w-xl text-[13px] text-muted-foreground">{config.subtitle}</p>}{config.related && (@@ -346,7 +354,7 @@ function StudioBody({ header, tabs }: { header?: React.ReactNode; tabs?: React.RclassName={cn(hasItems? "sticky bottom-0 z-20 bg-gradient-to-t from-background via-background/95 to-transparent px-3 pt-8 pb-[max(1rem,env(safe-area-inset-bottom))] sm:px-6"- : "px-3 pt-10 sm:px-6",+ : "px-3 pt-6 sm:px-6 sm:pt-10",)}>{hasItems && offscreen.count > 0 && (@@ -429,6 +437,7 @@ function HandoffSync({build,adopt,follow,+ ownRef,ready,onNavigate,onStart,@@ -439,6 +448,8 @@ function HandoffSync({adopt: React.RefObject<(key: string) => void>;/** The base after the composer's own engine swap (followEngineDefault). */follow: React.RefObject<(base: Draft, current: Draft) => Draft>;+ /** Set here: takes an address the studio wrote itself (a picked or cleared preset) as applied, so it isn't a navigation. */+ ownRef: React.RefObject<(key: string) => void>;ready: boolean;onNavigate: (key: string) => void;onStart: () => void;@@ -447,6 +458,9 @@ function HandoffSync({const [url, setUrl] = useState<{ key: string; start: string | null } | null>(null);const applied = useRef({ key: startKey, ready, base: start, seen: false });const started = useRef(false);+ useLayoutEffect(() => {+ ownRef.current = (key) => void (applied.current.key = key);+ }, [ownRef]);const onParams = useCallback((key: string, start: string | null) => setUrl((u) => (u?.key === key && u.start === start ? u : { key, start })), []);useLayoutEffect(() => {if (url === null) return;@@ -526,11 +540,22 @@ function StudioDraft({ config, header, tabs, initialRefs, initialPrompt }: DraftsetStart((s) => ({ key, epoch: s.epoch + 1 }));adoptRef.current(key);}, []);+ // The picked camera motion or effect goes into the address (a reload or a shared link opens on it). HandoffSync+ // takes that address as applied first: it isn't a hand-off, so the draft isn't rebuilt.+ const ownRef = useRef<(key: string) => void>(() => {});+ const presetUrl = useCallback((id: string | undefined) => {+ const href = withPreset(window.location.href, id);+ if (href === window.location.href) return;+ ownRef.current(handoffKey(new URL(href).searchParams));+ window.history.replaceState(null, "", href);+ }, []);return (<ComposerBridgeCtx.Provider value={bridge}>- <StudioProvider key={start.epoch} config={config} initial={initial}>- <StudioSession header={header} tabs={tabs} sync={{ startKey: start.key, start: initial, build: buildRef, adopt: adoptRef, follow: followRef, ready: catalog.ready, onNavigate }} />- </StudioProvider>+ <PresetUrlCtx.Provider value={presetUrl}>+ <StudioProvider key={start.epoch} config={config} initial={initial}>+ <StudioSession header={header} tabs={tabs} sync={{ startKey: start.key, start: initial, build: buildRef, adopt: adoptRef, follow: followRef, ownRef, ready: catalog.ready, onNavigate }} />+ </StudioProvider>+ </PresetUrlCtx.Provider></ComposerBridgeCtx.Provider>);}diff --git a/src/lib/catalog/apps.ts b/src/lib/catalog/apps.tsindex bef3a443..4762c88f 100644--- a/src/lib/catalog/apps.ts+++ b/src/lib/catalog/apps.ts@@ -43,6 +43,8 @@ const TWO_STEP =const NO_AUDIO = "Kling 2.5 / Wan 2.2 output is silent — add sound with the Audio → Video to audio tool";type AppSpec = {+ /** Kept when an app is renamed, so links, previews and saved runs still find it (default: from the name). */+ id?: string;name: string;category: string;description: string;@@ -70,7 +72,7 @@ function app(a: AppSpec): Preset {const cloud = a.cloud === null ? null : { modelId: EDIT_CLOUD, op: "edit" as const, ...a.cloud };const open = a.open === null ? null : { modelId: EDIT_OPEN, op: "edit" as const, ...a.open };return {- id: `app-${slug(a.name)}`,+ id: a.id ?? `app-${slug(a.name)}`,type: "app",name: a.name,category: a.category,@@ -1772,7 +1774,9 @@ export const APPS: Preset[] = ["Rework this opening frame into a scroll-stopping hook thumbnail: stronger contrast and color, clearer focal point on the face or product, a more expressive moment and bold composition. Keep the same people, product and setting; add no text.",}),app({- name: "Similarity Score",+ // Named for what it does: it takes out logos and recognizable IP (Fuobe has no detector to score similarity).+ id: "app-similarity-score",+ name: "IP Cleanup",category: "Utility",description: "Clean up logos and recognizable IP before posting",icon: "ShieldCheck",diff --git a/src/lib/catalog/dop.ts b/src/lib/catalog/dop.tsindex 2616d9ab..7ac2dd90 100644--- a/src/lib/catalog/dop.ts+++ b/src/lib/catalog/dop.ts@@ -184,12 +184,13 @@ export function dopPreset(p: Preset): Preset {let open: PresetRoute;let openSays: string;if (wan.length) {+ // A Wan 2.1 LoRA runs on Wan 2.2 too (its strength is checked on a GPU run); the Details popover just names it.open = route(DOP_MODEL, wan);- const wan21 = all.some((l) => l.family === "wan" && l.base.startsWith("wan2.1"));- openSays = `Wan 2.2 with ${names(wan)}${wan21 ? " (a Wan 2.1 LoRA on Wan 2.2: its strength is checked on a GPU run)" : ""}`;+ openSays = `Wan 2.2 with ${names(wan)}`;} else if (ltx.length) {+ // An LTX-2 LoRA runs on LTX-2.3 too (not verified yet); the Details popover just names it.open = route(DOP_LTX_MODEL, ltx);- openSays = `LTX-2.3 with ${names(ltx)}${all.some((l) => l.base.startsWith("ltx-2-19b")) ? " (an LTX-2 LoRA on LTX-2.3: unverified)" : ""}`;+ openSays = `LTX-2.3 with ${names(ltx)}`;} else if (ltx25.length && op === "i2v") {open = { ...route(LTX25_OPEN, ltx25), params: { duration: 5, resolution: "720p" } };openSays = `LTX-2.5 with ${names(ltx25)}`;@@ -242,8 +243,10 @@ export function dopPreset(p: Preset): Preset {cloud = route(DOP_MODEL, []);cloudSays = "Wan 2.2 on the preset's words";} else {+ // The partner route stays until the evaluation harness measures Fuobe DoP on these words (fal has no LTX-2.5 LoRA+ // endpoint, so an LTX-2.5 LoRA stays on the GPU).cloud = { ...p.cloud, partner: true };- cloudSays = `the preset's words on a partner model until the evaluation harness measures Fuobe DoP on them${ltx25.length ? " (fal has no LTX-2.5 LoRA endpoint)" : ""}`;+ cloudSays = "the preset's words on a partner model";}const local = [...wan, ...ltx].filter(gpuOnlyLicence);diff --git a/src/lib/composer.ts b/src/lib/composer.tsindex 05fd3b8b..a0289643 100644--- a/src/lib/composer.ts+++ b/src/lib/composer.ts@@ -867,6 +867,18 @@ export function withoutStart(href: string): string {return /^https?:\/\//.test(href) ? `${u.origin}${rest}` : rest;}+/**+ * The same address with the camera motion or effect the composer shows (`?preset=`), or without one once it's+ * cleared, so a reload or a shared link opens on it.+ */+export function withPreset(href: string, id: string | undefined): string {+ const u = new URL(href, "http://x");+ if (id) u.searchParams.set("preset", id);+ else u.searchParams.delete("preset");+ const rest = `${u.pathname}${u.search}${u.hash}`;+ return /^https?:\/\//.test(href) ? `${u.origin}${rest}` : rest;+}+/*** What a studio does with a start request now: wait while models, presets or uploads are still* loading (their blockers are temporary), run when nothing blocks, else explain — the blocker'sdiff --git a/src/lib/guest-access.ts b/src/lib/guest-access.tsindex a58233fc..46fec637 100644--- a/src/lib/guest-access.ts+++ b/src/lib/guest-access.ts@@ -71,7 +71,7 @@ export type GuestRead =| { kind: "filtered" }/** Answer this body (the owner's list, empty). */| { kind: "empty"; body: unknown }- /** No such endpoint for a guest (404: the live-updates stream, so the client looks again much later). */+ /** No such endpoint for a guest (204, no content: the live-updates stream, so the client looks again much later). */| { kind: "none" }/** The owner's data: 401. */| { kind: "closed" };diff --git a/src/lib/studios.ts b/src/lib/studios.tsindex cfc8e515..352b1c3d 100644--- a/src/lib/studios.ts+++ b/src/lib/studios.ts@@ -330,9 +330,9 @@ export function appStudio(preset: Preset): StudioConfig {feature: `app:${preset.id}`,title: preset.name,hero: preset.description,- // Which model runs it on each engine lives in the preset header's Details popover (U23); the- // hero only says when an engine has no version, plus how the two versions differ.- subtitle: [!preset.cloud ? "Open source only for now" : !preset.open ? "Cloud only for now" : undefined, preset.parity].filter(Boolean).join(" · "),+ // Which model runs it on each engine, and how the two versions differ, live in the preset header's Details popover+ // (U23); the hero only says when an engine has no version.+ subtitle: !preset.cloud ? "Open source only for now" : !preset.open ? "Cloud only for now" : undefined,placeholder: preset.promptPlaceholder ?? "Add details (optional)",kind,ops,@@ -349,6 +349,10 @@ export function appStudio(preset: Preset): StudioConfig {/** Apps whose job a studio does in more depth: linked under the hero. */const APP_RELATED: Record<string, { href: string; label: string }> = {"app-ai-influencer": { href: "/influencer", label: "Build one game-style: 18 categories, creatures, Shuffle" },+ // Their clips come out silent: the sound is a second step.+ "app-asmr-classic": { href: "/audio/video", label: "Add sound to your clip" },+ "app-asmr-add-on": { href: "/audio/video", label: "Add sound to your clip" },+ "app-rap-god": { href: "/audio/video", label: "Add sound to your clip" },};export const MOTION_CONTROL_STUDIO: StudioConfig = {diff --git a/src/proxy.ts b/src/proxy.tsindex 8ccee68b..f1bbe0e0 100644--- a/src/proxy.ts+++ b/src/proxy.ts@@ -44,7 +44,8 @@ const APP_IDS = new Set(APPS.map((a) => a.id));function pass(request: NextRequest): NextResponse {const { pathname } = request.nextUrl;const app = /^\/apps\/([^/]+)\/?$/.exec(pathname)?.[1];- if ((app && !APP_IDS.has(safeDecode(app))) || unknownHubMode(pathname)) return notFound(request);+ if (app && !APP_IDS.has(safeDecode(app))) return notFound(request, { href: "/apps", label: "Browse apps" });+ if (unknownHubMode(pathname)) return notFound(request);const record = recordForPath(pathname);if (record && !recordExists(record)) return notFound(request);return NextResponse.next();@@ -55,29 +56,37 @@ function pass(request: NextRequest): NextResponse {* proxy's request address from its own name for the server ("localhost") and the forwarded protocol, and the address* it routes by from the host it listens on (`next start -H 127.0.0.1`): when they differ, a rewrite to the app's own* 404 page goes out as a request to another server, which fails over HTTPS and answered 500. Plain HTTP (a local- * install) keeps the rewrite to the app's own pages.+ * install) keeps the rewrite to the app's own pages. It wears the studio's colours and type (Inter and Instrument+ * Serif where installed, else the same fallbacks the app uses), with a way back: the section's own page (an unknown app:+ * the apps), then Home.*/-function plain404(title: string, text: string, home: boolean): NextResponse {+type PageLink = { href: string; label: string };+function plain404(title: string, text: string, links: PageLink[]): NextResponse {+ const nav = links.map((l, i) => `<a href="${l.href}"${i < links.length - 1 ? ' class="alt"' : ""}>${l.label}</a>`).join("");const html = `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="robots" content="noindex"><title>${title} · Fuobe</title><style>-:root{color-scheme:light dark;--bg:#fafafa;--fg:#111113;--muted:#6b6b73;--btn:#111113;--btn-fg:#fafafa}-@media (prefers-color-scheme:dark){:root{--bg:#0b0b0c;--fg:#ededef;--muted:#9a9aa2;--btn:#ededef;--btn-fg:#0b0b0c}}-body{margin:0;min-height:100svh;display:grid;place-items:center;background:var(--bg);color:var(--fg);font:15px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;text-align:center}-main{max-width:460px;padding:24px 16px 10vh}h1{margin:0;font-size:30px;line-height:1.2;font-weight:600;text-wrap:balance}-p{margin:10px 0 0;color:var(--muted);text-wrap:pretty}a{display:inline-block;margin-top:22px;padding:9px 16px;border-radius:10px;background:var(--btn);color:var(--btn-fg);text-decoration:none;font-weight:500}-</style></head><body><main><h1>${title}</h1><p>${text}</p>${home ? '<a href="/">Back to Home</a>' : ""}</main></body></html>`;+:root{color-scheme:light dark;--bg:#ffffff;--fg:#1e1e1f;--muted:#6e6e71;--line:#e4e4e7;--btn:#5d4bdb;--btn-fg:#ffffff}+@media (prefers-color-scheme:dark){:root{--bg:#121213;--fg:#fafafb;--muted:#a9a9ab;--line:#2e2e31;--btn:#6a5ee7;--btn-fg:#ffffff}}+body{margin:0;min-height:100svh;display:grid;place-items:center;background:var(--bg);color:var(--fg);font:15px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;text-align:center}+main{max-width:460px;padding:24px 16px 10vh}.brand{margin-bottom:18px;font:22px/1 "Instrument Serif",ui-serif,Georgia,serif}+h1{margin:0;font:400 40px/1.15 "Instrument Serif",ui-serif,Georgia,serif;text-wrap:balance}p{margin:10px 0 0;color:var(--muted);text-wrap:pretty}+nav{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:22px}nav a{padding:9px 16px;border-radius:999px;background:var(--btn);color:var(--btn-fg);text-decoration:none;font-weight:500}+nav a.alt{background:transparent;color:var(--fg);box-shadow:inset 0 0 0 1px var(--line)}+</style></head><body><main><div class="brand">Fuobe</div><h1>${title}</h1><p>${text}</p>${nav && `<nav>${nav}</nav>`}</main></body></html>`;return new NextResponse(html, { status: 404, headers: { "Content-Type": "text/html; charset=utf-8", "Cache-Control": "no-store" } });}const behindHttps = (request: NextRequest) => request.nextUrl.protocol === "https:";-const notFound = (request: NextRequest) =>+const HOME: PageLink = { href: "/", label: "Back to Home" };++const notFound = (request: NextRequest, section?: PageLink) =>behindHttps(request)- ? plain404("Nothing here", "The page you’re looking for moved, or never existed. Everything you made is still in your library.", true)+ ? plain404("Nothing here", "The page you’re looking for moved, or never existed.", section ? [section, HOME] : [HOME]): NextResponse.rewrite(new URL("/_fuobe-not-found", request.url), { status: 404 });const shareGone = (request: NextRequest) =>behindHttps(request)- ? plain404("This link isn’t available", "It may have expired or been turned off, or what it shared was removed. Ask the person who sent it for a new link.", false)+ ? plain404("This link isn’t available", "It may have expired or been turned off, or what it shared was removed. Ask the person who sent it for a new link.", []): NextResponse.rewrite(new URL("/s/gone", request.url), { status: 404 });/** Share pages and their files: never indexed, and the token never leaks to another site in a Referer. */@@ -138,7 +147,8 @@ function readAsGuest(request: NextRequest, isAccount: boolean): NextResponse {return NextResponse.next({ request: { headers } });}if (read.kind === "empty") return NextResponse.json(read.body, { headers: guestHeaders });- if (read.kind === "none") return NextResponse.json({ error: "Not for guests" }, { status: 404, headers: guestHeaders });+ // No content, not a 404: the browser logs no error, and the client looks again in 5 minutes (streamResponse).+ if (read.kind === "none") return new NextResponse(null, { status: 204, headers: guestHeaders });if (isAccount) return NextResponse.json({ error: ACCOUNT_LIBRARY_MESSAGE }, { status: 403, headers: { "Cache-Control": "no-store" } });return NextResponse.json({ error: GUEST_LIBRARY_MESSAGE }, { status: 401, headers: guestHeaders });}diff --git a/tests/account-gpu.test.ts b/tests/account-gpu.test.tsindex 83c0a9bf..a2a0954b 100644--- a/tests/account-gpu.test.ts+++ b/tests/account-gpu.test.ts@@ -141,8 +141,8 @@ describe("an account's own runs", () => {]) {expect(at(url, method).status, `${method} ${url}`).toBe(403);}- // The live stream carries everyone's events: not for an account (it polls).- expect(at("/api/generations/stream").status).toBe(404);+ // The live stream carries everyone's events: not for an account (it polls; no content, so no error in the console).+ expect(at("/api/generations/stream").status).toBe(204);});});diff --git a/tests/composer.test.ts b/tests/composer.test.tsindex fa5c748e..85d152fe 100644--- a/tests/composer.test.ts+++ b/tests/composer.test.ts@@ -319,6 +319,26 @@ describe("studio catalog slice", () => {});});+describe("an app page's hero", () => {+ it("says what you get: how it differs from Higgsfield stays in Details, a missing engine is said", () => {+ for (const id of ["app-similarity-score", "app-angles", "app-rap-god", "app-video-background-remover", "app-gtai", "app-shots", "app-clipcut"]) {+ const p = getPreset(id)!;+ expect(appStudio(p).subtitle ?? "", id).not.toMatch(/Higgsfield|Approximation|silent|LoRA/);+ }+ const cloudOnly = getPreset("app-similarity-score")!;+ expect(appStudio({ ...cloudOnly, open: null }).subtitle).toBe("Cloud only for now");+ expect(appStudio({ ...cloudOnly, cloud: null }).subtitle).toBe("Open source only for now");+ });++ it("names IP Cleanup for what it does, on its old address", () => {+ expect(getPreset("app-similarity-score")!.name).toBe("IP Cleanup");+ });++ it("points the silent clip apps at Video to audio", () => {+ for (const id of ["app-asmr-classic", "app-rap-god"]) expect(appStudio(getPreset(id)!).related, id).toEqual({ href: "/audio/video", label: "Add sound to your clip" });+ });+});+describe("Audio → Transcribe", () => {it("lists the transcribers of both engines, each with its spoken languages, and asks for a recording or a video", () => {const ids = studioCatalog(TRANSCRIBE_STUDIO).models.map((m) => m.id);diff --git a/tests/dop-originals.test.ts b/tests/dop-originals.test.tsindex 68dff219..80cec0e8 100644--- a/tests/dop-originals.test.ts+++ b/tests/dop-originals.test.ts@@ -318,7 +318,9 @@ describe("review fixes", () => {const whip = getPreset("motion-whip-pan")!;expect(whip.open).toMatchObject({ modelId: "fuobe-dop" });expect(whip.cloud).toMatchObject({ modelId: "kling-2-5-turbo", partner: true });- expect(whip.parity).toMatch(/partner model until the evaluation harness measures Fuobe DoP/);+ expect(whip.parity).toMatch(/In the cloud: the preset's words on a partner model/);+ // The Details popover reads as plain words: no notes for us about checks still to run.+ for (const p of [...MOTIONS, ...EFFECTS]) expect(p.parity ?? "", p.id).not.toMatch(/evaluation harness|checked on a GPU run|unverified/);// Every cloud route on Fuobe DoP brings something of its own: a LoRA, a camera LoRA or move, a grade or a relight.for (const p of [...MOTIONS, ...EFFECTS]) {if (!p.cloud || p.cloud.partner) continue;diff --git a/tests/home-start.test.ts b/tests/home-start.test.tsindex e3253f8a..2df51a10 100644--- a/tests/home-start.test.ts+++ b/tests/home-start.test.ts@@ -1,5 +1,5 @@import { afterEach, describe, expect, it, vi } from "vitest";-import { blockerFor, claimStartToken, firstMissingSlot, handoffKey, issueStartToken, startStep, withoutStart } from "@/lib/composer";+import { blockerFor, claimStartToken, firstMissingSlot, handoffKey, issueStartToken, startStep, withoutStart, withPreset } from "@/lib/composer";import { startLine, type ConnectionState } from "@/lib/connections";import { startQuotes } from "@/lib/starter-prices";import { EDIT_STUDIO, IMAGE_STUDIO } from "@/lib/studios";@@ -15,6 +15,13 @@ describe("the start flag", () => {expect(handoffKey("prompt=a+fox&go=1")).toBe(handoffKey("prompt=a+fox"));});+ it("follows the picked camera motion or effect in the address, and drops it once cleared", () => {+ expect(withPreset("/video?preset=motion-fpv-drone", "motion-zoom-in")).toBe("/video?preset=motion-zoom-in");+ expect(withPreset("https://fuobe.com/video?prompt=sky&preset=motion-bullet-time#x", undefined)).toBe("https://fuobe.com/video?prompt=sky#x");+ expect(withPreset("/video", "effect-hair-style")).toBe("/video?preset=effect-hair-style");+ expect(withPreset("/video?preset=nope", undefined)).toBe("/video");+ });+it("waits while things load, runs when nothing blocks, else explains what's missing", () => {expect(startStep({ settling: true, blocker: { message: "Loading models…" } })).toBe("wait");expect(startStep({ settling: false, blocker: null })).toBe("run");diff --git a/tests/library-pure.test.ts b/tests/library-pure.test.tsindex ed3d4bbd..5d158840 100644--- a/tests/library-pure.test.ts+++ b/tests/library-pure.test.ts@@ -337,6 +337,8 @@ describe("round-3 fixes", () => {// No stream on this server: poll, look again in 5 minutes.expect(streamResponse({ ...sse, ok: false, status: 404 }, 0)).toEqual({ open: false, retryIn: 300_000 });expect(streamResponse({ ...sse, contentType: "text/html" }, 0)).toEqual({ open: false, retryIn: 300_000 });+ // A guest or an account: no content (the proxy answers 204, which the browser logs as no error), same wait.+ expect(streamResponse({ ok: true, status: 204, contentType: null, hasBody: false }, 0)).toEqual({ open: false, retryIn: 300_000 });// A server error backs off.expect(streamResponse({ ...sse, ok: false, status: 502 }, 2)).toEqual({ open: false, retryIn: 4000 });expect(needsCatchUp(false, true, false)).toBe(false); // first connection: the lists just loadeddiff --git a/tests/security-lows.test.ts b/tests/security-lows.test.tsindex 8c4345ea..a88f7ff8 100644--- a/tests/security-lows.test.ts+++ b/tests/security-lows.test.ts@@ -197,6 +197,11 @@ describe("L-2: an unknown record or link answers 404 behind an HTTPS reverse proexpect(r.headers.get("content-type")).toMatch(/text\/html/);expect(await r.text()).toMatch(/Nothing here/);}+ // An unknown app points at the apps, then Home; a guest isn't told about a library they don't have.+ const app = await at("https://fuobe.example/apps/does-not-exist").text();+ expect(app).toMatch(/<a href="\/apps" class="alt">Browse apps<\/a><a href="\/">Back to Home<\/a>/);+ expect(app).not.toMatch(/library/);+ expect(await at("https://fuobe.example/canvas/nope-nope-nope").text()).not.toMatch(/Browse apps/);const share = at(`https://fuobe.example/s/${"A".repeat(44)}`);expect(share.status).toBe(404);expect(share.headers.get("x-middleware-rewrite")).toBeNull();