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(web): refine machine intro and landing CTA
Gusd6a03af1491d
diff --git a/src/web/src/components/community/channels/dm-sidebar.tsx b/src/web/src/components/community/channels/dm-sidebar.tsxindex b468b0a91..9c830c511 100644--- a/src/web/src/components/community/channels/dm-sidebar.tsx+++ b/src/web/src/components/community/channels/dm-sidebar.tsx@@ -45,6 +45,7 @@ export const DmSidebar = memo(function DmSidebar({</button>{onShowMachines && (<button+ data-testid={tid.machineGuideIntroSource}onClick={onShowMachines}onPointerEnter={onPrefetchMachines}onFocus={onPrefetchMachines}diff --git a/src/web/src/components/community/machines/guide-me-avatar-motion.test.ts b/src/web/src/components/community/machines/guide-me-avatar-motion.test.tsindex f0fba5a0b..aecef254c 100644--- a/src/web/src/components/community/machines/guide-me-avatar-motion.test.ts+++ b/src/web/src/components/community/machines/guide-me-avatar-motion.test.ts@@ -52,6 +52,49 @@ describe("first-signup guide avatar motion", () => {)})+ it("starts beside the desktop Machines tab and follows it into the guide", () => {+ const geometry = guideMotionGeometry(+ { left: 417, top: 0, right: 1280, bottom: 800, width: 863, height: 800 },+ { left: 900, top: 500, right: 924, bottom: 524, width: 24, height: 24 },+ 128,+ { left: 72, top: 64, right: 408, bottom: 100, width: 336, height: 36 },+ )++ expect(geometry).toMatchObject({+ startX: 424,+ startY: 64,+ controlX: 671.52,+ controlY: 116.32,+ endX: 900,+ endY: 500,+ })+ expect(guideMotionPath(geometry)).toBe(+ 'path("M 424 64 Q 671.52 116.32, 900 500")',+ )+ })++ it("starts beside the mobile Machines title without leaving the viewport", () => {+ const geometry = guideMotionGeometry(+ { left: 0, top: 48, right: 390, bottom: 844, width: 390, height: 796 },+ { left: 280, top: 600, right: 304, bottom: 624, width: 24, height: 24 },+ 104,+ { left: 64, top: 17, right: 133, bottom: 34, width: 69, height: 17 },+ )++ expect(geometry).toMatchObject({+ startX: 149,+ startY: 17,+ controlX: 240.7,+ controlY: 162.75,+ control2X: 264.28,+ control2Y: 279.35,+ endX: 280,+ endY: 600,+ })+ expect(geometry.startX + 104).toBeLessThanOrEqual(390)+ expect(geometry.startY).toBeGreaterThanOrEqual(0)+ })+it("waits for two animation frames so the empty state paints before motion starts", () => {const frames = new Map<number, FrameRequestCallback>()let nextFrame = 0diff --git a/src/web/src/components/community/machines/guide-me-avatar-motion.tsx b/src/web/src/components/community/machines/guide-me-avatar-motion.tsxindex 362932c71..927ba030c 100644--- a/src/web/src/components/community/machines/guide-me-avatar-motion.tsx+++ b/src/web/src/components/community/machines/guide-me-avatar-motion.tsx@@ -42,15 +42,24 @@ export function guideMotionGeometry(stage: Rect,landing: Rect,avatarSize: number,+ source?: Rect,): GuideMotionGeometry {+ const sourceGap = 16const sideInset = Math.min(96, Math.max(24, stage.width * 0.08))const bottomInset = Math.min(64, Math.max(24, stage.height * 0.1))- const startX = stage.left + sideInset- const startY = stage.bottom - avatarSize - bottomInset+ const startX = source+ ? Math.min(stage.right - avatarSize - sourceGap, source.right + sourceGap)+ : stage.left + sideInset+ const startY = source+ ? Math.min(+ stage.bottom - avatarSize - sourceGap,+ Math.max(sourceGap, source.top),+ )+ : stage.bottom - avatarSize - bottomInsetconst endX = landing.leftconst endY = landing.topconst distanceX = endX - startX- const distanceY = startY - endY+ const distanceY = endY - startYconst arcLift = Math.min(180, Math.max(72, Math.abs(distanceX) * 0.28))const mobile = avatarSize < 128@@ -58,11 +67,15 @@ export function guideMotionGeometry(startX,startY,controlX: mobile ? startX + distanceX * 0.7 : startX + distanceX * 0.52,- controlY: mobile- ? startY - distanceY * 0.26- : Math.min(startY, endY) - arcLift,+ controlY: source+ ? startY + distanceY * (mobile ? 0.25 : 0.12)+ : mobile+ ? startY + distanceY * 0.26+ : Math.min(startY, endY) - arcLift,control2X: mobile ? startX + distanceX * 0.88 : undefined,- control2Y: mobile ? startY - distanceY * 0.42 : undefined,+ control2Y: mobile+ ? startY + distanceY * (source ? 0.45 : 0.42)+ : undefined,endX,endY,endScale: landing.width / avatarSize,@@ -70,6 +83,26 @@ export function guideMotionGeometry(}}+function visibleGuideSource(): HTMLElement | null {+ const candidates = document.querySelectorAll<HTMLElement>(+ `[data-testid="${tid.machineGuideIntroSource}"]`,+ )+ for (const candidate of candidates) {+ const rect = candidate.getBoundingClientRect()+ if (+ rect.width > 0 &&+ rect.height > 0 &&+ rect.right > 0 &&+ rect.bottom > 0 &&+ rect.left < window.innerWidth &&+ rect.top < window.innerHeight+ ) {+ return candidate+ }+ }+ return null+}+export function guideMotionPath(geometry: GuideMotionGeometry): string {if (geometry.control2X !== undefined && geometry.control2Y !== undefined) {return `path("M ${geometry.startX} ${geometry.startY} C ${geometry.controlX} ${geometry.controlY}, ${geometry.control2X} ${geometry.control2Y}, ${geometry.endX} ${geometry.endY}")`@@ -105,10 +138,12 @@ export function GuideMeAvatarMotion({let reducedTimer: number | undefinedconst cancelStablePaint = scheduleAfterStablePaint(() => {const avatarSize = avatar.getBoundingClientRect().width+ const source = visibleGuideSource()const geometry = guideMotionGeometry(stage.getBoundingClientRect(),landing.getBoundingClientRect(),avatarSize,+ source?.getBoundingClientRect(),)avatar.style.offsetPath = guideMotionPath(geometry)avatar.style.setProperty("--guide-end-scale", String(geometry.endScale))diff --git a/src/web/src/components/community/machines/machine-list.tsx b/src/web/src/components/community/machines/machine-list.tsxindex 00470f2e7..e8c479488 100644--- a/src/web/src/components/community/machines/machine-list.tsx+++ b/src/web/src/components/community/machines/machine-list.tsx@@ -77,7 +77,12 @@ function machineBackBar(onBack?: () => void, reserveBackSlot = false) {) : (<Skeleton data-slot="loading-back-placeholder" aria-hidden className="size-8 shrink-0 rounded-md" />)}- <span className="ml-1 truncate text-base font-semibold">Machines</span>+ <span+ data-testid={tid.machineGuideIntroSource}+ className="ml-1 truncate text-base font-semibold"+ >+ Machines+ </span></header>) : null}diff --git a/src/web/src/components/home/landing-content.test.ts b/src/web/src/components/home/landing-content.test.tsindex 57d137911..31d512e23 100644--- a/src/web/src/components/home/landing-content.test.ts+++ b/src/web/src/components/home/landing-content.test.ts@@ -29,7 +29,7 @@ describe("landing content contract", () => {expect(LANDING_HERO).toMatchObject({headlineLead: "Share your agents",headlineTail: "with people you trust.",- loggedOutCta: "Start sharing",+ loggedOutCta: "Get started",loggedInCta: "Open Alook",secondaryCta: "See how it works",})diff --git a/src/web/src/components/home/landing-content.ts b/src/web/src/components/home/landing-content.tsindex 2dc4a0c4e..a66986194 100644--- a/src/web/src/components/home/landing-content.ts+++ b/src/web/src/components/home/landing-content.ts@@ -23,7 +23,7 @@ export const LANDING_HERO = {headlineTail: "with people you trust.",subline:"Bring AI agents running on your machine into a shared room, give your team a way to collaborate with them directly — a Discord-style workspace.",- loggedOutCta: "Start sharing",+ loggedOutCta: "Get started",loggedInCta: "Open Alook",secondaryCta: "See how it works",} as constdiff --git a/src/web/src/lib/community/testids.ts b/src/web/src/lib/community/testids.tsindex 3a692b483..aeed0c7b7 100644--- a/src/web/src/lib/community/testids.ts+++ b/src/web/src/lib/community/testids.ts@@ -56,6 +56,7 @@ export const tid = {inviteCard: (token: string) => `community-invite-card-${token}`,inviteCardAction: (token: string) => `community-invite-card-action-${token}`,machinePairOpen: "community-machine-pair-open",+ machineGuideIntroSource: "machine-guide-intro-source",machineFirstSignupGuide: "machine-first-signup-guide",machineGuideAvatarTarget: "machine-guide-avatar-target",machinePairCommand: "community-machine-pair-command",diff --git a/src/web/src/test/e2e-ui/31-machine-guide-motion.spec.ts b/src/web/src/test/e2e-ui/31-machine-guide-motion.spec.tsindex a361c6423..fe5098576 100644--- a/src/web/src/test/e2e-ui/31-machine-guide-motion.spec.ts+++ b/src/web/src/test/e2e-ui/31-machine-guide-motion.spec.ts@@ -1,172 +1,162 @@import { test, expect } from "./_fixtures/community-fixture"import { tid } from "./_fixtures/testids"-test("first-signup mobile guide clears the empty-state actions across the full flight", async ({ browser }) => {- const context = await browser.newContext({ viewport: { width: 390, height: 844 } })- const page = await context.newPage()+for (const viewport of [+ { name: "mobile", width: 390, height: 844, sourceTag: "SPAN" },+ { name: "desktop", width: 1280, height: 800, sourceTag: "BUTTON" },+]) {+ test(`first-signup ${viewport.name} guide travels from beside Machines into the orbit`, async ({ browser }) => {+ const context = await browser.newContext({+ viewport: { width: viewport.width, height: viewport.height },+ })+ const page = await context.newPage()- try {- await page.goto("/sign-in")- await page.getByRole("textbox", { name: "Email" }).fill(- `guide-motion-${process.pid}-${Date.now()}@example.com`,- )- await page.getByRole("button", { name: "Sign in", exact: true }).click()- await page.waitForURL("**/c/me/machines", { waitUntil: "commit" })- await expect(page.getByRole("heading", { name: "No machines yet" })).toBeVisible()+ try {+ await page.goto("/sign-in")+ await page.getByRole("textbox", { name: "Email" }).fill(+ `guide-motion-${viewport.name}-${process.pid}-${Date.now()}@example.com`,+ )+ await page.getByRole("button", { name: "Sign in", exact: true }).click()+ await page.waitForURL("**/c/me/machines", { waitUntil: "commit" })+ await expect(page.getByRole("heading", { name: "No machines yet" })).toBeVisible()- await page.waitForFunction(- ({ travellerId, scaleAnimationName }) => {+ await page.waitForFunction(+ ({ travellerId, scaleAnimationName }) => {+ const traveller = document.querySelector(`[data-testid="${travellerId}"]`)+ const scale = traveller?.querySelector(".community-first-signup-guide-scale")+ return Boolean(+ traveller?.getAnimations().some(+ (animation) => animation instanceof CSSAnimation &&+ animation.animationName === "community-first-signup-guide-travel",+ ) && scale?.getAnimations().some(+ (animation) => animation instanceof CSSAnimation &&+ animation.animationName === scaleAnimationName,+ ),+ )+ },+ {+ travellerId: tid.machineFirstSignupGuide,+ scaleAnimationName: viewport.name === "mobile"+ ? "community-first-signup-guide-scale-mobile"+ : "community-first-signup-guide-scale",+ },+ )++ const report = await page.evaluate(({+ travellerId,+ targetId,+ sourceId,+ scaleAnimationName,+ }) => {const traveller = document.querySelector(`[data-testid="${travellerId}"]`)const scale = traveller?.querySelector(".community-first-signup-guide-scale")- return Boolean(- traveller?.getAnimations().some(- (animation) => animation instanceof CSSAnimation &&- animation.animationName === "community-first-signup-guide-travel",- ) && scale?.getAnimations().some(- (animation) => animation instanceof CSSAnimation &&- animation.animationName === scaleAnimationName,- ),- )- },- {- travellerId: tid.machineFirstSignupGuide,- scaleAnimationName: "community-first-signup-guide-scale-mobile",- },- )-- const report = await page.evaluate(({ travellerId, targetId }) => {- const traveller = document.querySelector(`[data-testid="${travellerId}"]`)- const scale = traveller?.querySelector(".community-first-signup-guide-scale")- const target = document.querySelector(`[data-testid="${targetId}"]`)- const connect = [...document.querySelectorAll("button")].find(- (button) => button.textContent?.trim() === "Connect a machine",- )- const guide = [...document.querySelectorAll("button")].find(- (button) => button.textContent?.trim() === "Guide me",- )- const copy = [...document.querySelectorAll("p")].find((element) =>- element.textContent?.includes("your bots run on it always-on"),- )- if (- !(traveller instanceof HTMLElement) ||- !(scale instanceof HTMLElement) ||- !(target instanceof HTMLElement) ||- !(connect instanceof HTMLElement) ||- !(guide instanceof HTMLElement) ||- !(copy instanceof HTMLElement)- ) {- throw new Error("mobile guide geometry targets are missing")- }+ const target = document.querySelector(`[data-testid="${targetId}"]`)+ const source = [...document.querySelectorAll(`[data-testid="${sourceId}"]`)]+ .find((element) => {+ const value = element.getBoundingClientRect()+ return value.width > 0 && value.height > 0 &&+ value.right > 0 && value.bottom > 0 &&+ value.left < innerWidth && value.top < innerHeight+ })+ if (+ !(traveller instanceof HTMLElement) ||+ !(scale instanceof HTMLElement) ||+ !(target instanceof HTMLElement) ||+ !(source instanceof HTMLElement)+ ) {+ throw new Error("guide motion geometry targets are missing")+ }- const travelAnimation = traveller.getAnimations().find(- (animation) => animation instanceof CSSAnimation &&- animation.animationName === "community-first-signup-guide-travel",- )- const scaleAnimation = scale.getAnimations().find(- (animation) => animation instanceof CSSAnimation &&- animation.animationName === "community-first-signup-guide-scale-mobile",- )- if (!travelAnimation || !scaleAnimation) {- throw new Error("mobile guide animations are missing")- }- travelAnimation.pause()- scaleAnimation.pause()+ const travelAnimation = traveller.getAnimations().find(+ (animation) => animation instanceof CSSAnimation &&+ animation.animationName === "community-first-signup-guide-travel",+ )+ const scaleAnimation = scale.getAnimations().find(+ (animation) => animation instanceof CSSAnimation &&+ animation.animationName === scaleAnimationName,+ )+ if (!travelAnimation || !scaleAnimation) {+ throw new Error("guide motion animations are missing")+ }+ travelAnimation.pause()+ scaleAnimation.pause()- const rect = (element: Element) => {- const value = element.getBoundingClientRect()- return {- left: value.left,- top: value.top,- right: value.right,- bottom: value.bottom,- width: value.width,- height: value.height,+ const rect = (element: Element) => {+ const value = element.getBoundingClientRect()+ return {+ left: value.left,+ top: value.top,+ right: value.right,+ bottom: value.bottom,+ width: value.width,+ height: value.height,+ }}- }- const overlapArea = (- a: ReturnType<typeof rect>,- b: ReturnType<typeof rect>,- ) => Math.max(0, Math.min(a.right, b.right) - Math.max(a.left, b.left)) *- Math.max(0, Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top))- const connectRect = rect(connect)- const guideRect = rect(guide)- const copyRect = rect(copy)- const targetRect = rect(target)- const violations = {- connect: [] as number[],- largeClearance: [] as number[],- viewport: [] as number[],- scaleIncrease: [] as number[],- }- let previousSize = Number.POSITIVE_INFINITY- let minLargeClearance = Number.POSITIVE_INFINITY- let maxBottom = Number.NEGATIVE_INFINITY- let finalRect = rect(scale)+ // 7.5% is the first fully visible frame, after the short fade-in.+ travelAnimation.currentTime = 300+ scaleAnimation.currentTime = 300+ const sourceRect = rect(source)+ const startRect = rect(scale)- // The flight occupies 67.5%–97.5% of the 4s animation. Sampling 401- // points covers both endpoints and every 0.25% increment of the flight.- for (let index = 0; index <= 400; index += 1) {- const progress = index / 400- const currentTime = 2700 + progress * 1200- travelAnimation.currentTime = currentTime- scaleAnimation.currentTime = currentTime+ const violations = {+ viewport: [] as number[],+ scaleIncrease: [] as number[],+ }+ let previousSize = Number.POSITIVE_INFINITY+ let finalRect = startRect- const avatarRect = rect(scale)- const connectOverlap = overlapArea(avatarRect, connectRect)- const guideOverlap = overlapArea(avatarRect, guideRect)- const clearance = avatarRect.top - Math.max(connectRect.bottom, guideRect.bottom, copyRect.bottom)+ // The flight occupies 67.5%–97.5% of the 4s animation. Sampling 401+ // points covers both endpoints and every 0.25% increment of the flight.+ for (let index = 0; index <= 400; index += 1) {+ const progress = index / 400+ const currentTime = 2700 + progress * 1200+ travelAnimation.currentTime = currentTime+ scaleAnimation.currentTime = currentTime- if (connectOverlap > 0.01) violations.connect.push(index)- if (avatarRect.width > 32) {- minLargeClearance = Math.min(minLargeClearance, clearance)- if (clearance < 8 || guideOverlap > 0.01) {- violations.largeClearance.push(index)+ const avatarRect = rect(scale)+ if (+ avatarRect.left < -0.01 ||+ avatarRect.top < -0.01 ||+ avatarRect.right > innerWidth + 0.01 ||+ avatarRect.bottom > innerHeight + 0.01+ ) {+ violations.viewport.push(index)}- }- if (- avatarRect.left < -0.01 ||- avatarRect.top < -0.01 ||- avatarRect.right > innerWidth + 0.01 ||- avatarRect.bottom > innerHeight + 0.01- ) {- violations.viewport.push(index)- }- if (avatarRect.width > previousSize + 0.01) {- violations.scaleIncrease.push(index)+ if (avatarRect.width > previousSize + 0.01) {+ violations.scaleIncrease.push(index)+ }++ previousSize = avatarRect.width+ finalRect = avatarRect}- previousSize = avatarRect.width- maxBottom = Math.max(maxBottom, avatarRect.bottom)- finalRect = avatarRect- }+ return {+ sourceTag: source.tagName,+ startGap: startRect.left - sourceRect.right,+ startTopDelta: startRect.top - sourceRect.top,+ violations,+ finalRect,+ targetRect: rect(target),+ }+ }, {+ travellerId: tid.machineFirstSignupGuide,+ targetId: tid.machineGuideAvatarTarget,+ sourceId: tid.machineGuideIntroSource,+ scaleAnimationName: viewport.name === "mobile"+ ? "community-first-signup-guide-scale-mobile"+ : "community-first-signup-guide-scale",+ })- return {- sampleCount: 401,- violations,- minLargeClearance,- maxBottom,- finalRect,- targetRect,+ expect(report.sourceTag).toBe(viewport.sourceTag)+ expect(report.startGap).toBeCloseTo(16, 1)+ expect(Math.abs(report.startTopDelta)).toBeLessThanOrEqual(8)+ expect(report.violations).toEqual({ viewport: [], scaleIncrease: [] })+ for (const key of ["left", "top", "right", "bottom", "width", "height"] as const) {+ expect(report.finalRect[key]).toBeCloseTo(report.targetRect[key], 4)}- }, {- travellerId: tid.machineFirstSignupGuide,- targetId: tid.machineGuideAvatarTarget,- })-- expect(report.sampleCount).toBe(401)- expect(report.violations).toEqual({- connect: [],- largeClearance: [],- viewport: [],- scaleIncrease: [],- })- expect(report.minLargeClearance).toBeGreaterThanOrEqual(8)- expect(report.maxBottom).toBeLessThanOrEqual(844)- for (const key of ["left", "top", "right", "bottom", "width", "height"] as const) {- expect(report.finalRect[key]).toBeCloseTo(report.targetRect[key], 4)+ } finally {+ await context.close()}- } finally {- await context.close()- }-})+ })+}