Multi-Agent Collaboration for Team and Friends
TypeScript agent-automationagent-orchestrationagent-workflowai-agentsai-collaborationai-memoryai-workforceautonomous-agentsclaude-codeclaude-code-skillscodexcoding-agentmulti-agentmultiple-agentone-person-businessone-person-companyone-person-teamopencodesolopreneur
feat(auth): add product motion gallery to sign-in
Gus96e4551a8bc8
diff --git a/src/web/public/_headers b/src/web/public/_headersindex da2eec5cf..ac7e65b81 100644--- a/src/web/public/_headers+++ b/src/web/public/_headers@@ -12,9 +12,6 @@/images/*Cache-Control: public, max-age=2592000-/gallery/*- Cache-Control: public, max-age=2592000-# Homepage - cache for 15 minutes/Cache-Control: public, max-age=900, s-maxage=900, stale-while-revalidate=3600@@ -27,4 +24,4 @@# Default for HTML pages - cache for 5 minutes/*- Cache-Control: public, max-age=300, s-maxage=300, stale-while-revalidate=3600\ No newline at end of file+ Cache-Control: public, max-age=300, s-maxage=300, stale-while-revalidate=3600diff --git a/src/web/public/gallery/calendar.png b/src/web/public/gallery/calendar.pngdeleted file mode 100644index 01d8cafc8..000000000Binary files a/src/web/public/gallery/calendar.png and /dev/null differdiff --git a/src/web/public/gallery/collaboration.png b/src/web/public/gallery/collaboration.pngdeleted file mode 100644index 1ed850abe..000000000Binary files a/src/web/public/gallery/collaboration.png and /dev/null differdiff --git a/src/web/public/gallery/email.png b/src/web/public/gallery/email.pngdeleted file mode 100644index 5a28a2d8a..000000000Binary files a/src/web/public/gallery/email.png and /dev/null differdiff --git a/src/web/public/gallery/issues.png b/src/web/public/gallery/issues.pngdeleted file mode 100644index fe61a3aab..000000000Binary files a/src/web/public/gallery/issues.png and /dev/null differdiff --git a/src/web/public/gallery/local-agent.png b/src/web/public/gallery/local-agent.pngdeleted file mode 100644index ddddb8327..000000000Binary files a/src/web/public/gallery/local-agent.png and /dev/null differdiff --git a/src/web/public/gallery/org.png b/src/web/public/gallery/org.pngdeleted file mode 100644index f00e9cd5d..000000000Binary files a/src/web/public/gallery/org.png and /dev/null differdiff --git a/src/web/src/app/(auth)/sign-in/sign-in-client.tsx b/src/web/src/app/(auth)/sign-in/sign-in-client.tsxindex 0602200f9..6d4031404 100644--- a/src/web/src/app/(auth)/sign-in/sign-in-client.tsx+++ b/src/web/src/app/(auth)/sign-in/sign-in-client.tsx@@ -20,9 +20,13 @@ import {FieldSeparator,} from "@/components/ui/field"import { SiGithub, SiGoogle } from "@icons-pack/react-simple-icons"-import Image from "next/image"import { GradientBackground } from "@/components/gradient-background"import { Logo } from "@/components/logo"+import { LandingShellMotion } from "@/components/home/landing-shell-motion"+import {+ sceneDurationMs,+ type LandingScene,+} from "@/components/home/landing-shell-motion-timeline"import { DEV_PASSWORD } from "@alook/shared"// Default post-login landing when no explicit `?redirect=` is present. Points@@ -279,64 +283,102 @@ function SignInForm({ postLoginUrl, isProd }: { postLoginUrl: string; isProd: bo)}-const galleryImages = [- { src: "/gallery/collaboration.png", label: "Collaboration" },- { src: "/gallery/email.png", label: "Email Inbox" },- { src: "/gallery/issues.png", label: "Kanban Board" },- { src: "/gallery/calendar.png", label: "Calendar" },- { src: "/gallery/local-agent.png", label: "Local Agent" },+const galleryScenes: { scene: LandingScene; label: string; description: string }[] = [+ {+ scene: "server",+ label: "The best room for agents and humans",+ description: "Bring your people and agents together in one shared home.",+ },+ {+ scene: "machine",+ label: "Bring your own workspaces",+ description: "Use your own computer and existing agent subscriptions.",+ },+ {+ scene: "provider",+ label: "Persistent identity and memory",+ description: "Your agents stay themselves, independent of provider.",+ },]function ProductGallery() {const [active, setActive] = useState(0)+ const [enabled, setEnabled] = useState(false)+ const [autoAdvance, setAutoAdvance] = useState(true)+ const activeScene = galleryScenes[active]useEffect(() => {- const interval = setInterval(() => {- setActive((i) => (i + 1) % galleryImages.length)- }, 3500)- return () => clearInterval(interval)+ const viewport = window.matchMedia("(min-width: 640px)")+ const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)")+ const sync = () => {+ setEnabled(viewport.matches)+ setAutoAdvance(!reducedMotion.matches)+ }+ sync()+ viewport.addEventListener("change", sync)+ reducedMotion.addEventListener("change", sync)+ return () => {+ viewport.removeEventListener("change", sync)+ reducedMotion.removeEventListener("change", sync)+ }}, [])+ useEffect(() => {+ if (!enabled || !autoAdvance) return+ const timeout = window.setTimeout(() => {+ setActive((index) => (index + 1) % galleryScenes.length)+ }, sceneDurationMs(activeScene.scene))+ return () => window.clearTimeout(timeout)+ }, [activeScene.scene, autoAdvance, enabled])++ if (!enabled) return null+return (- <div className="flex h-full flex-col items-center justify-center p-6">- <div className="relative w-full rounded-lg overflow-hidden shadow-lg">- {galleryImages.map((img, i) => (- <Image- key={img.src}- src={img.src}- alt={img.label}- width={600}- height={450}- className="w-full h-auto transition-opacity duration-500"- style={{- opacity: i === active ? 1 : 0,- position: i === 0 ? "relative" : "absolute",- top: 0,- left: 0,- }}- priority={i === 0}- />- ))}+ <div className="flex h-full min-h-0 flex-col items-center justify-center p-5 lg:p-7">+ <div+ className="w-full overflow-hidden rounded-sm bg-background ring-1 ring-border/60 shadow-lg"+ role="img"+ aria-label={activeScene.label}+ >+ <LandingShellMotion+ key={activeScene.scene}+ scene={activeScene.scene}+ /></div>- <p className="mt-3 text-xs text-muted-foreground font-medium tracking-wide">- {galleryImages[active].label}- </p>- <div className="mt-2 flex gap-2">- {galleryImages.map((_, i) => (- <button- key={i}- onClick={() => setActive(i)}- className="h-1.5 rounded-full transition-all duration-300"- style={{- width: i === active ? 16 : 6,- backgroundColor: i === active- ? "var(--foreground)"- : "var(--muted-foreground)",- opacity: i === active ? 1 : 0.3,- }}- aria-label={`Show ${galleryImages[i].label}`}- />- ))}+ <div className="mt-4 flex w-full items-center justify-between gap-4">+ <div aria-live="polite">+ <p className="font-mono text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground">+ {String(active + 1).padStart(2, "0")} / {String(galleryScenes.length).padStart(2, "0")}+ </p>+ <p className="mt-1 text-sm font-medium text-foreground">+ {activeScene.label}+ </p>+ <p className="mt-0.5 max-w-lg text-xs leading-relaxed text-muted-foreground">+ {activeScene.description}+ </p>+ </div>+ <div className="flex" aria-label="Product stories">+ {galleryScenes.map((item, i) => (+ <button+ key={item.scene}+ onClick={() => setActive(i)}+ className="grid size-8 place-items-center rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"+ aria-label={`Show ${item.label}`}+ aria-pressed={i === active}+ >+ <span+ className="h-1.5 rounded-full transition-all duration-300"+ style={{+ width: i === active ? 16 : 6,+ backgroundColor: i === active+ ? "var(--foreground)"+ : "var(--muted-foreground)",+ opacity: i === active ? 1 : 0.3,+ }}+ />+ </button>+ ))}+ </div></div></div>)@@ -349,17 +391,17 @@ export default function SignInPageClient({ isProd }: { isProd: boolean }) {return (<div className="relative flex min-h-svh flex-col items-center justify-center p-6 sm:p-10"><GradientBackground />- <div className="w-full max-w-sm sm:max-w-4xl">+ <div className="w-full max-w-sm sm:max-w-6xl"><div className="flex flex-col gap-6"><div className="flex justify-center mb-2"><Logo size="lg" /></div><Card className="overflow-hidden p-0">- <CardContent className="grid p-0 sm:grid-cols-2">- <div className="p-6 sm:p-8 sm:min-h-105 flex flex-col justify-center">+ <CardContent className="grid p-0 sm:grid-cols-[minmax(320px,0.82fr)_minmax(0,1.35fr)]">+ <div className="flex flex-col justify-center p-6 sm:min-h-120 sm:p-8"><SignInForm postLoginUrl={postLoginUrl} isProd={isProd} /></div>- <div className="hidden bg-muted sm:block relative overflow-hidden min-h-105">+ <div className="relative hidden min-h-120 overflow-hidden bg-muted sm:block"><ProductGallery /></div></CardContent>diff --git a/src/web/src/components/community/dm-sidebar.tsx b/src/web/src/components/community/dm-sidebar.tsxindex ab0942351..d68e23c33 100644--- a/src/web/src/components/community/dm-sidebar.tsx+++ b/src/web/src/components/community/dm-sidebar.tsx@@ -23,7 +23,6 @@ export const DmSidebar = memo(function DmSidebar({machinesActive?: booleanbotsActive?: boolean}) {- if (loading && dms.length === 0) return <DmSidebarSkeleton />const isFriendsActive = friendsActive ?? (activeDm === null && !machinesActive && !botsActive)return (<aside className="flex min-w-0 flex-1 flex-col">@@ -63,9 +62,11 @@ export const DmSidebar = memo(function DmSidebar({<div className="mb-2 px-2 text-xs font-semibold text-muted-foreground">Direct Messages</div>- {dms.length === 0 && (+ {loading && dms.length === 0 ? (+ <DmRowsSkeleton />+ ) : dms.length === 0 ? (<p className="px-2 py-4 text-center text-xs text-muted-foreground">Your direct messages will appear here.</p>- )}+ ) : null}{dms.map((d) => {const active = d.id === activeDmconst isBlocked = blockedUserIds?.has(d.userId)@@ -96,25 +97,18 @@ export const DmSidebar = memo(function DmSidebar({// Loading placeholder for the DM sidebar — mirrors the Friends button + DM// row footprint so the column doesn't reflow when conversations arrive.-function DmSidebarSkeleton() {+function DmRowsSkeleton() {return (- <aside className="flex min-w-0 flex-1 flex-col">- <div className="flex-1 overflow-hidden px-2 py-4">- <Skeleton className="mb-2 h-9 w-full rounded-md" />- <div className="my-2 h-px bg-border" />- <div className="mb-2 px-2">- <Skeleton className="h-3 w-32 rounded" />- </div>- {Array.from({ length: 5 }).map((_, i) => (- <div key={i} className="flex items-center gap-3 rounded-md px-2 py-2">- <Skeleton className="size-8 shrink-0 rounded-full" />- <div className="flex min-w-0 flex-1 flex-col gap-2">- <Skeleton className="h-3.5 w-3/5 rounded" />- <Skeleton className="h-3 w-4/5 rounded" />- </div>+ <>+ {Array.from({ length: 5 }).map((_, i) => (+ <div key={i} className="flex items-center gap-3 rounded-md px-2 py-2">+ <Skeleton className="size-8 shrink-0 rounded-full" />+ <div className="flex min-w-0 flex-1 flex-col gap-2">+ <Skeleton className="h-3.5 w-3/5 rounded" />+ <Skeleton className="h-3 w-4/5 rounded" /></div>- ))}- </div>- </aside>+ </div>+ ))}+ </>)}diff --git a/src/web/src/components/community/machines/pair-machine-sheet.tsx b/src/web/src/components/community/machines/pair-machine-sheet.tsxindex b08c7e4f9..f28e07117 100644--- a/src/web/src/components/community/machines/pair-machine-sheet.tsx+++ b/src/web/src/components/community/machines/pair-machine-sheet.tsx@@ -125,12 +125,12 @@ export function PairMachineSheet({</SheetDescription></SheetHeader><SheetBody className="flex flex-col gap-6">- <Step1+ <PairMachineStepscommand={command}generating={generating || !command}onCopy={copyCommand}+ connectedHostname={connectedHostname}/>- <Step2 ready={!!command} connectedHostname={connectedHostname} /></SheetBody><SheetFooter><SheetClose render={<Button variant="secondary">Done</Button>} />@@ -140,6 +140,37 @@ export function PairMachineSheet({)}+export function PairMachineSteps({+ command,+ generating,+ onCopy,+ connectedHostname,+ step1MotionTarget,+ step2MotionTarget,+ step1ClassName,+ step2ClassName,+}: {+ command: string+ generating: boolean+ onCopy: () => void+ connectedHostname: string | null+ step1MotionTarget?: string+ step2MotionTarget?: string+ step1ClassName?: string+ step2ClassName?: string+}) {+ return (+ <>+ <div data-motion-target={step1MotionTarget} className={step1ClassName}>+ <Step1 command={command} generating={generating} onCopy={onCopy} />+ </div>+ <div data-motion-target={step2MotionTarget} className={step2ClassName}>+ <Step2 ready={Boolean(command)} connectedHostname={connectedHostname} />+ </div>+ </>+ )+}+function Step1({command,generating,diff --git a/src/web/src/components/home/landing-shell-motion-timeline.ts b/src/web/src/components/home/landing-shell-motion-timeline.tsnew file mode 100644index 000000000..370588044--- /dev/null+++ b/src/web/src/components/home/landing-shell-motion-timeline.ts@@ -0,0 +1,161 @@+export type LandingScene = "server" | "machine" | "provider"++export const LANDING_MACHINE_RUNTIMES = [+ "claude",+ "codex",+ "cursor",+ "opencode",+ "pi",+] as const++export const SCENE_MAX_BEAT: Record<LandingScene, number> = {+ server: 6,+ machine: 7,+ provider: 9,+}++export const SCENE_BEAT_DURATION_MS = 1500+export const SCENE_FINAL_HOLD_MS = 2400++export function sceneDurationMs(scene: LandingScene) {+ return SCENE_MAX_BEAT[scene] * SCENE_BEAT_DURATION_MS + SCENE_FINAL_HOLD_MS+}++export function galleryCameraScale(scale: number) {+ return scale <= 1 ? scale : 1.6+}++export function galleryCameraTransform(+ camera: { scale: number; x: number; y: number },+ focus: { x: number; y: number } | null,+) {+ const scale = galleryCameraScale(camera.scale)+ if (scale <= 1) return { ...camera, scale }+ if (!focus) return { ...camera, scale: 1 }++ const desiredX = Math.min(Math.max(focus.x, 1120 * 0.28), 1120 * 0.72)+ const desiredY = Math.min(Math.max(focus.y, 660 * 0.24), 660 * 0.74)+ return {+ scale,+ x: (scale * focus.x - desiredX) / (scale - 1),+ y: (scale * focus.y - desiredY) / (scale - 1),+ }+}++export type SceneSnapshot = {+ beat: number+ visibleMessages: number+ composerText: string+ machineState: "empty" | "connecting" | "online" | "bot-born"+ pairSheet: "closed" | "command" | "waiting" | "connected"+ runtime: "claude" | "codex"+ model: string | null+ focus: string | null+ camera: { scale: number; x: number; y: number }+}++const WIDE_CAMERA = { scale: 1, x: 560, y: 330 }+const SERVER_CAMERAS = [+ WIDE_CAMERA,+ { scale: 1.22, x: 700, y: 570 },+ { scale: 1.18, x: 620, y: 110 },+ { scale: 1.18, x: 620, y: 190 },+ { scale: 1.18, x: 620, y: 270 },+ { scale: 1.18, x: 620, y: 350 },+ WIDE_CAMERA,+]+const MACHINE_CAMERAS = [+ WIDE_CAMERA,+ { scale: 1.2, x: 900, y: 90 },+ { scale: 1.22, x: 900, y: 180 },+ { scale: 1.22, x: 900, y: 360 },+ { scale: 1.22, x: 900, y: 510 },+ { scale: 1.18, x: 620, y: 160 },+ { scale: 1.18, x: 620, y: 360 },+ WIDE_CAMERA,+]+const PROVIDER_CAMERAS = [+ WIDE_CAMERA,+ { scale: 1.18, x: 980, y: 170 },+ { scale: 1.2, x: 950, y: 300 },+ { scale: 1.22, x: 900, y: 360 },+ { scale: 1.22, x: 930, y: 600 },+ WIDE_CAMERA,+ { scale: 1.18, x: 700, y: 570 },+ { scale: 1.18, x: 620, y: 140 },+ { scale: 1.18, x: 620, y: 230 },+ WIDE_CAMERA,+]++export function sceneSnapshot(scene: LandingScene, requestedBeat: number): SceneSnapshot {+ const beat = Math.max(0, Math.min(requestedBeat, SCENE_MAX_BEAT[scene]))+ if (scene === "server") {+ return {+ beat,+ visibleMessages: beat < 2 ? 0 : Math.min(4, beat - 1),+ composerText: beat === 1 ? "hello world" : "",+ machineState: "empty",+ pairSheet: "closed",+ runtime: "claude",+ model: null,+ focus: [null, "composer", "message-gus", "message-alli", "message-ruth", "message-shelly"][beat] ?? null,+ camera: SERVER_CAMERAS[beat] ?? WIDE_CAMERA,+ }+ }+ if (scene === "machine") {+ return {+ beat,+ visibleMessages: 0,+ composerText: "",+ machineState:+ beat < 2+ ? "empty"+ : beat < 4+ ? "connecting"+ : beat < 6+ ? "online"+ : "bot-born",+ pairSheet:+ beat === 2+ ? "command"+ : beat === 3+ ? "waiting"+ : beat === 4+ ? "connected"+ : "closed",+ runtime: "claude",+ model: null,+ focus: [+ null,+ "connect",+ "pair-step-1",+ "pair-step-2",+ "pair-connected",+ "machine",+ "born-bot",+ ][beat] ?? null,+ camera: MACHINE_CAMERAS[beat] ?? WIDE_CAMERA,+ }+ }+ return {+ beat,+ visibleMessages: beat >= 8 ? 2 : beat >= 7 ? 1 : 0,+ composerText: beat === 6 ? "hello Alli" : "",+ machineState: "online",+ pairSheet: "closed",+ runtime: beat >= 4 ? "codex" : "claude",+ model: null,+ focus: [+ null,+ "bot-actions",+ "bot-edit",+ "runtime-codex",+ "save-provider",+ "dm-alli",+ "dm-composer",+ "dm-message-gus",+ "dm-message-alli",+ ][beat] ?? null,+ camera: PROVIDER_CAMERAS[beat] ?? WIDE_CAMERA,+ }+}diff --git a/src/web/src/components/home/landing-shell-motion.module.css b/src/web/src/components/home/landing-shell-motion.module.cssnew file mode 100644index 000000000..50c180a6a--- /dev/null+++ b/src/web/src/components/home/landing-shell-motion.module.css@@ -0,0 +1,277 @@+.root {+ width: 100%;+}++.stage {+ position: relative;+ width: 100%;+ aspect-ratio: 1120 / 660;+ overflow: hidden;+ pointer-events: none;+ border-radius: var(--radius-sm);+ box-shadow: none;+ contain: layout paint;+ isolation: isolate;+}++.canvas {+ position: absolute;+ top: 0;+ left: 0;+ width: 1120px;+ height: 660px;+ transform: scale(var(--stage-scale));+ transform-origin: top left;+}++.camera {+ position: absolute;+ inset: 0;+ width: 1120px;+ height: 660px;+ transform: scale(var(--camera-scale));+ transform-origin: var(--camera-origin-x) var(--camera-origin-y);+ transition:+ transform 980ms cubic-bezier(0.4, 0, 0.2, 1),+ transform-origin 980ms cubic-bezier(0.4, 0, 0.2, 1);+ will-change: transform;+}++.sceneEnter {+ animation: scene-enter 440ms cubic-bezier(0.4, 0, 0.2, 1);+}++.cursor {+ position: absolute;+ z-index: 80;+ width: 22px;+ height: 22px;+ pointer-events: none;+ color: var(--foreground);+ filter: drop-shadow(0 1px 1px color-mix(in oklch, var(--background), transparent 20%));+ transform: translate(-3px, -3px);+ transition:+ left 760ms cubic-bezier(0.4, 0, 0.2, 1),+ top 760ms cubic-bezier(0.4, 0, 0.2, 1),+ opacity 240ms ease-out;+}++.sheetSurface {+ position: absolute;+ z-index: 50;+ top: 8px;+ right: 8px;+ bottom: 8px;+ display: flex;+ width: 448px;+ flex-direction: column;+ overflow: hidden;+ border: 1px solid var(--border);+ border-radius: var(--radius-xl);+ background: var(--background);+ box-shadow: 0 25px 50px -12px rgb(0 0 0 / 25%);+ outline: none;+ opacity: 0;+ visibility: hidden;+ pointer-events: none;+ transform: translateX(32px);+ transition:+ transform 680ms cubic-bezier(0.4, 0, 0.2, 1),+ opacity 420ms cubic-bezier(0.4, 0, 0.2, 1),+ visibility 0s linear 680ms;+}++.sheetSurface[data-open="true"] {+ opacity: 1;+ visibility: visible;+ pointer-events: auto;+ transform: translateX(0);+ transition:+ transform 680ms cubic-bezier(0.4, 0, 0.2, 1),+ opacity 420ms cubic-bezier(0.4, 0, 0.2, 1),+ visibility 0s;+}++.motionTarget {+ transform: scale(1);+ transform-origin: center;+ transition:+ transform 900ms cubic-bezier(0.4, 0, 0.2, 1),+ opacity 720ms cubic-bezier(0.4, 0, 0.2, 1);+ will-change: transform, opacity;+}++.focus {+ position: relative;+ z-index: 4;+ isolation: isolate;+ transform: scale(1.02);+}++.recede {+ opacity: 0.72;+ transform: scale(0.992);+}++.messageSlot {+ opacity: 0;+ visibility: hidden;+ transform: translateY(10px);+ transition:+ transform 560ms cubic-bezier(0.4, 0, 0.2, 1),+ opacity 420ms cubic-bezier(0.4, 0, 0.2, 1),+ visibility 0s linear 560ms;+}++.messageSlot[data-visible="true"] {+ opacity: 1;+ visibility: visible;+ transform: translateY(0);+ transition:+ transform 560ms cubic-bezier(0.4, 0, 0.2, 1),+ opacity 420ms cubic-bezier(0.4, 0, 0.2, 1),+ visibility 0s;+}++.composerLayer {+ grid-area: 1 / 1;+ opacity: 0;+ transition: opacity 240ms cubic-bezier(0.4, 0, 0.2, 1);+}++.composerLayer[data-visible="true"] {+ opacity: 1;+}++.composerLayer:first-child {+ display: block;+}++.composerLayer:nth-child(2) {+ position: absolute;+ inset: 12px 48px;+}++.typingText {+ display: inline-block;+ overflow: hidden;+ max-width: 0;+ white-space: nowrap;+ vertical-align: bottom;+ animation: typing 620ms steps(11, end) forwards;+}++.stateStack {+ display: grid;+}++.stateLayer {+ grid-area: 1 / 1;+ opacity: 0;+ visibility: hidden;+ transform: translateY(10px);+ transition:+ transform 620ms cubic-bezier(0.4, 0, 0.2, 1),+ opacity 440ms cubic-bezier(0.4, 0, 0.2, 1),+ visibility 0s linear 620ms;+}++.stateLayer[data-visible="true"] {+ opacity: 1;+ visibility: visible;+ transform: translateY(0);+ transition:+ transform 620ms cubic-bezier(0.4, 0, 0.2, 1),+ opacity 440ms cubic-bezier(0.4, 0, 0.2, 1),+ visibility 0s;+}++.resultReveal {+ opacity: 0;+ visibility: hidden;+ transform: translateY(12px) scale(0.98);+ transition:+ transform 680ms cubic-bezier(0.4, 0, 0.2, 1),+ opacity 460ms cubic-bezier(0.4, 0, 0.2, 1),+ visibility 0s linear 680ms;+}++.resultReveal[data-visible="true"] {+ opacity: 1;+ visibility: visible;+ transform: translateY(0) scale(1);+ transition:+ transform 680ms cubic-bezier(0.4, 0, 0.2, 1),+ opacity 460ms cubic-bezier(0.4, 0, 0.2, 1),+ visibility 0s;+}++.botMenu {+ position: absolute;+ z-index: 20;+ top: 52px;+ right: 16px;+ width: max-content;+ min-width: 144px;+ padding: 8px;+ border-radius: var(--radius-lg);+ background: var(--popover);+ color: var(--popover-foreground);+ box-shadow: var(--shadow-md);+ outline: 1px solid color-mix(in oklch, var(--foreground), transparent 90%);+ opacity: 0;+ visibility: hidden;+ transform: translateY(-6px) scale(0.96);+ transform-origin: top right;+ transition:+ transform 280ms cubic-bezier(0.4, 0, 0.2, 1),+ opacity 220ms ease-out,+ visibility 0s linear 280ms;+}++.botMenu[data-visible="true"] {+ opacity: 1;+ visibility: visible;+ transform: translateY(0) scale(1);+ transition:+ transform 280ms cubic-bezier(0.4, 0, 0.2, 1),+ opacity 220ms ease-out,+ visibility 0s;+}++@keyframes scene-enter {+ from {+ opacity: 0;+ transform: translateY(4px);+ }+}++@keyframes typing {+ to {+ max-width: 11ch;+ }+}++@media (prefers-reduced-motion: reduce) {+ .cursor {+ display: none;+ }++ .motionTarget,+ .messageSlot,+ .composerLayer,+ .typingText,+ .stateLayer,+ .resultReveal,+ .botMenu,+ .sheetSurface,+ .camera,+ .sceneEnter {+ transition: none;+ animation: none;+ }++ .typingText {+ max-width: 11ch;+ }+}diff --git a/src/web/src/components/home/landing-shell-motion.test.ts b/src/web/src/components/home/landing-shell-motion.test.tsnew file mode 100644index 000000000..6eac6e02a--- /dev/null+++ b/src/web/src/components/home/landing-shell-motion.test.ts@@ -0,0 +1,100 @@+import { describe, expect, it } from "vitest"+import {+ LANDING_MACHINE_RUNTIMES,+ SCENE_BEAT_DURATION_MS,+ SCENE_FINAL_HOLD_MS,+ SCENE_MAX_BEAT,+ galleryCameraScale,+ galleryCameraTransform,+ sceneDurationMs,+ sceneSnapshot,+} from "./landing-shell-motion-timeline"++describe("landing shell motion timeline", () => {+ it("reveals the server conversation in causal order", () => {+ expect(sceneSnapshot("server", 1)).toMatchObject({ composerText: "hello world", visibleMessages: 0, focus: "composer" })+ expect(sceneSnapshot("server", 2)).toMatchObject({ visibleMessages: 1, focus: "message-gus" })+ expect(sceneSnapshot("server", 3)).toMatchObject({ visibleMessages: 2, focus: "message-alli" })+ expect(sceneSnapshot("server", 4)).toMatchObject({ visibleMessages: 3, focus: "message-ruth" })+ expect(sceneSnapshot("server", 5)).toMatchObject({ visibleMessages: 4, focus: "message-shelly" })+ })++ it("shows the real pair-sheet steps before the machine and born bot", () => {+ expect(sceneSnapshot("machine", 1)).toMatchObject({ machineState: "empty", pairSheet: "closed", focus: "connect" })+ expect(sceneSnapshot("machine", 2)).toMatchObject({ machineState: "connecting", pairSheet: "command", focus: "pair-step-1" })+ expect(sceneSnapshot("machine", 3)).toMatchObject({ machineState: "connecting", pairSheet: "waiting", focus: "pair-step-2" })+ expect(sceneSnapshot("machine", 4)).toMatchObject({ machineState: "online", pairSheet: "connected", focus: "pair-connected" })+ expect(sceneSnapshot("machine", 5)).toMatchObject({ machineState: "online", pairSheet: "closed", focus: "machine" })+ expect(sceneSnapshot("machine", 6)).toMatchObject({ machineState: "bot-born", pairSheet: "closed", focus: "born-bot" })+ })++ it("uses the five providers reported by the landing machine fixture", () => {+ expect(LANDING_MACHINE_RUNTIMES).toEqual([+ "claude",+ "codex",+ "cursor",+ "opencode",+ "pi",+ ])+ })++ it("switches provider, closes the sheet, opens Alli's DM, and sends a message", () => {+ expect(sceneSnapshot("provider", 1)).toMatchObject({ runtime: "claude", focus: "bot-actions" })+ expect(sceneSnapshot("provider", 2)).toMatchObject({ runtime: "claude", focus: "bot-edit" })+ expect(sceneSnapshot("provider", 3)).toMatchObject({ runtime: "claude", model: null, focus: "runtime-codex", camera: { scale: 1.22 } })+ expect(sceneSnapshot("provider", 4)).toMatchObject({ runtime: "codex", model: null, focus: "save-provider" })+ expect(sceneSnapshot("provider", 5)).toMatchObject({ runtime: "codex", model: null, focus: "dm-alli", camera: { scale: 1 } })+ expect(sceneSnapshot("provider", 6)).toMatchObject({ composerText: "hello Alli", visibleMessages: 0, focus: "dm-composer", camera: { scale: 1.18 } })+ expect(sceneSnapshot("provider", 7)).toMatchObject({ composerText: "", visibleMessages: 1, focus: "dm-message-gus" })+ expect(sceneSnapshot("provider", 8)).toMatchObject({ visibleMessages: 2, focus: "dm-message-alli", camera: { scale: 1.18 } })+ expect(sceneSnapshot("provider", 9)).toMatchObject({ visibleMessages: 2, focus: null, camera: { scale: 1 } })+ })++ it("zooms in around the cursor and returns wide in all three acts", () => {+ expect(sceneSnapshot("server", 1).camera.scale).toBe(1.22)+ expect(sceneSnapshot("server", 6).camera.scale).toBe(1)+ expect(sceneSnapshot("machine", 2).camera.scale).toBe(1.22)+ expect(sceneSnapshot("machine", 7).camera.scale).toBe(1)+ expect(sceneSnapshot("provider", 3).camera.scale).toBe(1.22)+ expect(sceneSnapshot("provider", 5).camera.scale).toBe(1)+ expect(sceneSnapshot("provider", 6).camera.scale).toBe(1.18)+ expect(sceneSnapshot("provider", 9).camera.scale).toBe(1)+ })++ it("clamps out-of-range beats to a valid deterministic snapshot", () => {+ expect(sceneSnapshot("server", -1).beat).toBe(0)+ expect(sceneSnapshot("server", 99).beat).toBe(SCENE_MAX_BEAT.server)+ expect(sceneSnapshot("machine", 99).machineState).toBe("bot-born")+ })++ it("exposes each act's complete playback duration to gallery consumers", () => {+ expect(sceneDurationMs("server")).toBe(+ SCENE_MAX_BEAT.server * SCENE_BEAT_DURATION_MS + SCENE_FINAL_HOLD_MS,+ )+ expect(sceneDurationMs("machine")).toBe(12_900)+ expect(sceneDurationMs("provider")).toBe(15_900)+ })++ it("boosts focused gallery beats while preserving wide beats", () => {+ expect(galleryCameraScale(1)).toBe(1)+ expect(galleryCameraScale(1.18)).toBe(1.6)+ expect(galleryCameraScale(1.22)).toBe(1.6)+ })++ it("keeps bottom-edge focus targets inside the gallery camera", () => {+ const camera = galleryCameraTransform(+ { scale: 1.18, x: 700, y: 570 },+ { x: 700, y: 620 },+ )+ const transformedFocusY = camera.y + camera.scale * (620 - camera.y)++ expect(camera.scale).toBe(1.6)+ expect(transformedFocusY).toBeCloseTo(660 * 0.74)+ })++ it("waits at wide view until the live focus target is resolved", () => {+ expect(+ galleryCameraTransform({ scale: 1.22, x: 900, y: 510 }, null),+ ).toMatchObject({ scale: 1 })+ })+})diff --git a/src/web/src/components/home/landing-shell-motion.tsx b/src/web/src/components/home/landing-shell-motion.tsxnew file mode 100644index 000000000..c1cc78424--- /dev/null+++ b/src/web/src/components/home/landing-shell-motion.tsx@@ -0,0 +1,901 @@+"use client"++import {+ useEffect,+ useLayoutEffect,+ useRef,+ useState,+ type CSSProperties,+ type ReactNode,+ type RefObject,+} from "react"+import { QueryClient, QueryClientProvider } from "@tanstack/react-query"+import {+ Activity,+ MoreVertical,+ MousePointer2,+ PlusCircle,+ RotateCcw,+ Smile,+} from "lucide-react"+import type { CommunityMachineSummary } from "@alook/shared"+import { AgentAvatar, type AvatarDraft } from "@/components/avatar"+import { ProviderLogo } from "@/components/provider-logo"+import { Button } from "@/components/ui/button"+import { Card } from "@/components/ui/card"+import { AppSurface } from "@/components/ui/app-surface"+import { SheetBody, SheetFooter, SheetHeader } from "@/components/ui/sheet"+import { Shell } from "@/components/community/shell"+import { ServerRail } from "@/components/community/server-rail"+import { ChannelSidebar } from "@/components/community/channel-sidebar"+import { DmSidebar } from "@/components/community/dm-sidebar"+import { DmHeader } from "@/components/community/dm-header"+import { ChannelHeader } from "@/components/community/channel-header"+import { Message } from "@/components/community/message"+import { MachineCard } from "@/components/community/machines/machine-card"+import { PairMachineSteps } from "@/components/community/machines/pair-machine-sheet"+import { ConnectTile } from "@/components/community/onboarding-tiles/connect-tile"+import { BotFormFields } from "@/components/community/bots/bot-form-fields"+import { BotRuntimeFields } from "@/components/community/bots/bot-runtime-fields"+import { UserBar } from "@/components/community/user-bar"+import { useChannelTree } from "@/components/community/use-channel-tree"+import type { Category, DM, RenderMsg, Server } from "@/components/community/_types"+import { serializeBeamSeed } from "@/lib/avatar/seed-url"+import { tid } from "@/lib/community/testids"+import {+ LANDING_MACHINE_RUNTIMES,+ SCENE_BEAT_DURATION_MS,+ SCENE_FINAL_HOLD_MS,+ SCENE_MAX_BEAT,+ galleryCameraTransform,+ sceneSnapshot,+ type LandingScene,+ type SceneSnapshot,+} from "./landing-shell-motion-timeline"+import styles from "./landing-shell-motion.module.css"++const SERVERS: Server[] = [+ { id: "gus", name: "Gus", initial: "G", active: true, mentions: 0, isOwner: true, icon: null },+]++const CHANNELS: Category[] = [+ {+ id: "cat_public",+ name: "Public",+ channels: [+ { id: "general", name: "general", active: true, unread: false, type: "text" },+ ],+ },+ {+ id: "cat_private",+ name: "Private",+ private: true,+ channels: [+ { id: "launch", name: "launch-room", active: false, unread: false, type: "text" },+ ],+ },+]++const DMS: DM[] = [+ { id: "dm-alli", userId: "alli", name: "Alli", discriminator: "8145", avatar: "avatar:beam:alli", status: "online", preview: "Available" },+]++const MESSAGES: RenderMsg[] = [+ {+ id: "m-gus",+ type: "chat",+ authorId: "gus",+ authorName: "Gus",+ authorAvatar: "avatar:beam:gus",+ content: "hello world",+ createdAt: "2026-08-06T04:20:00.000Z",+ seq: 425,+ grouped: false,+ },+ {+ id: "m-alli",+ type: "chat",+ authorId: "alli",+ authorName: "Alli",+ authorAvatar: "avatar:beam:alli",+ content: "On it.",+ createdAt: "2026-08-06T04:20:04.000Z",+ seq: 426,+ grouped: false,+ },+ {+ id: "m-ruth",+ type: "chat",+ authorId: "ruth",+ authorName: "Ruthann",+ authorAvatar: "avatar:beam:ruth",+ content: "I’ll review the flow.",+ createdAt: "2026-08-06T04:20:07.000Z",+ seq: 427,+ grouped: false,+ },+ {+ id: "m-shelly",+ type: "chat",+ authorId: "shelly",+ authorName: "Shelly",+ authorAvatar: "avatar:beam:shelly",+ content: "Ready to ship.",+ createdAt: "2026-08-06T04:20:11.000Z",+ seq: 428,+ grouped: false,+ },+]++const DM_MESSAGES: RenderMsg[] = [+ {+ id: "dm-message-gus",+ type: "chat",+ authorId: "gus",+ authorName: "Gus",+ authorAvatar: "avatar:beam:gus",+ content: "hello Alli",+ createdAt: "2026-08-06T04:21:00.000Z",+ seq: 429,+ grouped: false,+ },+ {+ id: "dm-message-alli",+ type: "chat",+ authorId: "alli",+ authorName: "Alli",+ authorAvatar: "avatar:beam:alli",+ content: "Hi Gus — I’m running on Codex.",+ createdAt: "2026-08-06T04:21:04.000Z",+ seq: 430,+ grouped: false,+ },+]++const ONLINE_MACHINE: CommunityMachineSummary = {+ id: "machine-studio",+ hostname: "gus-macbook",+ displayName: "Gus’s MacBook Pro",+ platform: "darwin",+ arch: "arm64",+ osRelease: "15.6",+ daemonVersion: "0.0.160",+ lastSeenAt: "2026-08-06T04:20:00.000Z",+ status: "online",+ availableRuntimes: [+ { id: LANDING_MACHINE_RUNTIMES[0], status: "healthy", version: "2.1.220 (Claude Code)" },+ { id: LANDING_MACHINE_RUNTIMES[1], status: "healthy", version: "codex-cli 0.146.0" },+ { id: LANDING_MACHINE_RUNTIMES[2], status: "healthy", version: "2026.08.04-aaa8809" },+ { id: LANDING_MACHINE_RUNTIMES[3], status: "healthy", version: "1.17.20" },+ { id: LANDING_MACHINE_RUNTIMES[4], status: "healthy", version: "0.80.3" },+ ],+ createdAt: "2026-08-06T04:20:00.000Z",+ updatedAt: "2026-08-06T04:20:00.000Z",+}++const RUNTIME_OPTIONS = ONLINE_MACHINE.availableRuntimes.map((runtime) => ({+ id: runtime.id,+ unhealthy: runtime.status !== "healthy",+}))++const BOT_AVATAR_DRAFT: AvatarDraft = {+ kind: "procedural",+ image: serializeBeamSeed("alli"),+}++const PAIR_COMMAND =+ "pnpm daemon start --machine-key cmk_demo --server-url https://alook.ai --ws-url wss://alook.ai/api/ws/community-daemon"++function useReducedMotion() {+ const [reduced, setReduced] = useState(false)+ useEffect(() => {+ const query = window.matchMedia("(prefers-reduced-motion: reduce)")+ const sync = () => setReduced(query.matches)+ sync()+ query.addEventListener("change", sync)+ return () => query.removeEventListener("change", sync)+ }, [])+ return reduced+}++function useTargetCursor(+ cameraRef: RefObject<HTMLDivElement | null>,+ targetId: string | null,+ stageScale: number,+) {+ const [cursor, setCursor] = useState({+ x: 0,+ y: 0,+ visible: false,+ targetId: null as string | null,+ })++ useLayoutEffect(() => {+ const camera = cameraRef.current+ if (!camera || !targetId) {+ setCursor((current) =>+ current.visible || current.targetId+ ? { ...current, visible: false, targetId: null }+ : current,+ )+ return+ }++ setCursor((current) =>+ current.targetId === targetId+ ? current+ : { ...current, visible: false, targetId: null },+ )++ const sync = () => {+ const target = camera.querySelector<HTMLElement>(+ `[data-motion-target="${targetId}"]`,+ )+ if (!target) {+ setCursor((current) =>+ current.visible || current.targetId+ ? { ...current, visible: false, targetId: null }+ : current,+ )+ return+ }+ const cameraRect = camera.getBoundingClientRect()+ const targetRect = target.getBoundingClientRect()+ const scale = cameraRect.width / camera.offsetWidth || stageScale || 1+ const anchorX = Number(target.dataset.motionAnchorX ?? "0.5")+ const anchorY = Number(target.dataset.motionAnchorY ?? "0.5")+ setCursor({+ x: (targetRect.left - cameraRect.left + targetRect.width * anchorX) / scale,+ y: (targetRect.top - cameraRect.top + targetRect.height * anchorY) / scale,+ visible: true,+ targetId,+ })+ }++ const firstFrame = window.requestAnimationFrame(() => {+ window.requestAnimationFrame(sync)+ })+ const observer = new ResizeObserver(sync)+ observer.observe(camera)+ camera.addEventListener("scroll", sync, true)+ return () => {+ window.cancelAnimationFrame(firstFrame)+ observer.disconnect()+ camera.removeEventListener("scroll", sync, true)+ }+ }, [cameraRef, stageScale, targetId])++ return cursor+}++function useVisualFocus(scene: LandingScene, focus: string | null) {+ const [visualFocus, setVisualFocus] = useState<string | null>(null)++ useEffect(() => {+ const frame = window.requestAnimationFrame(() => setVisualFocus(focus))+ return () => window.cancelAnimationFrame(frame)+ }, [focus, scene])++ return visualFocus+}++export function LandingShellMotion({ scene }: { scene: LandingScene }) {+ const [beat, setBeat] = useState(0)+ const stageRef = useRef<HTMLDivElement>(null)+ const cameraRef = useRef<HTMLDivElement>(null)+ const [stageScale, setStageScale] = useState(1)+ const reducedMotion = useReducedMotion()+ const [queryClient] = useState(+ () => new QueryClient({ defaultOptions: { queries: { staleTime: Infinity, retry: false } } }),+ )+ const maxBeat = SCENE_MAX_BEAT[scene]++ useEffect(() => {+ setBeat(reducedMotion ? maxBeat : 0)+ }, [scene, maxBeat, reducedMotion])++ useEffect(() => {+ if (reducedMotion) return+ const delay = beat >= maxBeat ? SCENE_FINAL_HOLD_MS : SCENE_BEAT_DURATION_MS+ const timer = window.setTimeout(() => {+ setBeat((current) => (current >= maxBeat ? 0 : current + 1))+ }, delay)+ return () => window.clearTimeout(timer)+ }, [beat, maxBeat, reducedMotion])++ useEffect(() => {+ const stage = stageRef.current+ if (!stage) return+ const sync = () => setStageScale(stage.getBoundingClientRect().width / 1120)+ sync()+ const observer = new ResizeObserver(sync)+ observer.observe(stage)+ return () => observer.disconnect()+ }, [])++ const snapshot = sceneSnapshot(scene, beat)+ const visualFocus = useVisualFocus(scene, snapshot.focus)+ const visualSnapshot = { ...snapshot, focus: visualFocus }+ const cursor = useTargetCursor(cameraRef, visualFocus, stageScale)+ const cameraReady = Boolean(+ snapshot.focus &&+ visualFocus === snapshot.focus &&+ cursor.visible &&+ cursor.targetId === snapshot.focus,+ )+ const camera = galleryCameraTransform(+ snapshot.camera,+ cameraReady ? cursor : null,+ )++ return (+ <div className={styles.root}>+ <div+ ref={stageRef}+ className={styles.stage}+ data-testid="landing-motion-stage"+ data-scene={scene}+ data-beat={snapshot.beat}+ aria-hidden+ >+ <div+ className={styles.canvas}+ style={{ "--stage-scale": stageScale } as CSSProperties}+ >+ <div+ ref={cameraRef}+ className={styles.camera}+ data-camera-scale={camera.scale}+ style={+ {+ "--camera-scale": camera.scale,+ "--camera-origin-x": `${camera.x}px`,+ "--camera-origin-y": `${camera.y}px`,+ } as CSSProperties+ }+ >+ <QueryClientProvider client={queryClient}>+ <PrototypeShell scene={scene} snapshot={visualSnapshot} />+ </QueryClientProvider>+ <MousePointer2+ aria-hidden+ data-testid="landing-motion-cursor"+ className={styles.cursor}+ data-cursor-target={visualFocus ?? undefined}+ style={{ left: cursor.x, top: cursor.y, opacity: cameraReady ? 1 : 0 }}+ fill="var(--background)"+ strokeWidth={1.8}+ />+ </div>+ </div>+ </div>+ </div>+ )+}++function PrototypeShell({ scene, snapshot }: { scene: LandingScene; snapshot: SceneSnapshot }) {+ const serverView = scene === "server"+ return (+ <Shell>+ <ServerRail+ servers={SERVERS}+ folders={[]}+ activeServerId="gus"+ view={serverView ? "server" : "dm"}+ bottomInset={60}+ onHome={() => {}}+ onServer={() => {}}+ onServerNavigate={() => {}}+ />+ <div className="relative flex min-w-0 flex-1 flex-col pt-2">+ <AppSurface className="rounded-tl-xl rounded-tr-none rounded-br-none rounded-bl-none border-l border-t border-border/40 shadow-none ring-0">+ <div className="flex min-h-0 flex-1">+ <div+ key={`sidebar-${scene}`}+ className={`flex w-60 shrink-0 flex-col bg-sidebar pb-14 ${styles.sceneEnter}`}+ >+ {serverView ? (+ <PrototypeChannelSidebar />+ ) : (+ <PrototypeDmSidebar scene={scene} snapshot={snapshot} />+ )}+ </div>+ <div+ key={`content-${scene}`}+ className={`flex min-w-0 flex-1 flex-col bg-background ${styles.sceneEnter}`}+ >+ {scene === "server" && <ServerScene snapshot={snapshot} />}+ {scene === "machine" && <MachineScene snapshot={snapshot} />}+ {scene === "provider" && <ProviderScene snapshot={snapshot} />}+ </div>+ </div>+ </AppSurface>+ <div className="absolute bottom-0 left-0 z-10 -ml-14 w-74">+ <UserBar+ user={{ id: "gus", name: "Gus", avatar: "avatar:beam:gus" }}+ onEditProfile={() => {}}+ />+ </div>+ </div>+ </Shell>+ )+}++function PrototypeChannelSidebar() {+ const tree = useChannelTree(CHANNELS)+ return (+ <ChannelSidebar+ tree={tree}+ serverName="Gus"+ activeChannel="general"+ setActiveChannel={() => {}}+ isAdmin={false}+ currentUserId="gus"+ />+ )+}++function PrototypeDmSidebar({+ scene,+ snapshot,+}: {+ scene: LandingScene+ snapshot: SceneSnapshot+}) {+ const sidebarRef = useRef<HTMLDivElement>(null)+ const dmOpen = scene === "provider" && snapshot.beat >= 6++ useLayoutEffect(() => {+ const row = sidebarRef.current?.querySelector<HTMLElement>(+ `[data-testid="${tid.dmRow("dm-alli")}"]`,+ )+ row?.setAttribute("data-motion-target", "dm-alli")+ return () => {+ row?.removeAttribute("data-motion-target")+ }+ }, [])++ return (+ <div ref={sidebarRef} className="flex min-h-0 flex-1 flex-col">+ <DmSidebar+ dms={DMS}+ activeDm={dmOpen ? "dm-alli" : null}+ onPickDm={() => {}}+ onShowFriends={() => {}}+ onShowMachines={() => {}}+ onShowBots={() => {}}+ machinesActive={scene === "machine"}+ botsActive={scene === "provider" && !dmOpen}+ />+ </div>+ )+}++function targetClass(snapshot: SceneSnapshot, id: string, className?: string) {+ return [+ styles.motionTarget,+ snapshot.focus === id ? styles.focus : snapshot.focus ? styles.recede : undefined,+ className,+ ]+ .filter(Boolean)+ .join(" ")+}++function PrototypeSheet({+ children,+ label,+ open = true,+}: {+ children: ReactNode+ label: string+ open?: boolean+}) {+ return (+ <aside+ aria-label={label}+ aria-hidden={!open}+ data-slot="sheet-content"+ data-open={open}+ className={styles.sheetSurface}+ >+ {children}+ </aside>+ )+}++function ServerScene({ snapshot }: { snapshot: SceneSnapshot }) {+ return (+ <>+ <ChannelHeader+ channel="general"+ rightPanel={null}+ onToggle={() => {}}+ server={{ id: "gus", name: "Gus", icon: null }}+ />+ <div className="flex min-h-0 flex-1 flex-col overflow-hidden">+ <div className="flex-1 overflow-hidden px-4 py-3">+ {MESSAGES.map((message, index) => (+ <div+ key={message.id}+ data-visible={index < snapshot.visibleMessages}+ className={styles.messageSlot}+ >+ <div+ data-motion-target={`message-${message.authorId}`}+ className={targetClass(snapshot, `message-${message.authorId}`)}+ >+ <Message m={message} onOpenThread={() => {}} />+ </div>+ </div>+ ))}+ </div>+ <PrototypeComposer+ snapshot={snapshot}+ target="composer"+ placeholder="Message /general"+ />+ </div>+ </>+ )+}++function PrototypeComposer({+ snapshot,+ target,+ placeholder,+}: {+ snapshot: SceneSnapshot+ target: string+ placeholder: string+}) {+ return (+ <div className="relative px-3 pb-3 pt-0">+ <div+ className={targetClass(+ snapshot,+ target,+ "relative rounded-xl bg-muted shadow-(--e1) ring-1 ring-border/40 transition-shadow",+ )}+ >+ <div+ data-motion-target={target}+ data-motion-anchor-x="0.24"+ className="relative px-12 py-3 text-base leading-6"+ >+ <span+ data-visible={!snapshot.composerText}+ className={`${styles.composerLayer} text-muted-foreground`}+ >+ {placeholder}+ </span>+ <span+ data-visible={Boolean(snapshot.composerText)}+ className={styles.composerLayer}+ >+ {snapshot.composerText && (+ <span className={styles.typingText}>{snapshot.composerText}</span>+ )}+ <span className="ml-0.5 inline-block h-5 w-px bg-foreground align-middle" />+ </span>+ </div>+ <button+ className="absolute bottom-2 left-2 grid size-8 place-items-center rounded-full text-muted-foreground"+ aria-label="Add"+ >+ <PlusCircle className="size-5" />+ </button>+ <button+ className="absolute right-2 bottom-2 grid size-8 place-items-center rounded-full text-muted-foreground"+ aria-label="Emoji picker"+ >+ <Smile className="size-5" />+ </button>+ </div>+ </div>+ )+}++function MachineScene({ snapshot }: { snapshot: SceneSnapshot }) {+ const online = snapshot.machineState === "online" || snapshot.machineState === "bot-born"+ const pairOpen = snapshot.pairSheet !== "closed"+ const pairConnected = snapshot.pairSheet === "connected"+ const step2Target = pairConnected ? "pair-connected" : "pair-step-2"+ return (+ <>+ <div className={`${styles.stateStack} min-h-0 flex-1`}>+ <div+ data-visible={!online}+ className={`${styles.stateLayer} flex min-w-0 flex-col`}+ >+ <div className="flex flex-1 flex-col items-center justify-center gap-4 p-12 text-center">+ <div className="w-full max-w-70 overflow-hidden rounded-xl">+ <div className="aspect-200/130 w-full">+ <ConnectTile idPrefix="landing-motion-connect" />+ </div>+ </div>+ <div className="flex flex-col gap-1">+ <h2 className="text-lg font-medium text-foreground">No machines yet</h2>+ <p className="max-w-md text-sm text-muted-foreground">+ Connect a machine and your bots run on it always-on — reach them from+ your phone or anywhere, wherever you sign in.+ </p>+ </div>+ <div className="flex items-center gap-2">+ <Button+ data-onboarding-target="connect-machine"+ data-motion-target="connect"+ className={targetClass(snapshot, "connect")}+ >+ Connect a machine+ </Button>+ <Button variant="ghost">Guide me</Button>+ </div>+ </div>+ </div>++ <div+ data-visible={online}+ className={`${styles.stateLayer} flex min-w-0 flex-col gap-6 overflow-hidden p-6`}+ >+ <header className="flex items-center justify-between">+ <div>+ <h1 className="text-xl font-medium text-foreground">Machines</h1>+ <p className="text-sm text-muted-foreground">+ Your computers running the alook daemon.+ </p>+ </div>+ <Button>Connect a machine</Button>+ </header>++ <div+ data-motion-target="machine"+ className={targetClass(snapshot, "machine")}+ >+ <MachineCard machine={ONLINE_MACHINE} onDelete={() => {}} onReconnect={() => {}} />+ </div>++ <div+ data-visible={snapshot.machineState === "bot-born"}+ className={styles.resultReveal}+ >+ <div+ data-motion-target="born-bot"+ className={targetClass(snapshot, "born-bot")}+ >+ <BotCard runtime="claude" model={null} status="Born on Gus’s MacBook Pro" />+ </div>+ </div>+ </div>+ </div>++ <PrototypeSheet label="Connect a machine" open={pairOpen}>+ <SheetHeader>+ <h2 className="font-heading text-lg leading-tight font-semibold">Connect a machine</h2>+ </SheetHeader>+ <SheetBody className="flex flex-col gap-6">+ <PairMachineSteps+ command={PAIR_COMMAND}+ generating={false}+ onCopy={() => {}}+ connectedHostname={pairConnected ? ONLINE_MACHINE.displayName : null}+ step1MotionTarget="pair-step-1"+ step2MotionTarget={step2Target}+ step1ClassName={targetClass(snapshot, "pair-step-1")}+ step2ClassName={targetClass(snapshot, step2Target)}+ />+ </SheetBody>+ <SheetFooter>+ <Button variant="secondary">Done</Button>+ </SheetFooter>+ </PrototypeSheet>+ </>+ )+}++function ProviderScene({ snapshot }: { snapshot: SceneSnapshot }) {+ const sheetBodyRef = useRef<HTMLDivElement>(null)+ const dmOpen = snapshot.beat >= 6+ const sheetOpen = snapshot.beat >= 3 && snapshot.beat < 5+ const botMenuOpen = snapshot.beat === 2++ useEffect(() => {+ const body = sheetBodyRef.current+ if (!body) return+ if (snapshot.beat === 0) {+ body.scrollTo({ top: 0 })+ return+ }+ if (snapshot.beat !== 3) return+ const targetId = "runtime-codex"+ const frame = window.requestAnimationFrame(() => {+ const target = body.querySelector<HTMLElement>(+ `[data-motion-target="${targetId}"]`,+ )+ if (!target) return+ const bodyRect = body.getBoundingClientRect()+ const targetRect = target.getBoundingClientRect()+ body.scrollTo({+ top:+ body.scrollTop ++ targetRect.top -+ bodyRect.top -+ (body.clientHeight - targetRect.height) / 2,+ behavior: "smooth",+ })+ })+ return () => window.cancelAnimationFrame(frame)+ }, [snapshot.beat])++ return (+ <>+ <div className={`${styles.stateStack} min-h-0 flex-1`}>+ <div+ data-visible={!dmOpen}+ className={`${styles.stateLayer} flex min-w-0 flex-col gap-6 overflow-hidden p-6`}+ >+ <header>+ <h1 className="text-xl font-medium text-foreground">My Bots</h1>+ </header>+ <div className="max-w-lg">+ <BotCard+ runtime={snapshot.runtime}+ model={snapshot.model}+ status="Online"+ snapshot={snapshot}+ menuOpen={botMenuOpen}+ />+ </div>+ </div>+ <div+ data-visible={dmOpen}+ className={`${styles.stateLayer} flex min-w-0 flex-col overflow-hidden`}+ >+ <DmHeader dm={DMS[0]} />+ <div className="flex min-h-0 flex-1 flex-col overflow-hidden">+ <div className="flex-1 overflow-hidden px-4 py-3">+ {DM_MESSAGES.map((message, index) => (+ <div+ key={message.id}+ data-visible={index < snapshot.visibleMessages}+ className={styles.messageSlot}+ >+ <div+ data-motion-target={`dm-message-${message.authorId}`}+ className={targetClass(snapshot, `dm-message-${message.authorId}`)}+ >+ <Message m={message} onOpenThread={() => {}} />+ </div>+ </div>+ ))}+ </div>+ <PrototypeComposer+ snapshot={snapshot}+ target="dm-composer"+ placeholder="Message @Alli"+ />+ </div>+ </div>+ </div>++ <PrototypeSheet label="Edit Alli" open={sheetOpen}>+ <SheetHeader>+ <h2 className="font-heading text-lg leading-tight font-semibold">Edit Alli</h2>+ </SheetHeader>+ <SheetBody ref={sheetBodyRef} className="flex flex-col gap-6">+ <BotFormFields+ avatarDraft={BOT_AVATAR_DRAFT}+ onAvatarChange={() => {}}+ name="Alli"+ setName={() => {}}+ onShuffle={() => {}}+ description=""+ setDescription={() => {}}+ />+ <div>+ <BotRuntimeFields+ options={RUNTIME_OPTIONS}+ runtime={snapshot.runtime}+ model={snapshot.model}+ onRuntimeChange={() => {}}+ onModelChange={() => {}}+ radioName="landing-motion-runtime"+ motionTargetPrefix="runtime"+ modelMotionTarget="model"+ runtimeOptionClassName={(runtime) =>+ targetClass(snapshot, `runtime-${runtime}`)+ }+ modelClassName={targetClass(snapshot, "model")}+ />+ </div>+ </SheetBody>+ <SheetFooter>+ <Button variant="outline">Cancel</Button>+ <Button+ data-motion-target="save-provider"+ className={targetClass(snapshot, "save-provider")}+ >+ Save+ </Button>+ </SheetFooter>+ </PrototypeSheet>+ </>+ )+}++function BotCard({+ runtime,+ model,+ status,+ snapshot,+ menuOpen = false,+}: {+ runtime: string+ model: string | null+ status: string+ snapshot?: SceneSnapshot+ menuOpen?: boolean+}) {+ const actionButtonClass =+ "grid size-8 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground"+ const menuItemClass =+ "flex items-center gap-2 rounded-md px-2 py-2 text-sm text-popover-foreground"+ return (+ <div className="relative">+ <Card className="flex flex-col gap-3 p-4">+ <div className="flex items-start gap-3">+ <AgentAvatar name="Alli" seed="alli" size={40} />+ <div className="flex min-w-0 flex-1 flex-col gap-1">+ <div className="flex items-center gap-2">+ <span className="text-[15px] font-medium text-foreground">Alli</span>+ <span className="inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-1 text-[11px] font-medium text-emerald-600 dark:text-emerald-400">+ <span className="size-1.5 rounded-full bg-status-online" />+ {status}+ </span>+ </div>+ <span className="flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground">+ <span className="flex items-center gap-1.5">+ <ProviderLogo provider={runtime} className="size-3.5" />+ <span>{runtime}</span>+ </span>+ <span aria-hidden>·</span>+ <span className="font-mono">{model ?? "local default"}</span>+ </span>+ </div>+ <button+ aria-label="Bot actions"+ data-motion-target={snapshot ? "bot-actions" : undefined}+ className={+ snapshot+ ? targetClass(snapshot, "bot-actions", actionButtonClass)+ : actionButtonClass+ }+ >+ <MoreVertical className="size-4" />+ </button>+ </div>+ </Card>+ {snapshot && (+ <div data-visible={menuOpen} className={styles.botMenu}>+ <div className={menuItemClass}>+ <span className="size-4" aria-hidden /> Chat+ </div>+ <div className={menuItemClass}>+ <Activity className="size-4" /> View activity+ </div>+ <div+ data-motion-target="bot-edit"+ className={targetClass(snapshot, "bot-edit", menuItemClass)}+ >+ <span className="size-4" aria-hidden /> Edit+ </div>+ <div className={menuItemClass}>+ <RotateCcw className="size-4" /> Reset+ </div>+ <div className={`${menuItemClass} text-destructive`}>+ <span className="size-4" aria-hidden /> Delete+ </div>+ </div>+ )}+ </div>+ )+}