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.

Speed: cards prefetch on intent and react to the click; Marketing gets its own skeleton

Claudebde4802b759e
diff --git a/src/app/(studio)/marketing/click-to-ad/loading.tsx b/src/app/(studio)/marketing/click-to-ad/loading.tsx
new file mode 100644
index 00000000..dedb8379
--- /dev/null
+++ b/src/app/(studio)/marketing/click-to-ad/loading.tsx
@@ -0,0 +1,6 @@
+import { StudioSkeleton } from "@/components/skeletons";
+
+// Its own fallback, so the Marketing gallery's skeleton (../loading.tsx) never stands in for this form.
+export default function Loading() {
+ return <StudioSkeleton />;
+}
diff --git a/src/app/(studio)/marketing/loading.tsx b/src/app/(studio)/marketing/loading.tsx
new file mode 100644
index 00000000..9586d577
--- /dev/null
+++ b/src/app/(studio)/marketing/loading.tsx
@@ -0,0 +1,5 @@
+import { MarketingSkeleton } from "@/components/skeletons";
+
+export default function Loading() {
+ return <MarketingSkeleton />;
+}
diff --git a/src/components/home-view.tsx b/src/components/home-view.tsx
index dfedc7fa..e966b709 100644
--- a/src/components/home-view.tsx
+++ b/src/components/home-view.tsx
@@ -21,6 +21,7 @@ import {
import { useRouter } from "next/navigation";
import { lazy, Suspense, useState } from "react";
import { PageShell } from "@/components/page-shell";
+import { CardPending, IntentLink } from "@/components/intent-link";
import { PresetCard } from "@/components/preset-gallery";
import { MediaThumb } from "@/components/studio/result-media";
import { useEngine, useGenerations, useHydrated, useStatus } from "@/lib/api";
@@ -47,16 +48,16 @@ interface Counts {
/** Tool tiles. Append one entry per new destination (the grid holds five per row on wide screens). */
const tools = (c: Counts) => [
- { href: "/cinema", label: "Cinema Studio", desc: "Direct a film shot by shot", icon: Clapperboard, hue: 330 },
- { href: "/motions", label: "Camera motions", desc: `${c.motions} director moves`, icon: Film, hue: 280 },
- { href: "/effects", label: "Effects", desc: `${c.effects} viral VFX`, icon: Sparkles, hue: 20 },
- { href: "/apps", label: "Apps", desc: `${c.apps} one-click tools`, icon: Wand2, hue: 200 },
- { href: "/storyboard", label: "Storyboard", desc: "One idea, consistent frames", icon: GalleryHorizontal, hue: 100 },
- { href: "/canvas", label: "Canvas", desc: "Chain steps into a flow", icon: Network, hue: 260 },
- { href: "/lipsync", label: "Lipsync", desc: "Talking avatars", icon: Mic2, hue: 150 },
- { href: "/elements", label: "Elements", desc: "@ characters, places, props", icon: ScanFace, hue: 320 },
- { href: "/upscale", label: "Upscale", desc: "Images & video", icon: ZoomIn, hue: 240 },
- { href: "/audio", label: "Audio", desc: "Voice, SFX, music", icon: AudioLines, hue: 60 },
+ { href: "/cinema", label: "Cinema Studio", desc: "Direct a film shot by shot", icon: Clapperboard },
+ { href: "/motions", label: "Camera motions", desc: `${c.motions} director moves`, icon: Film },
+ { href: "/effects", label: "Effects", desc: `${c.effects} viral VFX`, icon: Sparkles },
+ { href: "/apps", label: "Apps", desc: `${c.apps} one-click tools`, icon: Wand2 },
+ { href: "/storyboard", label: "Storyboard", desc: "One idea, consistent frames", icon: GalleryHorizontal },
+ { href: "/canvas", label: "Canvas", desc: "Chain steps into a flow", icon: Network },
+ { href: "/lipsync", label: "Lipsync", desc: "Talking avatars", icon: Mic2 },
+ { href: "/elements", label: "Elements", desc: "@ characters, places, props", icon: ScanFace },
+ { href: "/upscale", label: "Upscale", desc: "Images & video", icon: ZoomIn },
+ { href: "/audio", label: "Audio", desc: "Voice, SFX, music", icon: AudioLines },
];
/** The latest results as a compact strip of square thumbnails; a tap opens the viewer. */
@@ -223,15 +224,17 @@ export function HomeView({ counts, motions, apps, effects }: { counts: Counts; m
<div className="mt-14 grid grid-cols-2 gap-2 sm:grid-cols-5">
{tools(counts).map((t) => (
- <Link key={t.href} href={t.href} className="group flex min-w-0 flex-col gap-2 rounded-xl border bg-background p-3 transition-colors hover:bg-accent">
- <span className="grid size-9 place-items-center rounded-lg text-white" style={{ background: `linear-gradient(135deg, oklch(0.75 0.15 ${t.hue}), oklch(0.55 0.2 ${t.hue + 40}))` }}>
- <t.icon className="size-4 transition-transform group-hover:scale-110" />
+ // Neutral chrome (Liner): the tile tints on hover, the colour stays in the content below.
+ <IntentLink key={t.href} href={t.href} className="group relative flex min-w-0 flex-col gap-2 rounded-xl border bg-background p-3 transition-colors hover:bg-accent">
+ <span className="grid size-9 place-items-center rounded-lg bg-muted text-foreground transition-colors group-hover:bg-brand-faint group-hover:text-brand-text">
+ <t.icon className="size-4" />
</span>
<span className="min-w-0">
<span className="block truncate text-[13px] font-medium">{t.label}</span>
<span className="block text-[12px] text-muted-foreground">{t.desc}</span>
</span>
- </Link>
+ <CardPending />
+ </IntentLink>
))}
</div>
diff --git a/src/components/preset-gallery.tsx b/src/components/preset-gallery.tsx
index 33dfe530..cf5fce8c 100644
--- a/src/components/preset-gallery.tsx
+++ b/src/components/preset-gallery.tsx
@@ -3,6 +3,7 @@
import Link from "next/link";
import { Cloud, Cpu, Lock, Search, Sparkles, X } from "lucide-react";
import { memo, useDeferredValue, useEffect, useMemo, useRef, useState } from "react";
+import { CardPending, IntentLink } from "@/components/intent-link";
import { PRESET_ICONS } from "@/components/preset-icons";
import { PresetPreview, usePreviewPlayback } from "@/components/preset-preview";
import { GALLERY_GRID } from "@/components/skeletons";
@@ -43,7 +44,8 @@ export const PresetCard = memo(function PresetCard({
const Icon = PRESET_ICONS[preset.icon] ?? Sparkles;
const { ref, playing, handlers } = usePreviewPlayback<HTMLAnchorElement>(preset.id);
return (
- <Link
+ // Prefetched on hover or touch, not on sight: a gallery shows hundreds of these.
+ <IntentLink
ref={ref}
href={href}
{...handlers}
@@ -62,12 +64,13 @@ export const PresetCard = memo(function PresetCard({
{preset.top && (
<span className="absolute top-1.5 left-1.5 rounded-[4px] bg-highlight px-1 text-[10px] font-semibold text-highlight-foreground">Popular</span>
)}
+ <CardPending />
</div>
<div className="min-w-0 px-0.5">
<p className="truncate text-[13px] font-medium">{preset.name}</p>
{!compact && <p className="line-clamp-2 text-[12px] leading-snug text-muted-foreground">{preset.description}</p>}
</div>
- </Link>
+ </IntentLink>
);
});
diff --git a/src/components/skeletons.tsx b/src/components/skeletons.tsx
index 937284c3..186e0e2b 100644
--- a/src/components/skeletons.tsx
+++ b/src/components/skeletons.tsx
@@ -88,3 +88,45 @@ export function PageSkeleton({ title, wide, rows = 4 }: { title?: string; wide?:
</PageShell>
);
}
+
+/** Marketing Studio: header with its tool tabs, the hero, the template grid and the docked composer. */
+export function MarketingSkeleton() {
+ return (
+ <div className="flex min-h-svh min-w-0 flex-col" aria-busy="true" aria-label="Loading">
+ <div className="sticky top-0 z-20 bg-background/85 px-3 sm:px-6">
+ <div className="flex h-14 items-center gap-2">
+ <Skeleton className="h-6 w-44 rounded-lg" />
+ <Skeleton className="ml-auto h-9 w-40 rounded-full max-sm:w-20" />
+ </div>
+ <div className="flex gap-2 overflow-hidden pb-2">
+ {Array.from({ length: 5 }, (_, i) => (
+ <Skeleton key={i} className="h-7 w-24 shrink-0 rounded-full" />
+ ))}
+ </div>
+ </div>
+ <div className="mx-auto w-full max-w-[1240px] flex-1 px-3 sm:px-6">
+ <div className="flex flex-col items-center pt-6 pb-2 sm:pt-10">
+ <Skeleton className="h-10 w-3/4 max-w-[560px] rounded-xl" />
+ <Skeleton className="mt-3 h-4 w-2/3 max-w-[420px]" />
+ <Skeleton className="mt-6 h-9 w-56 rounded-full" />
+ </div>
+ <div className="mt-6 flex gap-1.5 overflow-hidden">
+ {Array.from({ length: 8 }, (_, i) => (
+ <Skeleton key={i} className="h-8 w-24 shrink-0 rounded-full" />
+ ))}
+ </div>
+ <div className="mt-4 grid grid-cols-2 gap-x-3 gap-y-5 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5">
+ {Array.from({ length: 10 }, (_, i) => (
+ <div key={i} className="space-y-2">
+ <Skeleton className="aspect-[3/4] rounded-2xl" />
+ <Skeleton className="h-3.5 w-2/3" />
+ </div>
+ ))}
+ </div>
+ </div>
+ <div className="sticky bottom-0 px-3 pb-3 sm:px-6">
+ <Skeleton className="mx-auto h-14 w-full max-w-[860px] rounded-[20px] sm:rounded-composer" />
+ </div>
+ </div>
+ );
+}