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
Home: a wall of real covers, every studio, Assist and three ways to start
Adarshf37d6895dcaa
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex 72becc9d..d2d06c86 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -520,6 +520,7 @@ Liner-inspired shell (pale frame, rounded inset sheet, 13px sidebar rows, serif- **Shell (round 4).** "Skip to content" is the first Tab stop, the sidebar is a `<nav aria-label="Main">`, and each page has one `<main>`. Full-screen studios (`fullScreenStudio()` in `nav.ts`: a Cinema, Canvas or Layers project, and every Assist page) fold the sidebar to its icon rail without touching the remembered choice: only `SidebarShell` writes the sidebar cookie, and only when that choice changes (`persistOpen` on `SidebarProvider`). Phones get a header with the menu and Search on gallery and settings pages (`phone-bar.tsx`). `intent-link.tsx` prefetches a link on hover or focus instead of when it appears on screen (rows marked `eager` still prefetch on view). Shortcut labels show ⌘ on Apple devices and Ctrl elsewhere (`src/lib/keys.ts`). Every Copy button goes through `copyText` (`src/lib/clipboard.ts`), so copying works on plain-http LAN addresses. Since round 5 part 1 `StudioChrome` (`app-sidebar.tsx`) wraps the shell in `SkillBuilderProvider` (see Skills that run by themselves).- **Command palette** (`command-palette.tsx`, ⌘K / Ctrl+K, also the sidebar's Search row and the phone header's Search): pages, Settings sections, apps, camera motions, effects, models (filtered by engine mode, and since round 4 part 4 by Settings → Models & licences through the access summary) and recent creations, ranked with typo tolerance in `src/lib/command-search.ts`. The catalog part is `GET /api/search-index`, a static, prerendered slim index built by `paletteIndex()` in `src/lib/palette-index.ts` and fetched the first time the palette opens. `modelHref()` opens a model where it runs (a studio with `?model=`, a Video tools mode, Image to 3D, an app, Layers, Captions / Trim / Translate), else the Models page filtered by `?q=`; the round-4 tools (Remove object, Genjutsu, FPS Boost, SDR to HDR, Export, the 3D scene) aren't in its lists yet, so their models open the Models page. Since round 4 part 3 every Image to 3D model and Meshy Rigging open `/image-to-3d`, and a Fuobe Original is listed once with both engines. Since round 4 part 4 it also lists "Models & licences" (`/settings/models`) and "Assist connectors". Since round 5 part 1 a "Run a skill" group lists "Run <skill>…" for every enabled recipe skill (`skillEntries`), and Settings lists "Training (AI-Toolkit)". It replaces `global-shortcuts.tsx` (⌘K used to go Home).+- **Home** (`src/app/(studio)/page.tsx`): `homeShowcase()` in `src/lib/home-showcase.ts` (server only, `"use cache"`) names the presets, studios, models and skills Home shows and computes every number it quotes from the catalog, the ComfyUI manifest (About & licences' count), the skills folder and `LLM_PROVIDERS`; `tests/home-showcase.test.ts` checks each id has its cover and clip, shows once, and each number is the catalog's. `HomeView` keeps the composer and renders the wall right under it; the sections below (`components/home/home-sections.tsx`) are server components passed as children, with small client islands (`showcase-tile.tsx`, `before-after.tsx`, `home-islands.tsx`). Effect and app cards rest on their clip's peak frame (`public/previews/presets/peak/`, `preset-peaks.generated.ts`, cut by `scripts/gen-preset-peaks.mjs` from the published clips) and their clip starts from that frame (`PresetPreview`'s `rest`). The playback store gained `auto: "touch"` (studio cards wait for a hover where one is possible) and `paused` (Pause previews, kept in localStorage under `fuobe:previews`). Assist reads `?prompt=` into a new chat without sending it (`assistDraft`).- **Getting started and connections.** `get-started.tsx` is the first-run guide under Home's composer and at the top of Settings (Use paid models, Use your GPU, Just try it), shown until `onboarded` is set (`showFirstRun`, `FIRST_RUN_SCRIPT` in `src/lib/connections.ts`). Every connection field in Settings is a `ConnectField` (`connect-field.tsx`): Save & test sends the typed value to `POST /api/providers/test` (`{provider, value | values, field}`; the old `{provider}` body still works) and saves it only when the test passes, with a "Save anyway" link. `settings-form.tsx` has a status strip with one chip per connection (`connectionSummary`); since round 4 part 2 it has a LoRAs section (`#loras`, `lora-settings.tsx`: the LoRA folder, the civitai key with Save & test, and the library with licences and Download buttons), which the command palette also lists. `/settings/about` (`licences-view.tsx`, `src/lib/licences.ts`) lists each open model's licence from the catalog and the workflow manifest, read at build time, and since round 4 part 4 links to Settings → Models & licences (`/settings/models`, `model-access-view.tsx`: the switches; see Models & licences). Round 4 part 4 also adds a Models & licences section and Assist · connectors (`#assist-connectors`, `components/assist/connectors-settings.tsx`) to `settings-form.tsx`. Round 4 part 5 drops the Higgsfield key field and chip and the "Higgsfield first" Preferred provider (`PROVIDER_SETTINGS`, `CLOUD_PROVIDERS` and `connectionSummary` in `src/lib/connections.ts`). Round 5 part 1 adds Training · AI-Toolkit (`#training`: three `ConnectField`s tested as provider `ai-toolkit`), retitles the LoRAs section "LoRAs · looks, motions, effects and adapters" with an Adapters tab, and (fixes-5) makes every "Settings → …" message and `/settings#…` link name a section that exists, which `tests/settings-links.test.ts` enforces.- **Studio pages** render `<Studio config>` (`src/components/studio/studio.tsx`), a server component that passes `studioCatalog(config)` from `src/lib/studio-catalog.ts`: the studio's models without provider field maps. Inside, `CatalogProvider` / `useCatalog()` resolve models; `loadFullCatalog()` imports `@/lib/catalog` lazily for motions, effects, `?preset=` and unknown ids. Client components under `studio/` must not import `@/lib/catalog` or `@/lib/studios`. `StudioPage` renders the same tree in the static shell and after hydration; hand-off params merge into the draft with `mergeHandoff`. `StudioConfig` (`studio-context.tsx`) gained `pickerOps`, `anyOf`, `signature` and `extraModels`, and in round 4 `frames` (Frames mode), `comfyOnly` (a tool that runs only on ComfyUI, with a note and an alternative) and `related` (a link under the hero). `HandoffSync` in `studio-page.tsx` also runs Home's Start: Home issues a one-time token (`issueStartToken` in `src/lib/composer.ts`, kept in sessionStorage) and opens the studio with `?prompt=…&go=<token>`; the studio submits once if `claimStartToken` accepts it, so a link from elsewhere can't start a run. A `?model=` that names the other engine's model switches the remembered engine; since round 4 part 3 it also survives the composer's swap of an untouched draft's default model when the engine is read after hydration (`followEngineDefault`: before, a link on the open engine landed on the studio's default model). Since round 4 part 5 a `?model=` naming a retired model opens on its replacement (`currentModelId`), and Reuse of a run on one migrates its request in the browser (`migrateRequest` without Director words) and toasts what changed; the composer's provider style chip (`ProviderPresetChip`, Higgsfield's live styles) is gone. The line under Home's composer prices what Start will run from the catalog (`startQuotes` in `src/lib/starter-prices.ts`, worded by `startLine` in `src/lib/connections.ts`).- **Hubs** (Audio, Video tools, Upscale) have one prerendered path per mode (`src/lib/hubs.ts`, `ModeSwitchStudio` in `mode-switch-studio.tsx`, `[mode]/page.tsx`); old `?mode=` links redirect in `next.config.ts`, and an unknown mode is a real 404. Round 4 adds `/upscale/fps`, `/upscale/hdr`, `/upscale/export`, `/audio/transcribe`, `/audio/loop`, `/audio/join` and `/video-tools/remove-object`; round 5 part 1 adds `/video-tools/evolution`, and round 5 part 2 `/audio/split` (`SplitSoundtrackTool` in `TOOLS`).diff --git a/docs/FEATURES.md b/docs/FEATURES.mdindex 66e4126a..d075d9c0 100644--- a/docs/FEATURES.md+++ b/docs/FEATURES.md@@ -83,6 +83,7 @@ Fuobe is a complete creative studio you can run yourself: 108 camera motions, 25## Getting around, models and licences+- **Home:** the composer with four prompts to try (one opens Assist with a job typed in), then a wall of eight real covers that play as they come into view, rows of effects, camera motions and apps (a before/after to drag), every studio and tool, what Assist does and plans with, the open-source numbers and the newest open models, all read from the catalog, and three ways to start. **Pause previews** stops every preview that plays by itself, on every page, and is remembered- **Getting around:** a **Get started** card on Home and Settings (use paid models, use your GPU, or just try the demo); a **⌘K / Ctrl+K palette** that searches pages, settings, apps, motions, effects, models and recent creations, and runs your skills; Start on Home runs the job and says first what it costs; **Settings → About & licences** lists every open model's licence, and its **Credits** list the attributions behind Split soundtrack's DBS models (their DnR v2 training data and the code they vendor)- **Connect your GPU** (`/connect`): checks that your ComfyUI has every node pack and file a tool needs, and shows each tool as Ready, One step away, Needs setup or Needs a bigger GPU. Split soundtrack, Fly path and Turnaround have rows of their own, and MOSS-Image is listed under Image- **Models & licences:** **Settings → Models & licences** (`/settings/models`, also from ⌘K, About & licences and the Models page) shows the licence of every model, LoRA and ComfyUI node pack, with switches per licence class, provider, node pack, LoRA and model. Everything is on by default, and LoRAs licensed for your GPU only go to fal or Replicate with a note unless you turn on **Keep them on your GPU**. A model you switch off leaves every picker and listing (studios, Canvas, Cinema, ⌘K, the API and CLI, Assist and Fuobe's MCP server); automatic picks move to the next model that is on, and a run that can't is refused, naming the switch. Switching off an adapter LoRA an Original's recipe always loads (the try-on LoRA, say) takes that Original out the same way. Each model round 5, part 2 adds has its own switch, and ComfyUI-DBS (MIT) one as a node pack. About 15 hosted open-weight models show a "Weights:" line with their weights' licence, and a long licence note opens with More. Anyone who can sign in can change it, and trainings and Assist's own Claude or local-model calls aren't under the switchesdiff --git a/src/app/(studio)/page.tsx b/src/app/(studio)/page.tsxindex baed863c..caef2726 100644--- a/src/app/(studio)/page.tsx+++ b/src/app/(studio)/page.tsx@@ -1,24 +1,42 @@+import {+ AppsSection,+ AssistSection,+ EffectsSection,+ HomeFooter,+ MotionsSection,+ OpenSourceSection,+ ShowcaseWall,+ StartSection,+ StudiosSection,+} from "@/components/home/home-sections";import { HomeView } from "@/components/home-view";-import { APPS, EFFECTS, MOTIONS } from "@/lib/catalog";-import { toPresetCard } from "@/lib/preset-card-data";-import { homeEffects } from "@/lib/preset-cards";+import { ASSIST_SUGGESTIONS } from "@/lib/assist";+import { HOME_TRY, homeShowcase, roundedDown } from "@/lib/home-showcase";import { startQuotes, starterPriceLine } from "@/lib/starter-prices";-const HOME_MOTIONS = ["motion-crash-zoom-in", "motion-360-orbit", "motion-bullet-time", "motion-fpv-drone", "motion-dolly-zoom-in", "motion-snorricam"];--/** The catalog stays on the server: the home view gets 18 slim cards, three counts, and what Start and the first-run guide cost. */-export default function Page() {+/**+ * The catalog stays on the server: Home gets slim cards, the numbers it quotes (each computed, lib/home-showcase.ts),+ * and what Start and the first-run guide cost. The sections under the wall are server components.+ */+export default async function Page() {+ const home = await homeShowcase();return (<HomeView- counts={{ motions: MOTIONS.length, effects: EFFECTS.length, apps: APPS.length }}- motions={MOTIONS.filter((m) => HOME_MOTIONS.includes(m.id)).map(toPresetCard)}- apps={APPS.slice(0, 12)- .filter((a) => a.badges?.includes("top") || a.category === "Camera")- .slice(0, 6)- .map(toPresetCard)}- effects={homeEffects(EFFECTS, 6).map(toPresetCard)}+ openModels={roundedDown(home.facts.openModels)}+ chips={HOME_TRY}+ assist={{ label: "Plan a perfume ad with Assist", href: `/assist?prompt=${encodeURIComponent(ASSIST_SUGGESTIONS[0])}` }}+ wall={<ShowcaseWall wall={home.wall} />}prices={starterPriceLine()}quotes={startQuotes()}- />+ >+ <EffectsSection facts={home.facts} effects={home.effects} />+ <MotionsSection facts={home.facts} motions={home.motions} />+ <AppsSection facts={home.facts} beforeAfter={home.beforeAfter} reveals={home.reveals} />+ <StudiosSection facts={home.facts} studios={home.studios} audioTools={home.audioTools} pills={home.pills} />+ <AssistSection facts={home.facts} runsOn={home.runsOn} skills={home.skills} />+ <OpenSourceSection facts={home.facts} newModels={home.newModels} />+ <StartSection />+ <HomeFooter />+ </HomeView>);}diff --git a/src/app/globals.css b/src/app/globals.cssindex e714b134..de43d614 100644--- a/src/app/globals.css+++ b/src/app/globals.css@@ -216,6 +216,9 @@--animate-caret: caret-blink 1s step-end infinite;/* Click feedback while a link's route loads: shows only if the navigation takes a moment. */--animate-pending-in: pending-in 150ms ease-out 120ms both;+ /* Home: the composer's ring brightens once when a Try chip fills it; Audio's waveform ripples on hover. */+ --animate-ring-flash: ring-flash 260ms ease-out both;+ --animate-wave-bar: wave-bar 900ms ease-in-out infinite;@keyframes shimmer-text {from { mask-position: 100% 0; }@@ -241,6 +244,15 @@0%, 49% { opacity: 1; }50%, 100% { opacity: 0; }}+ @keyframes ring-flash {+ 0% { opacity: 0; }+ 35% { opacity: 1; }+ 100% { opacity: 0; }+ }+ @keyframes wave-bar {+ 0%, 100% { transform: scaleY(1); }+ 50% { transform: scaleY(0.35); }+ }}@layer base {diff --git a/src/components/app-sidebar.tsx b/src/components/app-sidebar.tsxindex 5e3c373b..4b9829cd 100644--- a/src/components/app-sidebar.tsx+++ b/src/components/app-sidebar.tsx@@ -35,6 +35,7 @@ import {import { Kbd } from "@/components/ui/kbd";import { Skeleton } from "@/components/ui/skeleton";import { CommandPalette, CommandPaletteProvider, useCommandPalette } from "@/components/command-palette";+import { GitHubMark } from "@/components/github-mark";import { IntentLink } from "@/components/intent-link";import { JobNotifications } from "@/components/job-notifications";import { NAV, type NavGroupDef } from "@/components/nav-items";@@ -521,15 +522,6 @@ function AccountRow() {);}-/** The GitHub mark (lucide has no brand icons). */-function GitHubMark() {- return (- <svg viewBox="0 0 16 16" aria-hidden fill="currentColor">- <path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z" />- </svg>- );-}-export function AppSidebar() {const { resolvedTheme, setTheme } = useTheme();const { isMobile, setOpenMobile } = useSidebar();diff --git a/src/components/assist-view.tsx b/src/components/assist-view.tsxindex 331f4062..b6cc897b 100644--- a/src/components/assist-view.tsx+++ b/src/components/assist-view.tsx@@ -22,7 +22,7 @@ import { SkillIcon } from "@/components/assist/skill-icon";import { Transcript } from "@/components/assist/transcript";import { AssistVisitorNote } from "@/components/assist/visitor-note";import { useAssistActions, useAssistThread, useEngine } from "@/lib/api";-import { ASSIST_SUGGESTIONS, modeLabel, threadModeChoice, type AssistAvailability, type AssistModeChoice, type AssistProject, type AssistThread, type SkillSummary } from "@/lib/assist";+import { ASSIST_SUGGESTIONS, assistDraft, modeLabel, threadModeChoice, type AssistAvailability, type AssistModeChoice, type AssistProject, type AssistThread, type SkillSummary } from "@/lib/assist";import type { Generation } from "@/lib/catalog/types";import { cn } from "@/lib/utils";import { toastError } from "@/lib/refusals";@@ -92,9 +92,10 @@ export function AssistView() {const [engine, setEngine] = useEngine();const [askFirst, setAskFirst] = useState(true);const [open, setOpen] = useState<{ g: Generation; i: number } | null>(null);- // "Use in a new chat" on a skill opens /assist?skill=<name>: the composer starts with "/name ".+ // "Use in a new chat" on a skill opens /assist?skill=<name>: the composer starts with "/name ". Home's examples open+ // /assist?prompt=<text>: the composer starts with the text. Neither sends anything.const skillParam = params.get("skill");- const [draft, setDraft] = useState(() => ({ key: 0, text: skillParam && /^[a-z0-9-]+$/.test(skillParam) ? `/${skillParam} ` : "" }));+ const [draft, setDraft] = useState(() => ({ key: 0, text: assistDraft(skillParam, params.get("prompt")) }));const chats = useChats({ project: "none" });const can = chats.data?.availability;const [choice, setChoice] = useModeChoice(can?.defaultMode);diff --git a/src/components/github-mark.tsx b/src/components/github-mark.tsxnew file mode 100644index 00000000..e46ead56--- /dev/null+++ b/src/components/github-mark.tsx@@ -0,0 +1,8 @@+/** The GitHub mark (lucide has no brand icons). */+export function GitHubMark({ className }: { className?: string }) {+ return (+ <svg viewBox="0 0 16 16" aria-hidden fill="currentColor" className={className}>+ <path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z" />+ </svg>+ );+}diff --git a/src/components/home-view.tsx b/src/components/home-view.tsxindex 1e08f3df..a750f9e7 100644--- a/src/components/home-view.tsx+++ b/src/components/home-view.tsx@@ -1,40 +1,24 @@"use client";import Link from "next/link";-import {- ArrowRight,- AudioLines,- CircleAlert,- Clapperboard,- Film,- GalleryHorizontal,- ImageIcon,- Loader2,- Mic2,- Network,- ScanFace,- Sparkles,- Video,- Wand2,- ZoomIn,-} from "lucide-react";+import { ArrowRight, CircleAlert, ImageIcon, Loader2, MessageCircle, Video, Wand2 } from "lucide-react";import { useRouter, useSearchParams } from "next/navigation";import { lazy, Suspense, useCallback, useEffect, useRef, useState } from "react";import { GetStarted } from "@/components/get-started";+import { GitHubMark } from "@/components/github-mark";import { PageShell } from "@/components/page-shell";import { Skeleton } from "@/components/ui/skeleton";import { HadItemsScript, useHadItems } from "@/components/use-had-items";-import { CardPending, IntentLink } from "@/components/intent-link";-import { PresetCard } from "@/components/preset-gallery";+import { IntentLink } from "@/components/intent-link";+import { useFadeEdges } from "@/components/preset-gallery";import { MediaThumb } from "@/components/studio/result-media";import { CONNECT_GPU_EVENT, signInHref, useEngine, useGenerations, useHydrated, useStatus } from "@/lib/api";import { EngineSwitch } from "@/components/studio/engine-switch";import type { Generation } from "@/lib/catalog/types";import { issueStartToken, START_PARAM } from "@/lib/composer";-import { FIRST_RUN_KEY, FIRST_RUN_SCRIPT, nothingConnected as noConnection, showFirstRun, startLine, type StartQuote } from "@/lib/connections";+import { FIRST_RUN_KEY, FIRST_RUN_SCRIPT, FUOBE_REPO, nothingConnected as noConnection, showFirstRun, startLine, type StartQuote } from "@/lib/connections";import { userTitle } from "@/lib/library";import { NEW_CREATION_PARAM } from "@/lib/nav";-import type { PresetCardData } from "@/lib/preset-cards";import { cn } from "@/lib/utils";// The viewer is only needed once a recent result is opened.@@ -46,26 +30,13 @@ const MODES = [{ id: "edit", label: "Edit", icon: Wand2, href: "/edit", placeholder: "Describe a change (you'll add the image next)…" },];-interface Counts {- motions: number;- effects: number;- apps: number;+/** A Try chip under the composer: it picks the mode and fills in the prompt; Start still runs it. */+export interface TryChip {+ mode: "image" | "video" | "edit";+ label: string;+ prompt: string;}-/** 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 },- { 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: "Video, FPS, HDR & images", 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. */function RecentStrip({ items }: { items: Generation[] }) {const [open, setOpen] = useState<string | null>(null);@@ -133,16 +104,6 @@ function Row({ title, href, children, className }: { title: string; href: string);}-function CardRow({ cards, href, engine }: { cards: PresetCardData[]; href: (c: PresetCardData) => string; engine?: "cloud" | "open" }) {- return (- <div className="grid grid-cols-2 gap-1 sm:grid-cols-4 lg:grid-cols-6">- {cards.map((p) => (- <PresetCard key={p.id} preset={p} href={href(p)} compact engine={engine} />- ))}- </div>- );-}-/*** Runs while the HTML is parsed, ahead of the guide: hides the shell's guide before the first paint* in a browser that already put it away. On the client it renders as inert text/plain (React warns@@ -167,18 +128,26 @@ function NewCreation({ onNew }: { onNew: () => void }) {return null;}+/**+ * Home: what Fuobe is, the composer, a few prompts to try, then the wall of real covers (`wall`) right under them.+ * The sections below (`children`) are rendered on the server, so their words and pictures ship no script.+ */export function HomeView({- counts,- motions,- apps,- effects,+ openModels,+ chips,+ assist,+ wall,+ children,prices,quotes,}: {- counts: Counts;- motions: PresetCardData[];- apps: PresetCardData[];- effects: PresetCardData[];+ /** "130+": the open models a visitor runs on their own GPU (About & licences' count, rounded down). */+ openModels: string;+ chips: readonly TryChip[];+ /** The Try chip that opens Assist with a job typed in. */+ assist: { label: string; href: string };+ wall: React.ReactNode;+ children: React.ReactNode;/** What a first paid image and clip cost, for the first-run guide. */prices?: string;/** What Start runs in each mode, and its price on the paid engine. */@@ -188,6 +157,9 @@ export function HomeView({const [mode, setMode] = useState(MODES[0]);const [prompt, setPrompt] = useState("");const box = useRef<HTMLTextAreaElement>(null);+ // Bumped by a Try chip: the composer's ring brightens once.+ const [flash, setFlash] = useState(0);+ const chipRow = useFadeEdges<HTMLDivElement>();const [engine, setEngine, engineMode] = useEngine();const recent = useGenerations({ limit: 6 });// How many (up to 6): a phone's grid holds 3 a row, so 1 to 3 results are one row of skeletons, 4 to 6 two.@@ -213,8 +185,6 @@ export function HomeView({document.documentElement.setAttribute("data-first-run", firstRun ? "1" : "0");}, [status, firstRun]);- const locked = engineMode === "both" ? undefined : engineMode;-// With a prompt, the studio starts the run itself, or points at the photo it still needs. `go`// carries a one-time token from this tab, so only this button can start a run that way.const go = () => {@@ -229,23 +199,50 @@ export function HomeView({setPrompt("");requestAnimationFrame(() => box.current?.focus());}, []);+ // A Try chip: its mode and prompt go in, the caret goes to the end, and nothing runs until Start.+ const tryChip = (c: TryChip) => {+ setMode(MODES.find((m) => m.id === c.mode) ?? MODES[0]);+ setPrompt(c.prompt);+ setFlash((n) => n + 1);+ box.current?.focus();+ requestAnimationFrame(() => box.current?.setSelectionRange(c.prompt.length, c.prompt.length));+ };return (<PageShell><Suspense fallback={null}><NewCreation onNew={startOver} /></Suspense>- <div className="flex flex-col items-center pt-[8vh] text-center">- <h1 className="font-heading text-display text-balance sm:text-[44px]">What will you create today?</h1>- <p className="mt-2 text-[15px] text-muted-foreground">+ <div className="flex flex-col items-center pt-[3vh] text-center">+ <a+ href={FUOBE_REPO}+ target="_blank"+ rel="noopener"+ className="group mb-3 inline-flex h-7 items-center gap-1.5 rounded-full bg-muted px-3 text-[12px] text-muted-foreground transition-colors hover:text-foreground"+ >+ <GitHubMark className="size-3.5" />+ MIT licence+ <span aria-hidden>·</span>+ <span className="font-medium text-brand-text">+ Code on GitHub{" "}+ <span aria-hidden className="inline-block transition-transform duration-150 group-hover:translate-x-0.5">+ →+ </span>+ </span>+ </a>+ <h1 className="font-heading text-display text-balance sm:text-[44px]">+ <span className="inline-block">A complete AI studio.</span> <span className="inline-block">Open source.</span>+ </h1>+ <p className="mt-2 text-[15px] text-pretty text-muted-foreground">{/* Before the status: the words a public studio's visitors get (the owner's own install corrects them in a moment). */}{!status || visitor || engineMode === "open"- ? "Fully open-source models running on your own ComfyUI."+ ? `Pictures, video, sound and 3D on ${openModels} open models, free on your own GPU through ComfyUI.`: engineMode === "cloud"? "Frontier paid models through your own API keys.": "Frontier cloud models or fully open-source workflows — same studio, your choice."}</p>- <div className="mt-8 w-full max-w-[720px] rounded-[20px] border bg-background p-2.5 text-left shadow-soft transition focus-within:border-primary focus-within:ring-4 focus-within:ring-brand-faint sm:rounded-composer">+ <div className="relative mt-6 w-full max-w-[720px] rounded-[20px] border bg-background p-2.5 text-left shadow-soft transition focus-within:border-primary focus-within:ring-4 focus-within:ring-brand-faint sm:rounded-composer">+ {flash > 0 && <span key={flash} aria-hidden className="pointer-events-none absolute -inset-px animate-ring-flash rounded-[inherit] ring-4 ring-primary/30 motion-reduce:hidden" />}<textareavalue={prompt}onChange={(e) => setPrompt(e.target.value)}@@ -290,7 +287,7 @@ export function HomeView({</div></div></div>- {/* Its line's height is kept from the first paint, so the tools under it don't move when it fills in. */}+ {/* Its line's height is kept from the first paint, so the chips and the wall under it don't move when it fills in. */}{visitor && openModel && !visitor.gpu.connected ? (<p className="mt-2 min-h-[18px] text-[12px] text-muted-foreground">{visitor.kind === "guest" ? (@@ -322,6 +319,34 @@ export function HomeView({)}</p>)}+ {/* A phone's chips are one row that scrolls sideways (none is cut); wider, they wrap, centred (a mouse can't scroll a row with no scrollbar). */}+ <div+ ref={chipRow}+ className="fade-x scrollbar-none mt-6 flex items-center gap-1.5 max-sm:-mx-4 max-sm:h-8 max-sm:w-[calc(100%+2rem)] max-sm:overflow-x-auto max-sm:px-4 sm:flex-wrap sm:justify-center sm:[mask-image:none]"+ >+ <span className="mr-0.5 hidden shrink-0 text-[12px] text-muted-foreground sm:block">Try</span>+ {chips.map((c) => {+ const Icon = MODES.find((m) => m.id === c.mode)?.icon ?? ImageIcon;+ return (+ <button+ key={c.label}+ type="button"+ onClick={() => tryChip(c)}+ className="inline-flex h-8 shrink-0 items-center gap-1.5 rounded-full border bg-background px-3 text-[13px] whitespace-nowrap text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"+ >+ <Icon className="size-3.5" />+ {c.label}+ </button>+ );+ })}+ <IntentLink+ href={assist.href}+ className="inline-flex h-8 shrink-0 items-center gap-1.5 rounded-full border border-transparent bg-brand-faint px-3 text-[13px] whitespace-nowrap text-brand-text transition-colors hover:bg-brand-faint-hover"+ >+ <MessageCircle className="size-3.5" />+ {assist.label}+ </IntentLink>+ </div>{guide ? (<><FirstRunScript />@@ -347,59 +372,36 @@ export function HomeView({)}</div>- <div className="mt-14 grid grid-cols-2 gap-2 sm:grid-cols-5">- {tools(counts).map((t) => (- // 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>- <CardPending />- </IntentLink>- ))}- </div>+ {wall}- <div className="mt-14 space-y-12">- {recent.data?.length ? (- <Row title="Recent" href="/library">- <RecentStrip items={recent.data.slice(0, 6)} />- </Row>- ) : (- // Loading, in a browser that saw results here last time: the row keeps its place from the first paint, so the rows below don't move down when it arrives.- !recent.data && (- <>- <HadItemsScript name="home-recent" />- <Row title="Recent" href="/library" className="hidden [html[data-had-home-recent]_&]:block">- <div className="grid grid-cols-3 gap-2 sm:grid-cols-6" aria-busy="true" aria-label="Loading recent results">- {Array.from({ length: 6 }, (_, i) => (- <Skeleton- key={i}- className={cn(- "aspect-square rounded-xl",- // A phone's second row only when the last visit had more than 3.- i >= 3 && "max-sm:hidden [html[data-had-home-recent='4']_&]:block [html[data-had-home-recent='5']_&]:block [html[data-had-home-recent='6']_&]:block",- )}- />- ))}- </div>- </Row>- </>- )- )}- <Row title="Camera motions" href="/motions">- <CardRow cards={motions} href={(p) => `/video?preset=${p.id}`} engine={locked} />- </Row>- <Row title="Popular apps" href="/apps">- <CardRow cards={apps} href={(p) => `/apps/${p.id}`} engine={locked} />+ {recent.data?.length ? (+ <Row title="Recent" href="/library" className="mt-12 sm:mt-16">+ <RecentStrip items={recent.data.slice(0, 6)} /></Row>- <Row title="Effects" href="/effects">- <CardRow cards={effects} href={(p) => `/video?preset=${p.id}`} engine={locked} />- </Row>- </div>+ ) : (+ // Loading, in a browser that saw results here last time: the row keeps its place from the first paint, so the rows below don't move down when it arrives.+ !recent.data && (+ <>+ <HadItemsScript name="home-recent" />+ <Row title="Recent" href="/library" className="mt-12 hidden sm:mt-16 [html[data-had-home-recent]_&]:block">+ <div className="grid grid-cols-3 gap-2 sm:grid-cols-6" aria-busy="true" aria-label="Loading recent results">+ {Array.from({ length: 6 }, (_, i) => (+ <Skeleton+ key={i}+ className={cn(+ "aspect-square rounded-xl",+ // A phone's second row only when the last visit had more than 3.+ i >= 3 && "max-sm:hidden [html[data-had-home-recent='4']_&]:block [html[data-had-home-recent='5']_&]:block [html[data-had-home-recent='6']_&]:block",+ )}+ />+ ))}+ </div>+ </Row>+ </>+ )+ )}++ {children}</PageShell>);}diff --git a/src/components/home/before-after.tsx b/src/components/home/before-after.tsxnew file mode 100644index 00000000..7a317130--- /dev/null+++ b/src/components/home/before-after.tsx@@ -0,0 +1,216 @@+"use client";++import { ArrowRight } from "lucide-react";+import { useEffect, useId, useRef, useState } from "react";+import { IntentLink } from "@/components/intent-link";+import { cn } from "@/lib/utils";++export interface BeforeAfterPair {+ id: string;+ name: string;+ before: string;+ after: string;+ /** What each side shows: "Sketch", "Photo". */+ tags: string[];+ /** How much both pictures are enlarged, so an edge in the source never shows. */+ zoom: number;+ href: string;+}++const clamp = (n: number) => Math.min(100, Math.max(0, n));+const easeInOut = (t: number) => (t < 0.5 ? 2 * t * t : 1 - (-2 * t + 2) ** 2 / 2);+/** The one-time peek: where the handle goes, and how long it takes, once the picture is mostly in view. */+const PEEK = [50, 80, 20, 50];+const PEEK_MS = 1400;++/**+ * An app's before and after, to drag between, with a tab per app. The first time it's mostly in view (and both+ * pictures are in), the handle sweeps once to show it moves; any touch or key stops that, and with reduced motion it+ * never moves by itself. Stills only: it plays no clip.+ */+export function BeforeAfter({ pairs }: { pairs: BeforeAfterPair[] }) {+ const [tab, setTab] = useState(0);+ const [pos, setPos] = useState(50);+ /** Bumped as each picture comes in, to look again whether the peek can start. */+ const [loaded, setLoaded] = useState(0);+ const [inView, setInView] = useState(false);+ const box = useRef<HTMLDivElement>(null);+ const dragging = useRef(false);+ /** Set once the peek ran, or the viewer moved the handle first. */+ const peeked = useRef(false);+ const frame = useRef(0);+ const id = useId();+ const pair = pairs[tab];+ const [beforeTag, afterTag] = pair.tags;++ useEffect(() => {+ const el = box.current;+ if (!el || typeof IntersectionObserver === "undefined") return;+ const io = new IntersectionObserver(([e]) => {+ if (e.intersectionRatio < 0.6) return;+ setInView(true);+ io.disconnect();+ }, { threshold: 0.6 });+ io.observe(el);+ return () => io.disconnect();+ }, []);++ useEffect(() => {+ // Both pictures in (a load before hydration fires no onLoad, so look at them too).+ const shown = [...(box.current?.querySelectorAll("img") ?? [])].every((img) => img.complete && img.naturalWidth > 0);+ if (!inView || !shown || peeked.current) return;+ peeked.current = true;+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;+ const t0 = performance.now();+ const step = (t: number) => {+ const p = Math.min(1, (t - t0) / PEEK_MS);+ const leg = Math.min(PEEK.length - 2, Math.floor(p * (PEEK.length - 1)));+ const local = p * (PEEK.length - 1) - leg;+ setPos(PEEK[leg] + (PEEK[leg + 1] - PEEK[leg]) * easeInOut(local));+ if (p < 1) frame.current = requestAnimationFrame(step);+ };+ frame.current = requestAnimationFrame(step);+ }, [inView, loaded]);+ useEffect(() => () => cancelAnimationFrame(frame.current), []);++ /** The viewer takes over: no more peeking. */+ const take = () => {+ peeked.current = true;+ cancelAnimationFrame(frame.current);+ };+ const at = (clientX: number) => {+ const r = box.current!.getBoundingClientRect();+ return clamp(((clientX - r.left) / r.width) * 100);+ };+ const pick = (i: number) => {+ if (i === tab) return;+ take();+ setTab(i);+ setPos(50);+ };+ const preload = (p: BeforeAfterPair) => {+ for (const src of [p.before, p.after]) new Image().src = src;+ };+ const value = Math.round(pos);++ return (+ <div className="w-full max-w-[512px] xl:max-w-[460px]">+ <div+ ref={box}+ id={`${id}-panel`}+ role="tabpanel"+ aria-label={`${pair.name}: ${beforeTag} and ${afterTag}`}+ className="relative isolate aspect-[4/3] cursor-ew-resize touch-pan-y overflow-hidden rounded-xl bg-muted select-none"+ onPointerDown={(e) => {+ if (e.button !== 0) return;+ take();+ dragging.current = true;+ e.currentTarget.setPointerCapture(e.pointerId);+ setPos(at(e.clientX));+ }}+ onPointerMove={(e) => dragging.current && setPos(at(e.clientX))}+ onPointerUp={() => (dragging.current = false)}+ onPointerCancel={() => (dragging.current = false)}+ >+ <div key={pair.id} className="absolute inset-0 motion-safe:animate-in motion-safe:fade-in motion-safe:duration-150">+ {/* Both enlarged alike (pair.zoom), so an edge in the source never shows; the after is cut at the handle. */}+ {/* eslint-disable-next-line @next/next/no-img-element */}+ <img+ src={pair.before}+ alt=""+ width={512}+ height={384}+ loading="lazy"+ decoding="async"+ draggable={false}+ onLoad={() => setLoaded((n) => n + 1)}+ className="absolute inset-0 size-full object-cover"+ style={{ scale: pair.zoom }}+ />+ <div className="absolute inset-0" style={{ clipPath: `inset(0 0 0 ${pos}%)` }}>+ {/* eslint-disable-next-line @next/next/no-img-element */}+ <img+ src={pair.after}+ alt=""+ width={512}+ height={384}+ loading="lazy"+ decoding="async"+ draggable={false}+ onLoad={() => setLoaded((n) => n + 1)}+ className="absolute inset-0 size-full object-cover"+ style={{ scale: pair.zoom }}+ />+ </div>+ </div>+ <span className="pointer-events-none absolute top-2.5 left-2.5 rounded bg-black/45 px-1.5 text-[11px] leading-5 text-white">{beforeTag}</span>+ <span className="pointer-events-none absolute top-2.5 right-2.5 rounded bg-black/45 px-1.5 text-[11px] leading-5 text-white">{afterTag}</span>+ <span aria-hidden className="pointer-events-none absolute inset-y-0 -ml-px w-0.5 bg-white shadow-[0_0_6px_rgb(0_0_0/35%)]" style={{ left: `${pos}%` }} />+ <span+ role="slider"+ tabIndex={0}+ aria-label={`Compare ${beforeTag.toLowerCase()} and ${afterTag.toLowerCase()}`}+ aria-valuemin={0}+ aria-valuemax={100}+ aria-valuenow={value}+ aria-valuetext={`${beforeTag} ${value}%, ${afterTag} ${100 - value}%`}+ onKeyDown={(e) => {+ const big = e.shiftKey ? 25 : 5;+ const next =+ e.key === "ArrowLeft" || e.key === "ArrowDown" ? pos - big : e.key === "ArrowRight" || e.key === "ArrowUp" ? pos + big : e.key === "Home" ? 0 : e.key === "End" ? 100 : null;+ if (next === null) return;+ e.preventDefault();+ take();+ setPos(clamp(next));+ }}+ className="absolute top-1/2 -mt-3.5 -ml-3.5 grid size-7 place-items-center rounded-full bg-white text-black shadow-[0_2px_8px_rgb(0_0_0/30%)] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"+ style={{ left: `${pos}%` }}+ >+ <svg viewBox="0 0 16 16" aria-hidden className="size-3.5" fill="currentColor">+ <path d="M6 4 2 8l4 4V4Zm4 0v8l4-4-4-4Z" />+ </svg>+ </span>+ </div>+ <div+ role="tablist"+ aria-label="Apps to compare"+ className="mt-2 flex gap-1.5"+ onKeyDown={(e) => {+ if (e.key !== "ArrowRight" && e.key !== "ArrowLeft") return;+ e.preventDefault();+ const next = (tab + (e.key === "ArrowRight" ? 1 : pairs.length - 1)) % pairs.length;+ pick(next);+ (e.currentTarget.querySelectorAll<HTMLElement>('[role="tab"]')[next] as HTMLElement | undefined)?.focus();+ }}+ >+ {pairs.map((p, i) => (+ <button+ key={p.id}+ type="button"+ role="tab"+ aria-selected={i === tab}+ aria-controls={`${id}-panel`}+ tabIndex={i === tab ? 0 : -1}+ onClick={() => pick(i)}+ onPointerEnter={() => preload(p)}+ onFocus={() => preload(p)}+ className={cn(+ "flex min-w-0 flex-1 items-center gap-1.5 rounded-lg p-1 pr-1.5 text-left sm:gap-2 sm:pr-2 text-[12px] font-medium text-muted-foreground transition-colors outline-none hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",+ i === tab && "bg-muted text-foreground",+ )}+ >+ {/* eslint-disable-next-line @next/next/no-img-element */}+ <img src={`/previews/presets/thumbs/${p.id}.jpg`} alt="" width={56} height={42} loading="lazy" decoding="async" className="h-6 w-8 shrink-0 rounded object-cover sm:h-[42px] sm:w-14 sm:rounded-md" />+ <span className="line-clamp-2 leading-tight">{p.name}</span>+ </button>+ ))}+ </div>+ <div className="mt-2 flex items-center justify-between gap-3 text-[12px] text-muted-foreground">+ <span>Drag to compare</span>+ <IntentLink href={pair.href} className="inline-flex items-center gap-1 font-medium text-brand-text hover:underline underline-offset-2">+ Try {pair.name} <ArrowRight className="size-3.5" />+ </IntentLink>+ </div>+ </div>+ );+}diff --git a/src/components/home/home-islands.tsx b/src/components/home/home-islands.tsxnew file mode 100644index 00000000..cca2c45d--- /dev/null+++ b/src/components/home/home-islands.tsx@@ -0,0 +1,186 @@+"use client";++import { ArrowRight, Check, Copy, Pause, Play } from "lucide-react";+import { useEffect, useRef, useState } from "react";+import { CardPending, IntentLink } from "@/components/intent-link";+import { useFadeEdges } from "@/components/preset-gallery";+import { PresetPreview, setPreviewsPaused, usePreviewPlayback, usePreviewsPaused } from "@/components/preset-preview";+import { CONNECT_GPU_EVENT, signInHref, useHydrated, useStatus } from "@/lib/api";+import { copyWithToast } from "@/lib/clipboard";+import type { PresetCardData } from "@/lib/preset-cards";+import { cn } from "@/lib/utils";++/** A row that scrolls sideways on a phone, its edges fading where there's more to see. */+export function FadeRow({ className, children }: { className?: string; children: React.ReactNode }) {+ const ref = useFadeEdges<HTMLDivElement>();+ return (+ <div ref={ref} className={cn("fade-x scrollbar-none max-sm:-mx-4 max-sm:overflow-x-auto max-sm:px-4", className)}>+ {children}+ </div>+ );+}++/** A row of cards: a grid from sm up, a rail that snaps on a phone, with the next card peeking at the edge. */+export function HomeRail({ className, children }: { className?: string; children: React.ReactNode }) {+ return <FadeRow className={cn("flex snap-x snap-mandatory scroll-px-4 sm:grid sm:[mask-image:none]", className)}>{children}</FadeRow>;+}++/** Stops every preview playing by itself, on every page, and remembers it; a hover still plays one. */+export function PausePreviews() {+ const paused = usePreviewsPaused();+ const Icon = paused ? Play : Pause;+ const label = paused ? "Play previews" : "Pause previews";+ return (+ <button+ type="button"+ onClick={() => setPreviewsPaused(!paused)}+ aria-label={label}+ title={label}+ className="inline-flex size-7 shrink-0 items-center justify-center gap-1.5 rounded-full border text-[12px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground sm:w-[8.5rem]"+ >+ <Icon className="size-3" />+ <span className="max-sm:hidden">{label}</span>+ </button>+ );+}++/** The self-host card's Copy button: the commands go to the clipboard, and the icon turns to a check for a moment. */+export function CopyCommand({ text }: { text: string }) {+ const [done, setDone] = useState(false);+ const timer = useRef<ReturnType<typeof setTimeout>>(undefined);+ useEffect(() => () => clearTimeout(timer.current), []);+ return (+ <button+ type="button"+ onClick={async () => {+ if (!(await copyWithToast(text, "Commands copied"))) return;+ setDone(true);+ clearTimeout(timer.current);+ timer.current = setTimeout(() => setDone(false), 1500);+ }}+ className="inline-flex h-6 items-center gap-1.5 rounded-full bg-white/10 px-2.5 text-[12px] text-white/80 transition-colors hover:bg-white/15 hover:text-white"+ >+ {done ? <Check className="size-3" /> : <Copy className="size-3" />}+ {done ? "Copied" : "Copy"}+ </button>+ );+}++/**+ * A studio's card. It plays where nothing can hover, like the cards above it; with a mouse it waits for one, so the+ * clips higher on the page keep the screen's few players. `zoom`: a still that slowly closes in on hover instead.+ */+export function StudioCard({ href, label, line, card, zoom }: { href: string; label: string; line: string; card: PresetCardData; zoom?: boolean }) {+ const { ref, playing, handlers } = usePreviewPlayback<HTMLAnchorElement>(card.id, card.preview, { auto: "touch" });+ return (+ <IntentLink ref={ref} href={href} {...handlers} className="group/studio flex min-w-0 flex-col gap-2 rounded-xl outline-none focus-visible:ring-2 focus-visible:ring-ring">+ <StudioPicture zoom={zoom}>+ <PresetPreview preview={card.preview} hue={card.hue} playing={playing} />+ </StudioPicture>+ <StudioName label={label} line={line} />+ </IntentLink>+ );+}++export function StudioPicture({ zoom, className, children }: { zoom?: boolean; className?: string; children: React.ReactNode }) {+ return (+ <div className={cn("relative isolate aspect-[4/3] overflow-hidden rounded-lg bg-muted", className)}>+ <div+ className={cn(+ "absolute inset-0 ease-out motion-safe:transition-transform",+ zoom ? "motion-safe:duration-[1200ms] motion-safe:group-hover/studio:scale-[1.06]" : "motion-safe:duration-[400ms] motion-safe:group-hover/studio:scale-[1.03]",+ )}+ >+ {children}+ </div>+ <CardPending />+ </div>+ );+}++export function StudioName({ label, line }: { label: string; line: string }) {+ return (+ <div className="min-w-0 px-0.5">+ <p className="flex items-center gap-1.5 text-[14px] font-medium">+ {label}+ <ArrowRight className="size-3.5 text-muted-foreground transition-transform duration-150 group-hover/studio:translate-x-0.5 group-hover/studio:text-foreground" />+ </p>+ <p className="mt-0.5 text-[12px] leading-snug text-muted-foreground">{line}</p>+ </div>+ );+}++/**+ * The three steps to start, for who's looking: a guest signs up, an account connects its GPU, the owner of their own+ * install connects ComfyUI or adds a key. Until the status comes, a guest's (as the composer's line); every step+ * keeps its height, so nothing moves when it changes.+ */+export function StartSteps() {+ const hydrated = useHydrated();+ const data = useStatus().data;+ const status = hydrated ? data : undefined;+ const viewer = status?.viewer;+ const owner = !!status && !viewer;+ const link = "inline-flex items-center gap-1 text-[13px] font-medium text-brand-text hover:underline underline-offset-2";+ const done = (text: string) => (+ <span className="inline-flex items-center gap-1 text-[13px] font-medium text-foreground">+ <Check className="size-3.5 text-brand-text" /> {text}+ </span>+ );+ const steps: { title: string; text: string; action: React.ReactNode }[] = [+ {+ title: "Look around.",+ text: "Open every studio, preset and model, no account needed.",+ action: (+ <IntentLink href="/effects" className={link}>+ Browse effects <ArrowRight className="size-3.5" />+ </IntentLink>+ ),+ },+ {+ title: "Sign up free.",+ text: "A free account runs open models on your own GPU, never on ours.",+ action:+ viewer?.kind === "account" ? (+ done("You’re signed in")+ ) : owner ? (+ <IntentLink href="/settings#get-started" className={link}>+ Connect ComfyUI or add a key <ArrowRight className="size-3.5" />+ </IntentLink>+ ) : (+ <a href={signInHref("signup")} className={link}>+ Sign up free <ArrowRight className="size-3.5" />+ </a>+ ),+ },+ {+ title: "Connect your ComfyUI.",+ text: "Use the ComfyUI on this computer, or a link to one elsewhere. Fuobe checks what it has and shows what runs on it.",+ action: viewer?.gpu.connected ? (+ done("Your GPU is connected")+ ) : viewer?.kind === "account" ? (+ <button type="button" onClick={() => window.dispatchEvent(new Event(CONNECT_GPU_EVENT))} className={link}>+ Connect your GPU <ArrowRight className="size-3.5" />+ </button>+ ) : (+ <IntentLink href="/connect" className={link}>+ Connect your GPU <ArrowRight className="size-3.5" />+ </IntentLink>+ ),+ },+ ];+ return (+ <ol className="space-y-5">+ {steps.map((s, i) => (+ <li key={s.title} className="flex gap-3">+ <span className="grid size-6 shrink-0 place-items-center rounded-full bg-brand-faint text-[12px] font-semibold text-brand-text tabular-nums">{i + 1}</span>+ <div className="min-h-[68px] min-w-0">+ <p className="text-[15px] font-medium">{s.title}</p>+ <p className="mt-0.5 text-[13px] text-muted-foreground">{s.text}</p>+ <div className="mt-1.5 flex h-5 items-center">{s.action}</div>+ </div>+ </li>+ ))}+ </ol>+ );+}diff --git a/src/components/home/home-sections.tsx b/src/components/home/home-sections.tsxnew file mode 100644index 00000000..ed176a13--- /dev/null+++ b/src/components/home/home-sections.tsx@@ -0,0 +1,411 @@+import Link from "next/link";+import { ArrowRight, AudioLines, Box, CalendarClock, ImageIcon, ListChecks, Plug, ScanEye, Sparkles, Video, type LucideIcon } from "lucide-react";+import { GitHubMark } from "@/components/github-mark";+import { BeforeAfter } from "@/components/home/before-after";+import { CopyCommand, FadeRow, HomeRail, PausePreviews, StartSteps, StudioCard, StudioName, StudioPicture } from "@/components/home/home-islands";+import { ShowcaseTile } from "@/components/home/showcase-tile";+import { IntentLink } from "@/components/intent-link";+import { NAV } from "@/components/nav-items";+import { PresetCard } from "@/components/preset-gallery";+import { ASSIST_SUGGESTIONS } from "@/lib/assist";+import { FUOBE_REPO } from "@/lib/connections";+import { presetHref, type HomeShowcase } from "@/lib/home-showcase";+import type { PresetCardData } from "@/lib/preset-cards";+import { cn } from "@/lib/utils";++/*+ * Home's sections under the wall. Server components: their words, numbers and links ship as HTML, and only the+ * cards, the before/after, the Copy button and the start steps hydrate (home-islands.tsx, before-after.tsx).+ */++/** A card in a HomeRail: two-thirds of a phone's width (the next one peeks in), a grid cell from sm up. */+const RAIL_ITEM = "w-[64%] shrink-0 snap-start sm:w-auto";+const SECTION = "mt-10 sm:mt-14";+const H2 = "font-heading text-[24px] leading-tight sm:text-[28px]";+const LINE = "mt-1 text-[15px] text-pretty text-muted-foreground";++const navIcon = (href: string) => NAV.flatMap((g) => g.items).find((i) => i.href === href)?.icon;++function SectionHead({ id, title, count, all, line }: { id: string; title: string; count?: number; all?: string; line: string }) {+ return (+ <div className="mb-4">+ <div className="flex items-center justify-between gap-4">+ <h2 id={id} className={H2}>+ {title}+ {count !== undefined && (+ <span className="ml-2 inline-block rounded-full bg-muted px-2 align-[0.3em] font-sans text-[13px] leading-6 tracking-normal text-muted-foreground tabular-nums">+ {count}+ </span>+ )}+ </h2>+ {all && (+ <IntentLink+ href={all}+ className="group inline-flex shrink-0 items-center gap-1 text-[13px] text-muted-foreground transition-colors hover:text-foreground"+ >+ See all {count} <ArrowRight className="size-3.5 transition-transform duration-150 group-hover:translate-x-0.5" />+ </IntentLink>+ )}+ </div>+ <p className={LINE}>{line}</p>+ </div>+ );+}++/** Preset cards: all of them in a phone's rail; from sm up, the first `wide` (a rail costs no height, a grid does). */+function Cards({ cards, className, wide = cards.length }: { cards: PresetCardData[]; className: string; wide?: number }) {+ return (+ <HomeRail className={cn("gap-1", className)}>+ {cards.map((c, i) => (+ <div key={c.id} className={cn(RAIL_ITEM, i >= wide && "sm:hidden")}>+ <PresetCard preset={c} href={presetHref(c.id)} bare />+ </div>+ ))}+ </HomeRail>+ );+}++/** The first pictures on the page: eight real covers, four on a phone. */+export function ShowcaseWall({ wall }: { wall: HomeShowcase["wall"] }) {+ return (+ <section aria-label="What Fuobe makes" className="mt-6 sm:mt-8">+ <div className="grid grid-cols-2 gap-2 sm:grid-cols-4 md:max-lg:grid-cols-2">+ {wall.map((t, i) => (+ <ShowcaseTile key={t.id} card={t.card} kind={t.kind} caption={t.caption} href={t.href} index={i} />+ ))}+ </div>+ <div className="mt-3 flex items-center justify-between gap-3 text-[12px] text-muted-foreground">+ <p className="min-w-0">+ <span className="sm:hidden">Rendered locally on ComfyUI, on one RTX 5090.</span>+ <span className="max-sm:hidden">Every preview on this page was rendered locally on ComfyUI, on one RTX 5090.</span>+ </p>+ <PausePreviews />+ </div>+ </section>+ );+}++export function EffectsSection({ facts, effects }: Pick<HomeShowcase, "facts" | "effects">) {+ return (+ <section aria-labelledby="home-effects" className={SECTION}>+ <SectionHead+ id="home-effects"+ title="Effects"+ count={facts.effects}+ all="/effects"+ line="Add one photo and get the shot: fire, wings, floods, explosions."+ />+ <Cards cards={effects} className="sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6" />+ </section>+ );+}++export function MotionsSection({ facts, motions }: Pick<HomeShowcase, "facts" | "motions">) {+ return (+ <section aria-labelledby="home-motions" className={SECTION}>+ <SectionHead+ id="home-motions"+ title="Camera motions"+ count={facts.motions}+ all="/motions"+ line="Moves a film crew would make: orbits, drone dives, crash zooms. Mix any two."+ />+ <Cards cards={motions} wide={6} className="sm:grid-cols-3 xl:grid-cols-6" />+ </section>+ );+}++export function AppsSection({ facts, beforeAfter, reveals }: Pick<HomeShowcase, "facts" | "beforeAfter" | "reveals">) {+ return (+ <section aria-labelledby="home-apps" className={SECTION}>+ <SectionHead id="home-apps" title="Apps" count={facts.apps} all="/apps" line="One click changes one thing and keeps the rest." />+ <div className="grid grid-cols-1 gap-6 xl:grid-cols-12 xl:gap-4">+ <div className="min-w-0 xl:col-span-5 xl:pt-1.5">+ <BeforeAfter pairs={beforeAfter} />+ </div>+ <Cards cards={reveals} className="self-start sm:grid-cols-3 xl:col-span-7" />+ </div>+ </section>+ );+}++/** Heights of the Audio card's bars (0–1): a waveform drawn once, not a recording. */+const WAVE = [+ 0.3, 0.45, 0.7, 0.5, 0.85, 1, 0.75, 0.55, 0.4, 0.6, 0.9, 0.7, 0.45, 0.3, 0.5, 0.8, 0.95, 0.65, 0.4, 0.55, 0.75, 0.5, 0.35, 0.6, 0.8, 0.55, 0.35, 0.25,+];++/** Audio has no cover: its card shows a waveform that ripples on hover, and the studio's tools by name. */+function AudioCard({ href, label, line, tools }: { href: string; label: string; line: string; tools: HomeShowcase["audioTools"] }) {+ return (+ <IntentLink href={href} className="group/studio flex min-w-0 flex-col gap-2 rounded-xl outline-none focus-visible:ring-2 focus-visible:ring-ring">+ <StudioPicture className="bg-media">+ <div className="absolute inset-0 flex flex-col justify-center gap-[9%] px-[9%]">+ <div aria-hidden className="flex h-[38%] items-center gap-[2.5%]">+ {WAVE.map((h, i) => (+ <i+ key={i}+ className="flex-1 rounded-full bg-white/85 motion-safe:group-hover/studio:animate-wave-bar motion-safe:group-focus-visible/studio:animate-wave-bar"+ style={{ height: `${h * 100}%`, animationDelay: `${-i * 70}ms` }}+ />+ ))}+ </div>+ <p className="text-[12px] leading-snug text-white/70">+ {tools.named.join(" · ")}+ {tools.more > 0 && ` · ${tools.more} more`}+ </p>+ </div>+ </StudioPicture>+ <StudioName label={label} line={line} />+ </IntentLink>+ );+}++export function StudiosSection({ facts, studios, audioTools, pills }: Pick<HomeShowcase, "facts" | "studios" | "audioTools" | "pills">) {+ return (+ <section aria-labelledby="home-studios" className={SECTION}>+ <SectionHead+ id="home-studios"+ title="Studios and tools"+ count={facts.destinations}+ line="Whole productions, start to finish: films, ads, shoots and series. Open any of them to look around, no account needed."+ />+ <HomeRail className="gap-3 sm:grid-cols-2 sm:gap-x-3 sm:gap-y-4 lg:grid-cols-4">+ {studios.map((s) => (+ <div key={s.href} className={RAIL_ITEM}>+ {s.card ? (+ <StudioCard href={s.href} label={s.label} line={s.line} card={s.card} zoom={!s.card.preview.video} />+ ) : (+ <AudioCard href={s.href} label={s.label} line={s.line} tools={audioTools} />+ )}+ </div>+ ))}+ </HomeRail>+ <h3 className="mt-6 mb-2 font-sans text-[13px] text-muted-foreground">Also in Fuobe</h3>+ {/* A phone scrolls the pills sideways in three rows. */}+ <FadeRow>+ <ul className="flex flex-wrap gap-1.5 max-sm:w-[72rem]">+ {pills.map((p) => {+ const Icon = navIcon(p.href);+ return (+ <li key={p.href}>+ <IntentLink+ href={p.href}+ className="group inline-flex h-8 items-center gap-1.5 rounded-full border px-3 text-[13px] transition-colors hover:bg-accent"+ >+ {Icon && <Icon className="size-3.5 text-muted-foreground transition-colors group-hover:text-brand-text" />}+ {p.label}+ </IntentLink>+ </li>+ );+ })}+ </ul>+ </FadeRow>+ </section>+ );+}++export function AssistSection({ facts, runsOn, skills }: Pick<HomeShowcase, "facts" | "runsOn" | "skills">) {+ const points: [LucideIcon, string][] = [+ [ListChecks, "Plans every step and prices it first"],+ [ScanEye, "Checks each result before the next step"],+ [Sparkles, `${facts.skills} built-in skills, projects and memory`],+ [CalendarClock, "Scheduled tasks, with a cost cap"],+ [Plug, "MCP connectors, a CLI and its own MCP server"],+ ];+ return (+ <section aria-labelledby="home-assist" className={SECTION}>+ <div className="grid gap-8 rounded-2xl border bg-card p-5 sm:p-7 lg:grid-cols-2">+ <div className="min-w-0">+ <h2 id="home-assist" className={H2}>+ Assist runs the whole job+ </h2>+ <p className={LINE}>+ Describe the job in one message. Assist picks the models, shows the plan and what it costs, and runs every step when you say go.+ </p>+ <ul className="mt-5 space-y-2.5">+ {points.map(([Icon, text]) => (+ <li key={text} className="flex items-center gap-2.5 text-[13px]">+ <Icon className="size-4 shrink-0 text-brand-text" />+ {text}+ </li>+ ))}+ </ul>+ <p className="mt-5 text-[12px] text-pretty text-muted-foreground">+ Plans with the LLM you pick: {runsOn.named.join(", ")}+ {runsOn.more > 0 && `, and ${runsOn.more} more`}, a local LLM ({runsOn.local.join(", ")}), or an offline planner with no LLM at all.+ </p>+ <IntentLink+ href="/assist"+ className="group mt-5 inline-flex h-9 items-center gap-1.5 rounded-full bg-primary px-4 text-[13px] font-medium text-primary-foreground transition hover:opacity-90"+ >+ Open Assist <ArrowRight className="size-3.5 transition-transform duration-150 group-hover:translate-x-0.5" />+ </IntentLink>+ </div>+ <div className="min-w-0">+ <h3 className="mb-2 font-sans text-[12px] text-muted-foreground">Try asking</h3>+ <ul className="space-y-1.5">+ {ASSIST_SUGGESTIONS.map((s) => (+ <li key={s}>+ <IntentLink+ href={`/assist?prompt=${encodeURIComponent(s)}`}+ className="group flex items-center justify-between gap-3 rounded-xl bg-muted/60 px-4 py-2.5 text-[13px] transition-colors hover:bg-muted"+ >+ <span className="min-w-0">{s}</span>+ <ArrowRight className="size-3.5 shrink-0 text-muted-foreground transition-transform duration-150 group-hover:translate-x-[3px] group-hover:text-foreground" />+ </IntentLink>+ </li>+ ))}+ </ul>+ <h3 className="mt-5 mb-2 font-sans text-[12px] text-muted-foreground">Or start with a skill</h3>+ <FadeRow>+ <ul className="flex gap-1.5 max-sm:w-max sm:flex-wrap">+ {skills.map((s) => (+ <li key={s.name}>+ <IntentLink+ href={`/assist?skill=${s.name}`}+ className="inline-flex h-8 items-center rounded-full border px-3 text-[13px] transition-colors hover:bg-accent"+ >+ {s.title}+ </IntentLink>+ </li>+ ))}+ </ul>+ </FadeRow>+ </div>+ </div>+ </section>+ );+}++const KIND_ICON: Record<string, LucideIcon> = { image: ImageIcon, video: Video, audio: AudioLines, model3d: Box };++export function OpenSourceSection({ facts, newModels }: Pick<HomeShowcase, "facts" | "newModels">) {+ const numbers = [+ { value: facts.openModels, label: "open-source models, each licence listed", href: "/settings/about" },+ { value: facts.workflows, label: "ComfyUI workflows to read, run and change", href: "/workflows" },+ { value: facts.originals, label: "Fuobe Originals, free on your GPU", href: "/models?q=Fuobe" },+ { value: facts.presets, label: "presets: apps, camera motions and effects", href: "/effects" },+ { value: facts.partners, label: "partner models through your own fal.ai or Replicate key", href: "/models" },+ ];+ return (+ <section aria-labelledby="home-open" className={SECTION}>+ <h2 id="home-open" className={H2}>+ Open source, all the way down+ </h2>+ <p className={cn(LINE, "max-w-[62ch]")}>+ The code is MIT-licensed. Every open model comes with its ComfyUI workflow, its files and its licence, and runs on your own GPU.+ </p>+ <ul className="mt-5 grid grid-cols-2 gap-x-4 gap-y-5 rounded-2xl bg-muted/50 p-6 sm:grid-cols-3 xl:grid-cols-5">+ {numbers.map((n, i) => (+ <li key={n.href} className={cn("min-w-0", i === numbers.length - 1 && "max-sm:col-span-2")}>+ <IntentLink href={n.href} className="group block rounded-lg outline-none focus-visible:ring-2 focus-visible:ring-ring">+ <span className="block font-heading text-[34px] leading-none tabular-nums transition-colors group-hover:text-brand-text">{n.value}</span>+ <span className="mt-1.5 block text-[12px] leading-snug text-muted-foreground">{n.label}</span>+ </IntentLink>+ </li>+ ))}+ </ul>+ {newModels.length > 0 && (+ <>+ <h3 className="mt-6 mb-2 font-sans text-[13px] font-medium">Just added</h3>+ <FadeRow>+ <ul className="flex gap-1.5 max-sm:w-max sm:flex-wrap">+ {newModels.map((m) => {+ const Icon = KIND_ICON[m.kind] ?? Sparkles;+ return (+ <li key={m.id}>+ <IntentLink+ href={m.href}+ title={m.tagline}+ className="group inline-flex h-8 items-center gap-1.5 rounded-full border px-3 text-[13px] transition-colors hover:bg-accent"+ >+ <Icon className="size-3.5 text-muted-foreground transition-colors group-hover:text-brand-text" />+ {m.name}+ <span className="text-muted-foreground">· {m.vendor}</span>+ </IntentLink>+ </li>+ );+ })}+ </ul>+ </FadeRow>+ </>+ )}+ </section>+ );+}++/** The README's own three lines. */+const COMMANDS = ["git clone https://github.com/workingprototype/fuobe.git && cd fuobe", "pnpm install", "pnpm dev"].join("\n");++export function StartSection() {+ return (+ <section aria-labelledby="home-start" className={SECTION}>+ <h2 id="home-start" className={H2}>+ Your GPU. Your models. Your files.+ </h2>+ <p className={LINE}>No account to look around. A free account to run. Your own server if you want all of it.</p>+ <div className="mt-6 grid gap-8 lg:grid-cols-12">+ <div className="lg:col-span-5">+ <StartSteps />+ </div>+ <div className="min-w-0 rounded-2xl bg-media p-5 text-white ring-1 ring-white/10 lg:col-span-7">+ <p className="text-[15px] font-medium">Or run all of Fuobe yourself</p>+ <p className="mt-1 text-[13px] text-white/70">+ MIT licence. Keys, settings and results stay on your machine. Demo mode works with nothing connected.+ </p>+ <div className="mt-4 min-w-0 overflow-hidden rounded-xl bg-white/[0.04] ring-1 ring-white/10">+ <div className="flex items-center justify-between py-2 pr-2 pl-4">+ <span className="text-[12px] text-white/55">Terminal</span>+ <CopyCommand text={COMMANDS} />+ </div>+ <pre className="overflow-x-auto px-4 pb-4 font-mono text-[13px] leading-relaxed text-white/90">+ <code>{COMMANDS}</code>+ </pre>+ </div>+ <p className="mt-3 text-[12px] text-white/70">+ On Windows, <code className="font-mono text-white/90">start.bat</code> installs and starts everything.+ </p>+ <div className="mt-4 flex flex-wrap gap-2">+ <a+ href={FUOBE_REPO}+ target="_blank"+ rel="noopener"+ className="inline-flex h-9 items-center gap-1.5 rounded-full bg-white px-4 text-[13px] font-medium text-black transition-colors hover:bg-white/90"+ >+ <GitHubMark className="size-3.5" /> View on GitHub+ </a>+ <IntentLink+ href="/workflows"+ className="inline-flex h-9 items-center rounded-full px-4 text-[13px] font-medium text-white ring-1 ring-white/20 transition-colors hover:bg-white/10"+ >+ ComfyUI workflows+ </IntentLink>+ </div>+ </div>+ </div>+ </section>+ );+}++export function HomeFooter() {+ const engine = NAV.find((g) => g.label === "Engine")?.items.filter((i) => i.href !== "/settings") ?? [];+ const link = "transition-colors hover:text-foreground";+ return (+ <footer className="mt-12 flex flex-wrap items-end justify-between gap-4 border-t pt-8 pb-4">+ <div>+ <p className="font-heading text-[22px] leading-none">Fuobe</p>+ <p className="mt-1.5 text-[12px] text-muted-foreground">Open source under the MIT licence.</p>+ </div>+ <nav aria-label="About Fuobe" className="flex flex-wrap gap-x-4 gap-y-1 text-[13px] text-muted-foreground">+ {engine.map((i) => (+ <Link key={i.href} href={i.href} prefetch={false} className={link}>+ {i.label}+ </Link>+ ))}+ <a href={FUOBE_REPO} target="_blank" rel="noopener" className={link}>+ GitHub+ </a>+ </nav>+ </footer>+ );+}diff --git a/src/components/home/showcase-tile.tsx b/src/components/home/showcase-tile.tsxnew file mode 100644index 00000000..ee6e674f--- /dev/null+++ b/src/components/home/showcase-tile.tsx@@ -0,0 +1,47 @@+"use client";++import { ArrowRight } from "lucide-react";+import { CardPending, IntentLink } from "@/components/intent-link";+import { PresetPreview, usePreviewPlayback } from "@/components/preset-preview";+import type { PresetCardData } from "@/lib/preset-cards";+import { cn } from "@/lib/utils";++/**+ * A tile of Home's wall: a real cover that plays in view, its name, and what it does. On a desktop the line and a+ * "Try it" pill come in on hover or focus; on touch the line always shows. The first tile is the page's largest+ * picture, fetched first; tiles 5 to 8 are hidden (and never fetched) where the wall has two columns.+ */+export function ShowcaseTile({ card, kind, caption, href, index }: { card: PresetCardData; kind: string; caption: string; href: string; index: number }) {+ const { ref, playing, handlers } = usePreviewPlayback<HTMLAnchorElement>(card.id, card.preview);+ return (+ <IntentLink+ ref={ref}+ href={href}+ {...handlers}+ aria-label={`${card.name}, ${kind.split(" ·")[0].toLowerCase()}: ${caption.charAt(0).toLowerCase()}${caption.slice(1)}. Try it`}+ className={cn(+ "group/tile relative isolate block overflow-hidden rounded-xl bg-muted outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",+ index >= 4 && "max-sm:hidden md:max-lg:hidden",+ )}+ >+ <div className="relative aspect-[4/3] ease-out motion-safe:transition-transform motion-safe:duration-[400ms] motion-safe:group-hover/tile:scale-[1.03]">+ <PresetPreview preview={card.preview} hue={card.hue} playing={playing} loading={index < 4 ? "eager" : "lazy"} fetchPriority={index === 0 ? "high" : undefined} />+ </div>+ <span aria-hidden className="pointer-events-none absolute inset-x-0 bottom-0 h-[45%] bg-gradient-to-t from-black/65 to-transparent" />+ <span aria-hidden className="pointer-events-none absolute inset-x-3 bottom-2.5 flex min-w-0 flex-col text-left text-white [text-shadow:0_1px_2px_rgb(0_0_0/30%)]">+ <span className="hidden text-[11px] tracking-wide text-white/75 uppercase xl:block">{kind}</span>+ <span className="truncate text-[14px] leading-snug font-medium">{card.name}</span>+ <span className="truncate text-[12px] text-white/80 transition-opacity duration-150 group-hover/tile:opacity-100 group-focus-visible/tile:opacity-100 [@media(hover:hover)]:opacity-0">+ {caption}+ </span>+ </span>+ <span+ aria-hidden+ className="pointer-events-none absolute top-2.5 right-2.5 inline-flex h-7 translate-y-1 items-center gap-1 rounded-full bg-white px-3 text-[12px] font-medium text-black opacity-0 shadow-soft transition duration-150 group-hover/tile:translate-y-0 group-hover/tile:opacity-100 group-focus-visible/tile:translate-y-0 group-focus-visible/tile:opacity-100"+ >+ Try it <ArrowRight className="size-3" />+ </span>+ <CardPending />+ </IntentLink>+ );+}diff --git a/src/lib/assist.ts b/src/lib/assist.tsindex 4ec9c772..1547a381 100644--- a/src/lib/assist.ts+++ b/src/lib/assist.ts@@ -123,6 +123,18 @@ export const ASSIST_SUGGESTIONS = ["A 10-second vertical video of a fox running through snow, with sound",] as const;+/** The longest prompt a link can type into a new chat (/assist?prompt=). */+export const ASSIST_PROMPT_MAX = 2000;++/**+ * What a new chat's composer starts with, from its address: "/name " for ?skill=<name> (a skill's "Use in a new+ * chat"), else ?prompt=<text> (Home's examples), cut to ASSIST_PROMPT_MAX. Nothing is sent until the viewer sends it.+ */+export function assistDraft(skill: string | null, prompt: string | null): string {+ if (skill) return /^[a-z0-9-]+$/.test(skill) ? `/${skill} ` : "";+ return (prompt ?? "").slice(0, ASSIST_PROMPT_MAX);+}+// ---------------------------------------------------------------------------// Modes (Supercomputer's Free / Smart / Manual)diff --git a/src/lib/home-showcase.ts b/src/lib/home-showcase.tsnew file mode 100644index 00000000..7340a11c--- /dev/null+++ b/src/lib/home-showcase.ts@@ -0,0 +1,282 @@+/**+ * What Home shows below the composer: which presets, studios, models and skills, and every number it quotes, read+ * from the catalog, the ComfyUI manifest and the skills folder, never typed in. Server only: the page gets slim+ * cards and strings, and the catalog stays here (tests/home-showcase.test.ts checks every id and number).+ */+import "server-only";+import fs from "node:fs/promises";+import path from "node:path";+import { NAV } from "@/components/nav-items";+import { APPS, EFFECTS, MODELS, MOTIONS, getPreset } from "@/lib/catalog";+import { CAMERA_MOVES } from "@/lib/catalog/cinema";+import { LLM_PROVIDERS } from "@/lib/catalog/llm-providers";+import { TEMPLATES } from "@/lib/catalog/marketing";+import type { ModelDef } from "@/lib/catalog/types";+import type { Manifest } from "@/lib/comfy";+import { HUB_MODES } from "@/lib/hubs";+import { buildLicenceList } from "@/lib/licences";+import { modelHref } from "@/lib/palette-index";+import { toPresetCard } from "@/lib/preset-card-data";+import type { PresetCardData } from "@/lib/preset-cards";+import { PRESET_PEAKS } from "@/lib/preset-peaks.generated";++/** The wall under the composer: the first pictures a visitor sees, each with what it does. */+export const HOME_WALL = [+ { id: "effect-flame-on", kind: "Effect", caption: "Bursts into living flame" },+ { id: "effect-powder-explosion", kind: "Effect", caption: "A burst of colored powder around them" },+ { id: "app-virtual-try-on", kind: "App · before → after", caption: "Any garment, on anyone" },+ { id: "motion-fpv-drone", kind: "Camera motion", caption: "A drone dive over the cove" },+ { id: "motion-low-shutter", kind: "Camera motion", caption: "Silk trails at slow shutter" },+ { id: "effect-clone-explosion", kind: "Effect", caption: "Clones burst out in every direction" },+ { id: "effect-angel-wings", kind: "Effect", caption: "Wings unfold from their back" },+ { id: "motion-glam", kind: "Camera motion", caption: "A slow-motion arc in gold" },+] as const;++export const HOME_EFFECTS = [+ "effect-aquarium",+ "effect-portal",+ "effect-building-explosion",+ "effect-diamond",+ "effect-thunder-god",+ "effect-jelly-drift",+ "effect-earth-zoom-out",+ "effect-fallen-angel",+ "effect-fire-element",+ "effect-water-splash",+ "effect-raven-transition",+ "effect-northern-lights",+];++/** A phone's rail shows all twelve; a wider screen shows the first six, one row (home-sections.tsx). */+export const HOME_MOTIONS = [+ "motion-bullet-time",+ "motion-mouth-in",+ "motion-car-chasing",+ "motion-360-orbit",+ "motion-flying",+ "motion-crash-zoom-in",+ "motion-catwalk",+ "motion-crane-up",+ "motion-super-dolly-in",+ "motion-action-run",+ "motion-through-object-in",+ "motion-lazy-susan",+];++/**+ * The before/after under Apps: the poster is the before, the peak frame the after. `zoom` enlarges both alike: the+ * sketch is a sheet of paper on white, and its edges would show.+ */+export const HOME_BEFORE_AFTER = [+ { id: "app-sketch-to-real", tags: ["Sketch", "Photo"], zoom: 1.22 },+ { id: "app-colorize", tags: ["Black & white", "Color"], zoom: 1.02 },+ { id: "app-style-transfer", tags: ["Photo", "Anime"], zoom: 1.02 },+] as const;++/** Apps whose clip wipes from before to after: at rest they show the after. */+export const HOME_REVEALS = ["app-face-swap", "app-outfit-swap", "app-hairstyle-try-on", "app-relight", "app-product-shot", "app-steal-the-look"];++/** Studio cards: a real cover (a clip, or Image to 3D's still) and one line each; Audio shows its tools instead of a picture. */+export const HOME_STUDIOS: { href: string; id?: string; line: (f: HomeFacts) => string }[] = [+ { href: "/cinema", id: "motion-arc-left", line: (f) => `Direct a film shot by shot: camera, lens, light and ${f.cinemaMoves} moves.` },+ { href: "/genjutsu", id: "effect-outfit-switch", line: () => "Keep a clip’s motion. Change what’s in it." },+ { href: "/character-swap", id: "app-character-swap", line: () => "Put your character into whole clips, shot by shot." },+ { href: "/marketing", id: "app-click-to-ad", line: (f) => `From a product link to a finished ad. ${f.adTemplates} ad templates.` },+ { href: "/mixed-media", id: "effect-scrapbook-collage", line: (f) => `Redraw a clip as collage, paper or paint, in ${f.mixedLooks} looks.` },+ { href: "/motion-control", id: "motion-moonwalk-left", line: () => "Give anyone the moves from any clip." },+ { href: "/audio", line: () => "Voices, music and sound effects. Split any soundtrack into voice, music and effects." },+ { href: "/image-to-3d", id: "app-3d-rotation", line: () => "A photo or a sentence to a 3D model you can spin." },+];++/** Destinations with a section of their own on Home, so they aren't pills as well. */+export const HOME_OWN_SECTIONS = ["/assist", "/motions", "/effects", "/apps"];++/** Assist's starter skills, as its empty chat lists them first (assist-view.tsx). */+export const HOME_SKILLS = ["product-photoshoot", "ugc-video", "thumbnail-generation", "faceless-video", "short-film", "localization"];++/**+ * "Just added", newest first: only the ones in the catalog and not hidden show, so a model shows the day its+ * branch merges. Fewer than 6 left, the catalog's other new open models fill in.+ */+export const HOME_NEW_OPEN = [+ "oss-qwen-image-21",+ "oss-ideogram-4",+ "oss-krea2-realism",+ "oss-fibo2-dev",+ "oss-moss-image",+ "oss-ltx25",+ "oss-wan-move",+ "oss-void-remove",+ "oss-dbs-separate",+ "oss-trellis2",+ "oss-pixal3d",+ "oss-qwen-layered",+ "oss-stable-audio-3",+ "oss-triposplat",+];++/**+ * The chips under the composer. Each fills it with a prompt that looks like a cover on this page (Glam and FPV+ * Drone on the wall, Relight under Apps); nothing runs until Start.+ */+export const HOME_TRY = [+ {+ mode: "image",+ label: "Gold sequins on a sea cliff",+ prompt: "Editorial fashion photo of a model in a gold sequin dress and a flowing gold cape on a white cliff above a turquoise bay, golden hour",+ },+ {+ mode: "video",+ label: "Drone dive over a turquoise cove",+ prompt: "FPV drone dives off a limestone cliff and skims a turquoise cove past a white yacht, bright morning sun",+ },+ { mode: "edit", label: "Make it golden hour", prompt: "Make it golden hour: warm low sun, long soft shadows and a glowing sky" },+] as const;++export interface HomeFacts {+ /** Open models with their ComfyUI workflow and licence (About & licences' count). */+ openModels: number;+ workflows: number;+ originals: number;+ /** Paid models through the viewer's own fal.ai or Replicate key. */+ partners: number;+ presets: number;+ apps: number;+ motions: number;+ effects: number;+ /** Every place to create from the sidebar: Create (but Home) and Studios. */+ destinations: number;+ cinemaMoves: number;+ adTemplates: number;+ mixedLooks: number;+ audioTools: number;+ skills: number;+}++/** "130+": the open models rounded down to ten, so it never overstates. */+export const roundedDown = (n: number) => `${Math.floor(n / 10) * 10}+`;++const isOpen = (m: ModelDef) => m.engine === "open" || !!m.engines?.includes("open");++/** A preset's card, resting on its peak frame when it has one. */+export function homeCard(id: string): PresetCardData {+ const p = getPreset(id);+ if (!p) throw new Error(`Home names ${id}, which isn't in the catalog`);+ const card = toPresetCard(p);+ const peak = PRESET_PEAKS[id];+ return peak ? { ...card, preview: { ...card.preview, rest: { src: `/previews/presets/peak/${id}.jpg`, at: peak.at } } } : card;+}++/** Where a preset's card opens: an app's own page, else the Video studio with it picked. */+export const presetHref = (id: string) => (id.startsWith("app-") ? `/apps/${id}` : `/video?preset=${id}`);++const navItems = (label: string) => NAV.find((g) => g.label === label)?.items ?? [];+const navLabel = (href: string) => [...navItems("Create"), ...navItems("Studios")].find((i) => i.href === href)?.label ?? href;++/** The sidebar's places to create, but Home. */+export const homeDestinations = () => [...navItems("Create"), ...navItems("Studios")].filter((i) => i.href !== "/");++/** The places to create that have no card or section of their own on Home, in the sidebar's order. */+export const homePills = () =>+ homeDestinations()+ .filter((i) => !HOME_OWN_SECTIONS.includes(i.href) && !HOME_STUDIOS.some((s) => s.href === i.href))+ .map((i) => ({ href: i.href, label: i.label }));++/** The Just added models: the list's live ones, then other new open models up to 6. */+export function newOpenModels(models: ModelDef[] = MODELS) {+ const live = (m: ModelDef | undefined): m is ModelDef => !!m && !m.hidden && isOpen(m);+ const listed = HOME_NEW_OPEN.map((id) => models.find((m) => m.id === id)).filter(live);+ const more =+ listed.length < 6+ ? models.filter((m) => live(m) && m.badges?.includes("new") && m.vendor !== "Fuobe Original" && !m.name.includes("(") && !listed.includes(m))+ : [];+ return [...listed, ...more].slice(0, 8).map((m) => ({ id: m.id, name: m.name, vendor: m.vendor, kind: m.kind, tagline: m.tagline, href: modelHref(m) }));+}++/** The Audio card's words: five of the studio's tools by name, then how many more it has. */+export function audioTools() {+ const named = ["speech", "dialogue", "music", "sfx", "split"].flatMap((id) => HUB_MODES.audio.filter((m) => m.id === id).map((m) => m.label));+ return { named, more: HUB_MODES.audio.length - named.length };+}++/** What Assist plans with: the hosted providers (6 by name, then how many more) and the local servers. */+export function assistRunsOn() {+ const hosted = LLM_PROVIDERS.filter((p) => p.group !== "local").map((p) => p.short);+ return { named: hosted.slice(0, 6), more: Math.max(0, hosted.length - 6), local: LLM_PROVIDERS.filter((p) => p.group === "local" && p.id !== "custom").map((p) => p.label) };+}++/** A JSON file's contents, or null when it's missing or unreadable (as the About page reads it). */+async function readJson<T>(text: Promise<string>): Promise<T | null> {+ try {+ return JSON.parse(await text) as T;+ } catch {+ return null;+ }+}++/** The skills folder: how many skills there are, and the starters' titles (each SKILL.md's metadata.title). */+async function readSkills() {+ const dir = path.join(process.cwd(), "skills");+ const names = await fs.readdir(dir, { withFileTypes: true }).then(+ (all) => all.filter((d) => d.isDirectory()).map((d) => d.name),+ () => [] as string[],+ );+ const has = await Promise.all(names.map((n) => fs.access(path.join(dir, n, "SKILL.md")).then(() => n, () => null)));+ const titles = await Promise.all(+ HOME_SKILLS.map(async (name) => {+ const text = await fs.readFile(path.join(dir, name, "SKILL.md"), "utf8").catch(() => "");+ return { name, title: /^\s+title:\s*(.+)$/m.exec(text)?.[1].trim() };+ }),+ );+ return { count: has.filter(Boolean).length, starters: titles.flatMap((t) => (t.title ? [{ name: t.name, title: t.title }] : [])) };+}++/** Everything Home shows below the composer, computed once per build (the page stays prerendered). */+export async function homeShowcase() {+ "use cache";+ const [manifest, skills] = await Promise.all([+ readJson<Manifest>(fs.readFile(path.join(process.cwd(), "workflows", "comfyui", "manifest.json"), "utf8")),+ readSkills(),+ ]);+ const workflows = manifest?.workflows ?? [];+ const licences = buildLicenceList(+ MODELS.map((m) => ({ id: m.id, name: m.name, vendor: m.vendor, kind: m.kind, hidden: m.hidden, routes: m.routes.map((r) => ({ provider: r.provider, endpoint: r.endpoint })) })),+ workflows.map((w) => ({ id: w.id, title: w.title, capability: w.capability, license: w.license, models: w.models.map((m) => ({ url: m.url, sizeGb: m.sizeGb })) })),+ );+ const visible = MODELS.filter((m) => !m.hidden);+ const facts: HomeFacts = {+ openModels: licences.counts.all,+ workflows: workflows.length,+ originals: visible.filter((m) => m.vendor === "Fuobe Original").length,+ partners: visible.filter((m) => !isOpen(m)).length,+ presets: APPS.length + MOTIONS.length + EFFECTS.length,+ apps: APPS.length,+ motions: MOTIONS.length,+ effects: EFFECTS.length,+ destinations: homeDestinations().length,+ cinemaMoves: CAMERA_MOVES.length,+ adTemplates: TEMPLATES.length,+ mixedLooks: EFFECTS.filter((e) => e.category === "Mixed Media").length,+ audioTools: HUB_MODES.audio.length,+ skills: skills.count,+ };+ return {+ facts,+ wall: HOME_WALL.map((t) => ({ ...t, card: homeCard(t.id), href: presetHref(t.id) })),+ effects: HOME_EFFECTS.map(homeCard),+ motions: HOME_MOTIONS.map(homeCard),+ reveals: HOME_REVEALS.map(homeCard),+ beforeAfter: HOME_BEFORE_AFTER.map(({ id, tags, zoom }) => {+ const card = homeCard(id);+ return { id, name: card.name, before: card.preview.poster, after: card.preview.rest?.src ?? card.preview.poster, tags: [...tags], zoom, href: presetHref(id) };+ }),+ studios: HOME_STUDIOS.map((s) => ({ href: s.href, label: navLabel(s.href), line: s.line(facts), card: s.id ? homeCard(s.id) : undefined })),+ audioTools: audioTools(),+ pills: homePills(),+ newModels: newOpenModels(),+ runsOn: assistRunsOn(),+ skills: skills.starters,+ };+}++export type HomeShowcase = Awaited<ReturnType<typeof homeShowcase>>;diff --git a/tests/home-showcase.test.ts b/tests/home-showcase.test.tsnew file mode 100644index 00000000..47bbb9f0--- /dev/null+++ b/tests/home-showcase.test.ts@@ -0,0 +1,206 @@+import fs from "node:fs";+import path from "node:path";+import { describe, expect, it } from "vitest";+import { NAV } from "@/components/nav-items";+import { APPS, EFFECTS, MODELS, MOTIONS, getPreset } from "@/lib/catalog";+import { CAMERA_MOVES } from "@/lib/catalog/cinema";+import { LLM_PROVIDERS } from "@/lib/catalog/llm-providers";+import { TEMPLATES } from "@/lib/catalog/marketing";+import { ASSIST_PROMPT_MAX, ASSIST_SUGGESTIONS, assistDraft } from "@/lib/assist";+import { HUB_MODES } from "@/lib/hubs";+import { buildLicenceList, type LicenceWorkflowInput } from "@/lib/licences";+import {+ HOME_BEFORE_AFTER,+ HOME_EFFECTS,+ HOME_MOTIONS,+ HOME_NEW_OPEN,+ HOME_OWN_SECTIONS,+ HOME_REVEALS,+ HOME_SKILLS,+ HOME_STUDIOS,+ HOME_TRY,+ HOME_WALL,+ homeShowcase,+ newOpenModels,+ presetHref,+ roundedDown,+} from "@/lib/home-showcase";+import { PRESET_PEAKS } from "@/lib/preset-peaks.generated";+import { PRESET_PREVIEWS } from "@/lib/preset-previews.generated";++/*+ * Home's showcase (src/lib/home-showcase.ts) against the catalog and the files in public/: every preset it names is+ * real, has its cover (and its clip where the slot plays one), shows once, and every number it quotes is the+ * catalog's own.+ */++const root = process.cwd();+const exists = (url: string) => (fs.statSync(path.join(root, "public", url), { throwIfNoEntry: false })?.size ?? 0) > 0;++/** Covers the reviews turned down: no real cover yet, or white bars at the sides (and Text Edit's white edge). */+const NO_COVER = ["app-fuobe-angles", "app-talking-photo", "motion-dolly-zoom-out", "motion-buckle-up"];+const WHITE_BARS = ["app-dance", "app-simlife", "app-game-dump", "app-japanese-show", "app-comic-book", "app-banana-eating", "app-change-background", "effect-boiling-point", "effect-color-rain", "app-text-edit"];+/** Studio cards that rest on a still: Image to 3D's turntable shot. */+const STILLS = ["app-3d-rotation"];++const studioIds = HOME_STUDIOS.flatMap((s) => (s.id ? [s.id] : []));+const homeIds = [...HOME_WALL.map((t) => t.id), ...HOME_EFFECTS, ...HOME_MOTIONS, ...HOME_BEFORE_AFTER.map((p) => p.id), ...HOME_REVEALS, ...studioIds];++describe("Home's showcase", () => {+ it("names real presets, each with its cover and, where the slot plays one, its clip", () => {+ for (const id of homeIds) {+ expect(getPreset(id), id).toBeDefined();+ const cover = PRESET_PREVIEWS[id];+ expect(cover, `${id} has a real cover`).toBeDefined();+ expect(exists(cover.poster), cover.poster).toBe(true);+ if (!STILLS.includes(id)) {+ expect(cover.video, `${id} has a clip`).toBeDefined();+ expect(exists(cover.video!), cover.video).toBe(true);+ }+ expect(NO_COVER, id).not.toContain(id);+ expect(WHITE_BARS, id).not.toContain(id);+ }+ expect(fs.existsSync(path.join(root, "public", "previews", "presets", "thumbs", `${HOME_BEFORE_AFTER[0].id}.jpg`))).toBe(true);+ });++ it("shows each preset once (the playback store keys by id: a repeat would play in two places)", () => {+ expect(new Set(homeIds).size).toBe(homeIds.length);+ });++ it("rests effects and apps on their peak frame, cut and listed; camera motions on their poster", async () => {+ const home = await homeShowcase();+ const cards = [...home.wall.map((t) => t.card), ...home.effects, ...home.motions, ...home.reveals, ...home.studios.flatMap((s) => (s.card ? [s.card] : []))];+ for (const c of cards) {+ const peaked = !!PRESET_PEAKS[c.id];+ expect(!!c.preview.rest, c.id).toBe(peaked);+ if (c.preview.rest) {+ expect(c.preview.rest).toEqual({ src: `/previews/presets/peak/${c.id}.jpg`, at: PRESET_PEAKS[c.id].at });+ expect(exists(c.preview.rest.src), c.preview.rest.src).toBe(true);+ }+ if (c.id.startsWith("motion-")) expect(c.preview.rest, c.id).toBeUndefined();+ }+ for (const id of [...HOME_EFFECTS, ...HOME_REVEALS, ...HOME_WALL.filter((t) => !t.id.startsWith("motion-")).map((t) => t.id)]) expect(PRESET_PEAKS[id], id).toBeDefined();+ // The before/after: the poster, then the peak.+ for (const p of home.beforeAfter) {+ expect(p.before).toBe(PRESET_PREVIEWS[p.id].poster);+ expect(p.after).toBe(`/previews/presets/peak/${p.id}.jpg`);+ expect(p.tags).toHaveLength(2);+ }+ // Every peak in the list has its file, and every file is in the list; a peak starts inside its clip's last second.+ const files = fs.readdirSync(path.join(root, "public", "previews", "presets", "peak")).map((f) => f.replace(/\.jpg$/, ""));+ expect(files.sort()).toEqual(Object.keys(PRESET_PEAKS).sort());+ for (const [id, { at }] of Object.entries(PRESET_PEAKS)) {+ expect(PRESET_PREVIEWS[id]?.video, id).toBeDefined();+ expect(at, id).toBeGreaterThan(2.5);+ expect(at, id).toBeLessThan(4);+ }+ });++ it("links effects and motions to the Video studio with the preset picked, apps to their own page", async () => {+ expect(presetHref("effect-flame-on")).toBe("/video?preset=effect-flame-on");+ expect(presetHref("motion-glam")).toBe("/video?preset=motion-glam");+ expect(presetHref("app-relight")).toBe("/apps/app-relight");+ const home = await homeShowcase();+ for (const t of home.wall) expect(t.href).toBe(presetHref(t.id));+ for (const p of home.beforeAfter) expect(p.href).toBe(`/apps/${p.id}`);+ const routes = new Set(NAV.flatMap((g) => g.items.map((i) => i.href)));+ for (const s of home.studios) expect(routes.has(s.href), s.href).toBe(true);+ for (const p of home.pills) expect(routes.has(p.href), p.href).toBe(true);+ });++ it("covers every place to create: the studio cards, the pills and the four with a section of their own", async () => {+ const home = await homeShowcase();+ const create = NAV.find((g) => g.label === "Create")!.items.filter((i) => i.href !== "/");+ const studios = NAV.find((g) => g.label === "Studios")!.items;+ expect(home.facts.destinations).toBe(create.length + studios.length);+ expect(home.studios.length + home.pills.length + HOME_OWN_SECTIONS.length).toBe(home.facts.destinations);+ const shown = [...home.studios.map((s) => s.href), ...home.pills.map((p) => p.href), ...HOME_OWN_SECTIONS];+ expect(new Set(shown).size).toBe(shown.length);+ expect(new Set(shown)).toEqual(new Set([...create, ...studios].map((i) => i.href)));+ // The pills keep the sidebar's order and labels.+ const order = [...create, ...studios].map((i) => i.href);+ expect(home.pills.map((p) => order.indexOf(p.href))).toEqual(home.pills.map((p) => order.indexOf(p.href)).sort((a, b) => a - b));+ expect(home.studios.find((s) => s.href === "/audio")?.card).toBeUndefined();+ });++ it("quotes the catalog's own numbers", async () => {+ const { facts, studios, audioTools } = await homeShowcase();+ const visible = MODELS.filter((m) => !m.hidden);+ const open = (m: (typeof MODELS)[number]) => m.engine === "open" || !!m.engines?.includes("open");+ const manifest = JSON.parse(fs.readFileSync(path.join(root, "workflows", "comfyui", "manifest.json"), "utf8")) as { workflows: LicenceWorkflowInput[] };+ expect(facts.workflows).toBe(manifest.workflows.length);+ expect(facts.presets).toBe(APPS.length + MOTIONS.length + EFFECTS.length);+ expect([facts.apps, facts.motions, facts.effects]).toEqual([APPS.length, MOTIONS.length, EFFECTS.length]);+ expect(facts.originals).toBe(visible.filter((m) => m.vendor === "Fuobe Original").length);+ expect(facts.originals).toBeGreaterThan(0);+ expect(facts.partners).toBe(visible.filter((m) => m.engine === "cloud" && !m.engines?.includes("open")).length);+ expect(facts.cinemaMoves).toBe(CAMERA_MOVES.length);+ expect(facts.adTemplates).toBe(TEMPLATES.length);+ expect(facts.mixedLooks).toBe(EFFECTS.filter((e) => e.category === "Mixed Media").length);+ expect(facts.audioTools).toBe(HUB_MODES.audio.length);+ expect(facts.skills).toBe(fs.readdirSync(path.join(root, "skills")).filter((d) => fs.existsSync(path.join(root, "skills", d, "SKILL.md"))).length);+ // The open models are About & licences' count (src/app/(studio)/settings/about/page.tsx): one row per model or graph with weights.+ const about = buildLicenceList(+ MODELS.map((m) => ({ id: m.id, name: m.name, vendor: m.vendor, kind: m.kind, hidden: m.hidden, routes: m.routes.map((r) => ({ provider: r.provider, endpoint: r.endpoint })) })),+ manifest.workflows,+ );+ expect(facts.openModels).toBe(about.counts.all);+ expect(facts.openModels).toBeGreaterThan(visible.filter((m) => open(m)).length / 2);+ // The studio cards' lines carry them.+ expect(studios.find((s) => s.href === "/cinema")?.line).toContain(`${facts.cinemaMoves} moves`);+ expect(studios.find((s) => s.href === "/marketing")?.line).toContain(`${facts.adTemplates} ad templates`);+ expect(studios.find((s) => s.href === "/mixed-media")?.line).toContain(`${facts.mixedLooks} looks`);+ expect(audioTools.named).toEqual(["Speech", "Dialogue", "Music", "Sound effects", "Split soundtrack"]);+ expect(audioTools.named.length + audioTools.more).toBe(HUB_MODES.audio.length);+ });++ it("rounds the open models down to ten, so the subtitle never overstates", () => {+ expect(roundedDown(131)).toBe("130+");+ expect(roundedDown(140)).toBe("140+");+ expect(roundedDown(149)).toBe("140+");+ });++ it("lists Just added from the catalog's live open models, newest first", () => {+ const models = newOpenModels();+ expect(models.length).toBeGreaterThanOrEqual(6);+ expect(models.length).toBeLessThanOrEqual(8);+ // A typo would hide a model: every id on the list is in the catalog.+ for (const id of HOME_NEW_OPEN) expect(MODELS.some((m) => m.id === id), id).toBe(true);+ const listed = HOME_NEW_OPEN.filter((id) => MODELS.some((m) => m.id === id && !m.hidden));+ expect(models.map((m) => m.id)).toEqual(listed.slice(0, 8));+ for (const m of models) expect(m.href).toMatch(/^\//);+ // A model not merged yet (or hidden) doesn't show, and the catalog's other new open models fill in.+ const fewer = newOpenModels(MODELS.filter((m) => !HOME_NEW_OPEN.slice(0, 10).includes(m.id)));+ expect(fewer.length).toBeGreaterThanOrEqual(6);+ for (const m of fewer) expect(HOME_NEW_OPEN.slice(0, 10)).not.toContain(m.id);+ });++ it("says what Assist plans with, from the provider registry", async () => {+ const { runsOn, skills } = await homeShowcase();+ const hosted = LLM_PROVIDERS.filter((p) => p.group !== "local");+ expect(runsOn.named).toEqual(hosted.slice(0, 6).map((p) => p.short));+ expect(runsOn.named.length + runsOn.more).toBe(hosted.length);+ expect(runsOn.local).toEqual(LLM_PROVIDERS.filter((p) => p.group === "local" && p.id !== "custom").map((p) => p.label));+ // The starter skills exist, each with its SKILL.md title.+ expect(skills.map((s) => s.name)).toEqual(HOME_SKILLS);+ for (const s of skills) expect(fs.readFileSync(path.join(root, "skills", s.name, "SKILL.md"), "utf8")).toContain(`title: ${s.title}`);+ });++ it("fills the composer from a Try chip in one of its three modes", () => {+ for (const c of HOME_TRY) {+ expect(["image", "video", "edit"]).toContain(c.mode);+ expect(c.prompt.length).toBeGreaterThan(c.label.length);+ }+ expect(new Set(HOME_TRY.map((c) => c.mode)).size).toBe(HOME_TRY.length);+ });+});++describe("Assist's address prefill", () => {+ it("types ?prompt= into a new chat (cut to its limit), and ?skill= wins over it; nothing is sent", () => {+ expect(assistDraft(null, ASSIST_SUGGESTIONS[0])).toBe(ASSIST_SUGGESTIONS[0]);+ expect(assistDraft(null, null)).toBe("");+ expect(assistDraft(null, "x".repeat(ASSIST_PROMPT_MAX + 50))).toHaveLength(ASSIST_PROMPT_MAX);+ expect(assistDraft("ugc-video", "ignored")).toBe("/ugc-video ");+ expect(assistDraft("Not a skill!", "ignored")).toBe("");+ });+});diff --git a/tests/preset-covers.test.ts b/tests/preset-covers.test.tsindex 37906bac..c4e75758 100644--- a/tests/preset-covers.test.ts+++ b/tests/preset-covers.test.ts@@ -73,8 +73,8 @@ describe("the preset covers manifest", () => {it("is read only on the server and in the preset header's own chunk", () => {// Client chunks keep whatever client code uses from a module. preset-cards.ts is in the galleries',// home's, shorts' and mixed media's chunks, so importing the manifest there (or preset-card-data.ts,- // which does) would ship it to all of them. A new importer belongs here only if it's a server page- // or loaded on its own (next/dynamic), like the preset header.+ // which does) would ship it to all of them. A new importer belongs here only if it's a server page,+ // server-only (Home's showcase) or loaded on its own (next/dynamic), like the preset header.const sources = fs.readdirSync(path.join(root, "src"), { recursive: true, encoding: "utf8" }).filter((f) => /\.tsx?$/.test(f))@@ -89,9 +89,10 @@ describe("the preset covers manifest", () => {"app/(studio)/apps/page.tsx","app/(studio)/effects/page.tsx","app/(studio)/motions/page.tsx",- "app/(studio)/page.tsx","components/preset-header.tsx",+ "lib/home-showcase.ts",]);+ expect(fs.readFileSync(path.join(root, "src", "lib", "home-showcase.ts"), "utf8")).toMatch(/^import "server-only";$/m);// The slim map (which presets have a cover, and a clip: a few KB) is for the pickers, each in its own chunk: the// camera motion and Mix pickers (next/dynamic in composer.tsx) and Cinema Studio's moves (next/dynamic in// camera-moves.tsx, loaded when the "#" picker or the Director panel's Movement tab shows them).