Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Calm, minimal Cloud plans sheet and Cloud Pro popup (#3723)
Milind Soni1bc8c38859ef
diff --git a/docs/cloud-pro.md b/docs/cloud-pro.mdindex f7c886d187..04c9f7a959 100644--- a/docs/cloud-pro.md+++ b/docs/cloud-pro.md@@ -2023,23 +2023,27 @@ screen's note.the menu is.- **The dialog** (`components/CloudAddDialog.tsx`, one state→view function,`lib/cloud-plan` `cloudAddView`) covers the buying journey only: the offer- (one card per plan the Admin sells, side by side on a wide sheet and- stacked in a narrow window, from `lib/cloud-plan` `planCards`: its name,- "Most popular" on the Admin's recommended plan only, the price per month,- its promise, its own button (Start free trial, or Get {plan} without a- trial) with its terms in one line under it, then the same rows in the same- order on every card in the website's words (with the app's "cloud+ (MausBot Cloud's name beside its three mascots and one line, then one card+ per plan the Admin sells, side by side on a wide sheet and stacked in a+ narrow window, from `lib/cloud-plan` `planCards`: its name, "Most popular"+ as a quiet tag on the Admin's recommended plan only, the price per month,+ its promise, and only what sets the plans apart (`cardRows`): the month's+ cloud desktop hours, storage and what it grows to, voice, and sleeping+ when the plans differ there; then its own button (Start free trial, or+ Get {plan} without a trial; the recommended plan's is the one primary+ pill) with its terms in one line under it. **Compare plans** opens the+ rest of every card's rows, in the website's words (with the app's "clouddesktop" for the website's "cloud computer"), every number from theAdmin's `allowances`: always on (or sleeping), cloud desktops as many as- the bots need (how many at once only as small print), the month's hours,- CPUs and memory (swap as small print), storage and what it grows to,- voice, and daily backups' days. The card of the plan the account already- has says **Your plan** instead of a button (`current`, from the verified- entitlement's tier); a plan no longer on sale, such as a Personal- subscriber's, shows only for that subscriber when the screen is given it- (`own`). Under the cards, when every plan has the same trial, the trial's- timeline with the reminder line only while the Admin sends one, and the- Claude credit; money-back; prices plus tax. No launch or struck-through+ the bots need (how many at once only as small print), CPUs and memory+ (swap as small print), and daily backups' days. The card of the plan the+ account already has says **Your plan** instead of a button (`current`,+ from the verified entitlement's tier); a plan no longer on sale, such as a+ Personal subscriber's, shows only for that subscriber when the screen is+ given it (`own`). Under the cards, when every plan has the same trial, the+ trial's timeline with the reminder line only while the Admin sends one,+ and the Claude credit; money-back; what every plan includes, once; prices+ plus tax. No launch or struck-throughprice: the Admin's `regularAmount` is not read), the sign-in (its last stepnames the checkout only when the sign-in is on the way to one), the nextstep in the browser (the checkout open there, or, signed in on the way todiff --git a/docs/verification/evidence/pricing-clean/all-states-daylight.jpg b/docs/verification/evidence/pricing-clean/all-states-daylight.jpgnew file mode 100644index 0000000000..6ca6e0373eBinary files /dev/null and b/docs/verification/evidence/pricing-clean/all-states-daylight.jpg differdiff --git a/docs/verification/evidence/pricing-clean/all-states-midnight.jpg b/docs/verification/evidence/pricing-clean/all-states-midnight.jpgnew file mode 100644index 0000000000..4eade2d0faBinary files /dev/null and b/docs/verification/evidence/pricing-clean/all-states-midnight.jpg differdiff --git a/docs/verification/evidence/pricing-clean/choose-1040-midnight.jpg b/docs/verification/evidence/pricing-clean/choose-1040-midnight.jpgnew file mode 100644index 0000000000..064fcb9684Binary files /dev/null and b/docs/verification/evidence/pricing-clean/choose-1040-midnight.jpg differdiff --git a/docs/verification/evidence/pricing-clean/choose-compare-midnight.jpg b/docs/verification/evidence/pricing-clean/choose-compare-midnight.jpgnew file mode 100644index 0000000000..f1e7c1d70eBinary files /dev/null and b/docs/verification/evidence/pricing-clean/choose-compare-midnight.jpg differdiff --git a/docs/verification/evidence/pricing-clean/choose-current-personal-midnight.jpg b/docs/verification/evidence/pricing-clean/choose-current-personal-midnight.jpgnew file mode 100644index 0000000000..5213c76241Binary files /dev/null and b/docs/verification/evidence/pricing-clean/choose-current-personal-midnight.jpg differdiff --git a/docs/verification/evidence/pricing-clean/choose-current-pro-daylight.jpg b/docs/verification/evidence/pricing-clean/choose-current-pro-daylight.jpgnew file mode 100644index 0000000000..06024e132dBinary files /dev/null and b/docs/verification/evidence/pricing-clean/choose-current-pro-daylight.jpg differdiff --git a/docs/verification/evidence/pricing-clean/choose-daylight.jpg b/docs/verification/evidence/pricing-clean/choose-daylight.jpgnew file mode 100644index 0000000000..2d6ddeeedeBinary files /dev/null and b/docs/verification/evidence/pricing-clean/choose-daylight.jpg differdiff --git a/docs/verification/evidence/pricing-clean/choose-de-1040-daylight.jpg b/docs/verification/evidence/pricing-clean/choose-de-1040-daylight.jpgnew file mode 100644index 0000000000..f06989ea8bBinary files /dev/null and b/docs/verification/evidence/pricing-clean/choose-de-1040-daylight.jpg differdiff --git a/docs/verification/evidence/pricing-clean/choose-midnight.jpg b/docs/verification/evidence/pricing-clean/choose-midnight.jpgnew file mode 100644index 0000000000..102ace4094Binary files /dev/null and b/docs/verification/evidence/pricing-clean/choose-midnight.jpg differdiff --git a/docs/verification/evidence/pricing-clean/pay-midnight.jpg b/docs/verification/evidence/pricing-clean/pay-midnight.jpgnew file mode 100644index 0000000000..45e9bbd27eBinary files /dev/null and b/docs/verification/evidence/pricing-clean/pay-midnight.jpg differdiff --git a/docs/verification/evidence/pricing-clean/pro-popup-daylight.jpg b/docs/verification/evidence/pricing-clean/pro-popup-daylight.jpgnew file mode 100644index 0000000000..a8d034adc1Binary files /dev/null and b/docs/verification/evidence/pricing-clean/pro-popup-daylight.jpg differdiff --git a/docs/verification/evidence/pricing-clean/pro-popup-midnight.jpg b/docs/verification/evidence/pricing-clean/pro-popup-midnight.jpgnew file mode 100644index 0000000000..9afed66ca2Binary files /dev/null and b/docs/verification/evidence/pricing-clean/pro-popup-midnight.jpg differdiff --git a/docs/verification/evidence/pricing-clean/ready-midnight.jpg b/docs/verification/evidence/pricing-clean/ready-midnight.jpgnew file mode 100644index 0000000000..af97b03e42Binary files /dev/null and b/docs/verification/evidence/pricing-clean/ready-midnight.jpg differdiff --git a/docs/verification/evidence/pricing-clean/sign-in-email-daylight.jpg b/docs/verification/evidence/pricing-clean/sign-in-email-daylight.jpgnew file mode 100644index 0000000000..8ca29a8cc0Binary files /dev/null and b/docs/verification/evidence/pricing-clean/sign-in-email-daylight.jpg differdiff --git a/src/cloud-buy-preview.tsx b/src/cloud-buy-preview.tsxindex c4a9123d17..1d05e19438 100644--- a/src/cloud-buy-preview.tsx+++ b/src/cloud-buy-preview.tsx@@ -1,11 +1,15 @@-// Dev-only gallery of the Cloud buying sheet, served at /cloud-buy-preview.html; not in the packaged app.-// ?state=choose|sign-in-email|sign-in-code|sign-in-sso|pay|pay-late|setup|ready|has-cloud|team-setup|team-ready|unreachable&skin=midnight&staging=1&reduced=1&plan=starter&lang=de+// Dev-only gallery of the Cloud buying sheet and the Cloud Pro popup, served at /cloud-buy-preview.html; not in the packaged app.+// ?state=choose|choose-plain|sign-in-email|sign-in-code|sign-in-wrong|sign-in-sso|sign-in-done|sign-in-browser|pay|pay-late|setup|setup-slow|ready|has-cloud+// |team-setup|team-ready|unreachable|pro-popup|pro-popup-plain|pro-popup-plan|pro-popup-reauth+// &skin=midnight&staging=1&reduced=1&plan=starter&lang=de// ¤t=pro (a subscriber's own plan says Your plan; current=personal shows a Personal subscriber's own card)import { StrictMode } from "react";import { createRoot } from "react-dom/client";import { Cloud, FolderOpen, MessageSquare, Repeat } from "lucide-react";+import type { CloudAccountState } from "../electron/cloud-account.mjs";import type { CloudOffer } from "../electron/cloud-home.mjs";import { CloudAddPanel, CloudAddSheet, type CloudAddActions, type CloudAddUi } from "@/components/CloudAddDialog";+import { CloudProPopup, cloudProPopupView } from "@/components/CloudProPopup";import { ChooseScreen } from "@/components/cloud-buy/ChooseScreen";import type { CloudAddView } from "@/lib/cloud-plan";import { setLocale } from "@/lib/i18n";@@ -20,25 +24,36 @@ const OFFER: CloudOffer = { recommended: "pro", creditUsd: 5, reminderDays: 1, r{ tier: "pro", label: "Pro", amount: 4900, trialDays: 3, allowances: allowances(4, 4, 100, 15, 300, 60_000, 14) },{ tier: "max", label: "Max", amount: 9900, trialDays: 3, allowances: allowances(8, 4, 100, 15, 800, 180_000, 14) },] };+const PLAIN: CloudOffer = { recommended: "pro", refundDays: 14, plans: OFFER.plans.map(({ trialDays: _days, ...plan }) => plan) };const PERSONAL = { tier: "personal", label: "Personal", amount: 2900, allowances: allowances(2, 3, 20, 15, 100, 30_000, 14) };const started = { tier: "pro", trial: { state: "active" as const, tier: "pro", endsAt: NOW + 3 * DAY, amount: 4900, chargeAt: NOW + 3 * DAY, holdUntil: null, deleteAt: null, keep: "none" as const },credit: { grantedUsd: 5, remainingUsd: 5, state: "active" as const } };const VIEWS: Record<string, CloudAddView> = {choose: { kind: "offer", offer: OFFER, signedOut: true, notice: null },+ "choose-plain": { kind: "offer", offer: PLAIN, signedOut: false, notice: null },"sign-in-email": { kind: "sign-in", phase: { step: "email", intent: true, problem: null } },"sign-in-code": { kind: "sign-in", phase: { step: "code", intent: true, email: "[email protected]", resendAt: NOW + 21_000, problem: null, triesLeft: null } },"sign-in-wrong": { kind: "sign-in", phase: { step: "code", intent: true, email: "[email protected]", resendAt: NOW - 1, problem: "wrong-code", triesLeft: 3 } },"sign-in-sso": { kind: "sign-in", phase: { step: "email", intent: true, problem: "sso" } },"sign-in-done": { kind: "sign-in", phase: { step: "done", intent: true } },+ "sign-in-browser": { kind: "signing-in", code: "KQWX-7RTM", checkout: true },pay: { kind: "waiting", plan: "pro", browser: "checkout", late: false, link: true, email: "[email protected]" },"pay-late": { kind: "waiting", plan: "pro", browser: "checkout", late: true, link: true, email: "[email protected]" },setup: { kind: "starting", ...started, step: "storage", slow: false, received: false },+ "setup-slow": { kind: "starting", ...started, step: "starting", slow: true, received: false },ready: { kind: "ready", ...started },"has-cloud": { kind: "has-cloud" },"team-setup": { kind: "team-starting", team: "Acme", step: "storage", slow: false },"team-ready": { kind: "team-ready", team: { id: "team-acme", name: "Acme" } },unreachable: { kind: "unreachable" },};+const FREE: CloudAccountState = { status: "connected", account: { id: "a", email: "[email protected]" }, entitlement: { plan: "free", status: "inactive", expiresAt: null, version: 1 } };+const POPUPS: Record<string, { account: CloudAccountState; offer: CloudOffer }> = {+ "pro-popup": { account: { status: "signed-out" }, offer: OFFER },+ "pro-popup-plain": { account: FREE, offer: PLAIN },+ "pro-popup-plan": { account: { ...FREE, entitlement: { plan: "pro", tier: "pro", status: "active", expiresAt: NOW + 30 * DAY, version: 2 } }, offer: OFFER },+ "pro-popup-reauth": { account: { status: "reauth-required", message: "expired", lastPlan: { tier: "pro", active: true } }, offer: OFFER },+};const noop = () => {};const actions = new Proxy({}, { get: () => noop }) as CloudAddActions;@@ -65,9 +80,16 @@ function Preview() {if (params.get("reduced") === "1") document.documentElement.dataset.reducedMotion = "true";setLocale(params.get("lang") ?? "en");const state = params.get("state") ?? "choose";+ const asked = POPUPS[state], popup = asked ? cloudProPopupView(asked.account, asked.offer) : null;+ if (popup && typeof popup === "object") {+ return <div className="relative h-screen overflow-hidden">+ <MockApp />+ <CloudProPopup view={popup} onPrimary={noop} onSeePlans={noop} onNotNow={noop} onClose={noop} />+ </div>;+ }const view = VIEWS[state] ?? VIEWS.choose!;const current = params.get("current");- const ui: CloudAddUi = { chosen: params.get("plan"), current, offerShown: OFFER, now: NOW, busy: state === "sign-in-done", openFailed: false,+ const ui: CloudAddUi = { chosen: params.get("plan"), current, offerShown: view.kind === "offer" ? view.offer : OFFER, now: NOW, busy: state === "sign-in-done", openFailed: false,email: "[email protected]", code: state === "sign-in-code" ? "4820" : "", profileEmail: "[email protected]",look: { typed: "My Cloud", name: "My Cloud", color: "blue" }, counting: state === "ready" ? 3 : null, copied: false, payFailed: false, interest: null };return <div className="relative h-screen overflow-hidden">diff --git a/src/components/AppNotices.test.ts b/src/components/AppNotices.test.tsindex c98e8b2123..2d33d95f33 100644--- a/src/components/AppNotices.test.ts+++ b/src/components/AppNotices.test.ts@@ -26,6 +26,7 @@ vi.mock("@/state/store", () => ({ useStore: () => ({ state: f.state, dispatch: fCLOUD_LINK_SETTINGS: { type: "toggleAppSettings", open: true, section: "cloudAccount", cloudLink: true } }));vi.mock("@/lib/analytics", () => ({ emailGateDone: () => false, track: vi.fn(), identifyEmail: vi.fn(), analyticsChoiceKnown: () => true }));vi.mock("@/lib/updater", () => ({ useUpdaterState: () => f.updater }));+vi.mock("./cloud-buy/CloudMascots", () => ({ CloudMascots: () => null }));// Who MausBot belongs to: unknown (as before the session answers) unless a test says otherwise.vi.mock("@/lib/default-bot", async original => ({ ...await original<typeof import("@/lib/default-bot")>(), useViewerEmail: () => f.viewerEmail }));vi.mock("@/lib/brand", () => ({ brandStatus: () => ({ brand: { name: "OpenMausBot" }, source: f.brand, file: "" }) }));diff --git a/src/components/CloudAddDialog.test.ts b/src/components/CloudAddDialog.test.tsindex f7197e8175..df7551ac75 100644--- a/src/components/CloudAddDialog.test.ts+++ b/src/components/CloudAddDialog.test.ts@@ -16,7 +16,7 @@ vi.mock("react", async original => ({ ...await original<typeof import("react")>(}));vi.mock("@/state/store", () => ({ useStore: () => ({ state: f.state, dispatch: f.dispatch }) }));vi.mock("@/lib/analytics", () => ({ track: vi.fn() }));-vi.mock("./cloud-buy/CloudMascotScene", () => ({ CloudMascotScene: ({ variant }: { variant: string }) => createElement("div", { "data-cloud-scene": variant }) }));+vi.mock("./cloud-buy/CloudMascots", () => ({ CloudMascots: () => createElement("i", { "data-cloud-mascots": "" }) }));import { CloudAddDialog, CloudAddPanel, CloudAddSheet, type CloudAddActions, type CloudAddUi } from "./CloudAddDialog";import { ChooseScreen } from "./cloud-buy/ChooseScreen";import { cloudAddView, type CloudAddView } from "@/lib/cloud-plan";@@ -75,30 +75,35 @@ beforeEach(() => { vi.clearAllMocks(); setLocale("en"); });afterEach(() => { vi.unstubAllGlobals(); vi.useRealTimers(); setLocale("en"); });describe("each screen of the sheet says one thing and offers one next step", () => {- it("Choose: what Cloud is, then one card per plan with its price, promise, its own button and the same rows; Most popular on the Admin's recommended plan", () => {+ it("Choose: MausBot Cloud in a line, then one card per plan with only what sets it apart and its own button; Most popular on the Admin's recommended plan; the money and what every plan includes once", () => {const { html, tree, handlers } = panel({ kind: "offer", offer: TRIAL, signedOut: true, notice: null });- const rows = (hours: number, cpus: string, swap: number, max: number, voice: string) => ["Always on, around the clock", "Cloud desktops: as many as your bots need",- "Fair use: up to 15 at once", `${hours} cloud desktop hours a month`, `${cpus} · ${cpus === "2 shared CPUs" ? 2 : cpus === "4 shared CPUs" ? 4 : 8} GB memory`, `Plus ${swap} GB of swap`,- `10 GB storage, grows to ${max} GB`, `Voice replies: ${voice}`, "Daily backups, kept 14 days"];- inOrder(text(html), ["MausBot Cloud", "Your bots, always on.", "Runs your bots 24/7 in the cloud, even when this computer is off.",- "Works while you're away", "Private to you", "Reach it from anywhere", "A real browser and desktop", "Bring everything over", "Choose your plan",- "Starter", "$15", "/month", "Your bots keep working with your laptop closed, at the lowest price.", "Start free trial", "Free for 7 days, then $15/month + tax",- ...rows(100, "2 shared CPUs", 3, 20, "about 30 minutes of speech a month"),- "Pro", "Most popular", "$49", "/month", "Your bots keep working 24/7, even when your laptop is closed.", "Start free trial", "Free for 7 days, then $49/month + tax",- ...rows(300, "4 shared CPUs", 4, 100, "about an hour of speech a month"),- "Max", "$99", "/month", "The biggest cloud machine, for bots that use computers all day.", "Start free trial", "Free for 7 days, then $99/month + tax",- ...rows(800, "8 shared CPUs", 4, 100, "about 3 hours of speech a month"),- "Card needed, nothing charged until your trial ends. Cancel in the app any time.",+ const card = (hours: number, max: number, voice: string, cpus: number, swap: number) => [`${hours} cloud desktop hours a month`, `10 GB storage, grows to ${max} GB`,+ `Voice replies: ${voice}`, "Always on, around the clock", "Cloud desktops: as many as your bots need", "Fair use: up to 15 at once", `${cpus} shared CPUs · ${cpus} GB memory`,+ `Plus ${swap} GB of swap`, "Daily backups, kept 14 days", "Start free trial"];+ inOrder(text(html), ["MausBot Cloud", "Your bots, always on.", "Runs your bots 24/7 in the cloud, even when this computer is off.", "Compare plans", "Choose your plan",+ "Starter", "$15", "/month", "Your bots keep working with your laptop closed, at the lowest price.", ...card(100, 20, "about 30 minutes of speech a month", 2, 3),+ "Free for 7 days, then $15/month + tax",+ "Pro", "Most popular", "$49", "/month", "Your bots keep working 24/7, even when your laptop is closed.", ...card(300, 100, "about an hour of speech a month", 4, 4),+ "Free for 7 days, then $49/month + tax",+ "Max", "$99", "/month", "The biggest cloud machine, for bots that use computers all day.", ...card(800, 100, "about 3 hours of speech a month", 8, 4),+ "Free for 7 days, then $99/month + tax","Today", "Trial starts, with $5 of Claude credit", "Oct 13", "Reminder email", "Oct 15", "First payment",- "Secure checkout in your browser", "Apple Pay", "G Pay", "Card", "Cancel in two clicks", "14-day money-back", "Already have a plan? Sign in"]);- expect(html, "the night shift scene between the lede and the benefits").toMatch(/this computer is off\.<\/p><\/div><div class="[^"]*"><div data-cloud-scene="hero"><\/div><\/div><ul/);+ "Card needed, nothing charged until your trial ends. Cancel in the app any time.", "14-day money-back",+ "Every plan includes", "Works while you're away", "Routines, long jobs and replies keep going around the clock.", "Private to you", "Reach it from anywhere",+ "A real browser and desktop", "Bring everything over", "Your bots, chats and memory move across in about a minute.",+ "Secure checkout in your browser", "Apple Pay", "G Pay", "Card", "Cancel in two clicks", "Already have a plan? Sign in"]);+ expect(html, "the mascots stand before the title").toMatch(/<i data-cloud-mascots=""><\/i><h2 id="cloud-add-title"/);+ expect(html.match(/data-plan-row="(hours|storage|voice)"/g), "what sets the cards apart, three rows on each").toHaveLength(9);+ expect(tree.filter(node => node.props.id?.startsWith?.("cloud-plan-details-")).map(node => node.props.hidden), "the rest waits for Compare plans").toEqual([true, true, true]);+ expect(tree.filter(node => node.props["data-plan-buy"]).map(node => node.props.className.includes("ui-button-primary")), "one primary action, on the recommended plan")+ .toEqual([false, true, false]);expect(html.match(/Most popular/g)).toHaveLength(1);expect(html.match(/data-plan-popular/g)).toHaveLength(1);expect(html.indexOf("data-plan-popular")).toBeGreaterThan(html.indexOf('data-plan="pro"'));expect(html.indexOf("data-plan-popular")).toBeLessThan(html.indexOf('data-plan="max"'));expect(html.match(/data-plan-buy=/g), "one button per card").toHaveLength(3);expect(html).not.toContain("data-plan-mine");- for (const gone of ["Compare plans", "launch", "$89", "Recommended", "AI credit", "this Mac", "a day", "computers at once", "Personal", "$29", "Sleeps", "Everything in",+ for (const gone of ["launch", "$89", "Recommended", "AI credit", "this Mac", "a day", "computers at once", "Personal", "$29", "Sleeps", "Everything in","What Pro gives you", "Due today", "Gmail"]) {expect(text(html)).not.toContain(gone);}@@ -116,12 +121,12 @@ describe("each screen of the sheet says one thing and offers one next step", ()expect(html.indexOf("data-plan-mine")).toBeGreaterThan(html.indexOf('data-plan="pro"'));expect(html.indexOf("data-plan-mine")).toBeLessThan(html.indexOf('data-plan="max"'));expect(tree.filter(node => node.props["data-plan-buy"]).map(node => node.props["data-plan-buy"])).toEqual(["starter", "max"]);- inOrder(text(html), ["Pro", "Most popular", "$49", "Your plan", "Always on, around the clock", "Max"]);+ inOrder(text(html), ["Pro", "Most popular", "$49", "300 cloud desktop hours a month", "Always on, around the clock", "Your plan", "Max"]);expect(text(html)).not.toContain("Free for 7 days, then $49/month + tax");const personal = { ...PLANS[0]!, tier: "personal", label: "Personal", amount: 2900 };const mine = renderToStaticMarkup(createElement(ChooseScreen, { offer: TRIAL, current: "personal", own: personal, now: NOW, busy: false, signedOut: false, notice: null,onStart: vi.fn(), onSignIn: vi.fn() }));- inOrder(text(mine), ["Starter", "$15", "Start free trial", "Personal", "$29", "/month", "Your plan", "100 cloud desktop hours a month", "Pro", "Most popular", "$49", "Start free trial", "Max"]);+ inOrder(text(mine), ["Starter", "$15", "Start free trial", "Personal", "$29", "/month", "100 cloud desktop hours a month", "Your plan", "Pro", "Most popular", "$49", "Start free trial", "Max"]);expect(mine.match(/data-plan-mine/g)).toHaveLength(1);expect(mine.match(/data-plan-buy=/g)).toHaveLength(3);const theirs = renderToStaticMarkup(createElement(ChooseScreen, { offer: TRIAL, current: null, own: personal, now: NOW, busy: false, signedOut: false, notice: null,@@ -308,8 +313,8 @@ describe("each screen of the sheet says one thing and offers one next step", ()const unnamed = text(panel({ kind: "team-starting", team: null, step: null, slow: true }).html);inOrder(unnamed, ["Reserving your machine", "Starting your team's Cloud", "This is taking longer than usual."]);const { html, tree, handlers } = panel({ kind: "team-ready", team: { id: "team-acme", name: "Acme" } });- inOrder(text(html), ["Your team's Cloud is ready", "Acme keeps your team's bots running 24/7, even when this computer is off.", "Open Acme",- "Switch between This computer and Acme from the menu at the top of the sidebar."]);+ inOrder(text(html), ["Your team's Cloud is ready", "Acme keeps your team's bots running 24/7, even when this computer is off.",+ "Switch between This computer and Acme from the menu at the top of the sidebar.", "Open Acme"]);button(tree, "Open Acme")!.props.onClick();expect(handlers.openTeam).toHaveBeenCalledExactlyOnceWith("team-acme"); expect(handlers.openCloud).not.toHaveBeenCalled();expect(text(panel({ kind: "team-ready", team: { id: "team-acme", name: "Acme" } }, { openFailed: true }).html)).toContain("Acme didn't open. Try again in a minute.");@@ -317,7 +322,7 @@ describe("each screen of the sheet says one thing and offers one next step", ()it("the sheet's frame: one width per screen, Close, and a Staging mark only on the staging Admin", () => {const sheet = (kind: CloudAddView["kind"], staging = false) => renderToStaticMarkup(createElement(CloudAddSheet, { kind, staging, onClose: vi.fn(), children: "x" }));- expect(sheet("offer")).toContain("max-w-[900px]"); expect(sheet("starting")).toContain("max-w-[720px]"); expect(sheet("waiting")).toContain("max-w-[540px]");+ expect(sheet("offer")).toContain("max-w-[920px]"); expect(sheet("starting")).toContain("max-w-[720px]"); expect(sheet("waiting")).toContain("max-w-[540px]");expect(sheet("offer")).toContain('aria-label="Close"');expect(sheet("offer"), "above Settings and the welcome flow (z-50), which it opens over").toContain("fixed inset-0 z-[60]");expect(sheet("offer")).not.toContain("data-cloud-staging");@@ -393,6 +398,18 @@ describe("the sheet", () => {expect(track).toHaveBeenCalledWith("cloud_checkout_opened", { plan: "max", trial: true, source: "app_menu" });});+ it("Compare plans shows every card's details and hides them again; a button names the cards it opens", async () => {+ await settle();+ const compare = () => tree().find(node => node.type === "button" && typeof node.props["aria-expanded"] === "boolean")!;+ const hidden = () => tree().filter(node => node.props.id?.startsWith?.("cloud-plan-details-")).map(node => node.props.hidden);+ expect([label(compare()), compare().props["aria-expanded"], hidden()]).toEqual(["Compare plans", false, [true, true, true]]);+ expect(compare().props["aria-controls"]).toBe("cloud-plan-details-starter cloud-plan-details-pro cloud-plan-details-max");+ compare().props.onClick();+ expect([compare().props["aria-expanded"], hidden()]).toEqual([true, [false, false, false]]);+ compare().props.onClick();+ expect([compare().props["aria-expanded"], hidden()]).toEqual([false, [true, true, true]]);+ });+it("the Admin's word that new accounts are closed reaches the code step", async () => {bridge.signInStart.mockResolvedValueOnce({ outcome: "sent", email: EMAIL, expiresAt: NOW + 600_000, resendAt: NOW + 30_000, signupOpen: false });await settle(); await buy("pro");diff --git a/src/components/CloudAddDialog.tsx b/src/components/CloudAddDialog.tsxindex 60eeb9a2f1..f3bf48d20d 100644--- a/src/components/CloudAddDialog.tsx+++ b/src/components/CloudAddDialog.tsx@@ -15,7 +15,7 @@ import { useStore } from "@/state/store";import { ChooseScreen } from "./cloud-buy/ChooseScreen";import { OneCloudScreen, StatusScreen } from "./cloud-buy/OneCloudScreen";import { PayScreen } from "./cloud-buy/PayScreen";-import { StagingMark } from "./cloud-buy/parts";+import { CLOSE, SHEET, StagingMark } from "./cloud-buy/parts";import { SetupScreen, TeamReadyScreen, TeamSetupScreen } from "./cloud-buy/SetupScreen";import { BrowserSignInScreen, codeDigits, SignInScreen } from "./cloud-buy/SignInScreen";@@ -84,18 +84,18 @@ export function CloudAddPanel({ view, ui, actions }: { view: CloudAddView; ui: C}}-const WIDTH: Partial<Record<CloudAddView["kind"], string>> = { offer: "max-w-[900px]", starting: "max-w-[720px]", ready: "max-w-[720px]" };+const WIDTH: Partial<Record<CloudAddView["kind"], string>> = { offer: "max-w-[920px]", starting: "max-w-[720px]", ready: "max-w-[720px]" };/** Mid sign-in, checkout or setup a stray click beside the sheet (say, back from paying in the browser) must not lose it: there only Close and Esc do. */const HELD: ReadonlySet<CloudAddView["kind"]> = new Set(["sign-in", "signing-in", "waiting", "starting", "team-starting"]);/** The sheet over the app: one width per screen, the close button, and the staging mark when the app is on staging.* Above the z-50 layers (Settings, the welcome flow), which it may be opened over. */export function CloudAddSheet({ kind, staging, onClose, children }: { kind: CloudAddView["kind"]; staging: boolean; onClose: () => void; children: ReactNode }) {- return <div className="fixed inset-0 z-[60] flex items-center justify-center bg-black/50 p-4 sm:p-6" onMouseDown={event => event.target === event.currentTarget && !HELD.has(kind) && onClose()}>+ return <div className="ui-scrim fixed inset-0 z-[60] flex items-center justify-center p-4 sm:p-6" onMouseDown={event => event.target === event.currentTarget && !HELD.has(kind) && onClose()}><div role="dialog" aria-modal="true" aria-labelledby="cloud-add-title" data-cloud-add-dialog tabIndex={-1}- className={cn("animate-pop-in relative max-h-full w-full overflow-y-auto overscroll-contain rounded-2xl border border-hairline/70 bg-panel shadow-2xl outline-none", WIDTH[kind] ?? "max-w-[540px]")}>- <button type="button" onClick={onClose} aria-label={t("cloudAdd.close")} className="ui-icon-button absolute end-3.5 top-3.5 z-10"><X size={18} /></button>- {staging && <StagingMark className="absolute end-14 top-[19px] z-10" />}+ className={cn(SHEET, "animate-pop-in relative max-h-full w-full overflow-y-auto overscroll-contain outline-none", WIDTH[kind] ?? "max-w-[540px]")}>+ <button type="button" onClick={onClose} aria-label={t("cloudAdd.close")} className={cn(CLOSE, "absolute end-4 top-4 z-10")}><X size={16} /></button>+ {staging && <StagingMark className="absolute end-14 top-[22px] z-10" />}{children}</div></div>;diff --git a/src/components/CloudProPopup.tsx b/src/components/CloudProPopup.tsxindex 9053c53762..62db16aa06 100644--- a/src/components/CloudProPopup.tsx+++ b/src/components/CloudProPopup.tsx@@ -1,12 +1,15 @@import { useEffect, useState } from "react";-import { Check, Crown, X } from "lucide-react";+import { Check, X } from "lucide-react";import type { CloudAccountState, CloudPlanSnapshot } from "../../electron/cloud-account.mjs";import type { CloudOffer } from "../../electron/cloud-home.mjs";import type { DesktopNoticesBridge, DesktopNoticesState } from "../../electron/desktop-prefs.mjs";import { analyticsChoiceKnown, identifyEmail, track } from "@/lib/analytics";+import { cn } from "@/lib/cn";import { buyOfferAllowed, cloudIntroView, cloudPlanLabel, cloudPlanLine, cloudPlanView, moneyBackLine, trialRunning, usd, type CloudPlanView, type CloudSource } from "@/lib/cloud-plan";import { t } from "@/lib/i18n";import { cloudPlanFromAccount, cloudPlanFromSnapshot, type CloudPlanFacts } from "@/lib/usage-snapshot";+import { CloudMascots } from "./cloud-buy/CloudMascots";+import { CLOSE, PRIMARY, QUIET, SHEET, Tag } from "./cloud-buy/parts";import { NotNowButton } from "./NoticeCard";import { UPDATES_CONSENT_POPUP } from "./UpdatesConsent";@@ -128,8 +131,6 @@ export function useOtherDialogOpen(watch: boolean): boolean {const focusLost = (focus: Element | null) => !focus || focus === document.body || !focus.isConnected;-const PRIMARY = "inline-flex min-h-10 items-center justify-center gap-1.5 rounded-lg bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink hover:opacity-90 disabled:opacity-60 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus";-export function CloudProPopup({ view, onPrimary, onSeePlans, onNotNow, onClose }: {view: CloudProPopupView; onPrimary: () => void; onSeePlans: () => void; onNotNow: () => void; onClose: () => void;}) {@@ -159,34 +160,33 @@ export function CloudProPopup({ view, onPrimary, onSeePlans, onNotNow, onClose }window.addEventListener("keydown", onKey, true);return () => window.removeEventListener("keydown", onKey, true);}, [onClose]);- return <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-6" onMouseDown={event => { if (event.target === event.currentTarget) onClose(); }}>+ return <div className="ui-scrim fixed inset-0 z-50 flex items-center justify-center p-6" onMouseDown={event => { if (event.target === event.currentTarget) onClose(); }}><div role="dialog" aria-modal="true" aria-labelledby={TITLE} aria-describedby="cloud-pro-popup-body" data-cloud-pro-popup={view.plan} tabIndex={-1}- className="relative max-h-full w-full max-w-[440px] overflow-y-auto rounded-2xl border border-hairline/50 bg-panel p-6 text-ink shadow-2xl outline-none">- <div className="flex items-center gap-2.5 pe-8">- <Crown size={18} className="shrink-0 text-accent-text" aria-hidden="true" />- <h2 id={TITLE} tabIndex={-1} className="text-[17px] font-semibold outline-none">{t("cloudProPopup.title")}</h2>+ className={cn(SHEET, "animate-pop-in relative max-h-full w-full max-w-[440px] overflow-y-auto px-6 pb-4 pt-5 outline-none")}>+ <div className="flex min-h-8 flex-wrap items-center gap-x-2.5 gap-y-1 pe-10">+ <CloudMascots size={22} />+ <h2 id={TITLE} tabIndex={-1} className="text-[17px] font-medium leading-6 tracking-[-0.008em] outline-none!">{t("cloudProPopup.title")}</h2>+ {view.badge && <Tag>{view.badge}</Tag>}</div>- {view.badge && <p className="mt-3 inline-flex rounded-full bg-accent/15 px-2 py-0.5 text-[12px] font-medium text-accent-text">{view.badge}</p>}- <div id="cloud-pro-popup-body">- <p className="mt-3 text-[14px] leading-relaxed text-ink-secondary">{t("cloudIntro.body")}</p>- <ul className="mt-3 flex flex-col gap-2 text-[13px]">- {view.points.map(point => <li key={point} className="flex items-start gap-2"><Check size={15} className="mt-0.5 shrink-0 text-ink-secondary" aria-hidden="true" />{point}</li>)}+ <div id="cloud-pro-popup-body" className="mt-2 flex flex-col gap-4">+ <p className="text-[14px] leading-5 text-ink-secondary [text-wrap:pretty]">{t("cloudIntro.body")}</p>+ <ul className="flex flex-col gap-2 text-[14px] leading-5">+ {view.points.map(point => <li key={point} className="flex items-start gap-2.5"><Check size={16} strokeWidth={1.5} className="mt-0.5 shrink-0 text-ink-tertiary" aria-hidden="true" />{point}</li>)}</ul>- {view.current && <p className="mt-3 text-[13px] font-medium">{view.current}</p>}- {view.price && <p className="mt-3 text-[13px] text-ink-secondary">{view.price}</p>}- {view.moneyBack && <p className="text-[13px] text-ink-secondary">{view.moneyBack}</p>}+ {view.current && <p className="text-[14px] font-medium leading-5">{view.current}</p>}+ {(view.price || view.moneyBack) && <p className="flex flex-col text-[13px] leading-[18px] text-ink-secondary">+ {view.price && <span>{view.price}</span>}{view.moneyBack && <span>{view.moneyBack}</span>}+ </p>}</div>- <div className="mt-5 flex flex-wrap items-center gap-3">- <button type="button" className={PRIMARY} onClick={onPrimary}>{view.primary.label}</button>- {view.seePlans && <button type="button" className="inline-flex items-center gap-1 py-2 text-[13px] text-ink-secondary underline underline-offset-2 hover:text-ink" onClick={onSeePlans}>- {t("pro.seePlans")}- </button>}+ <div className="mt-5 flex flex-wrap items-center gap-2">+ <button type="button" className={cn(PRIMARY, "ui-button-lg")} onClick={onPrimary}>{view.primary.label}</button>+ {view.seePlans && <button type="button" className={cn(QUIET, "ui-button-lg")} onClick={onSeePlans}>{t("pro.seePlans")}</button>}</div>- <div className="mt-3 flex items-center justify-between gap-3">- <p className="text-[12px] text-ink-secondary">{t("pro.disclaimer")}</p>+ <div className="mt-4 flex items-center justify-between gap-3 border-t-[0.5px] border-ink/10 pt-2">+ <p className="min-w-0 flex-1 text-[12px] leading-4 text-ink-tertiary">{t("pro.disclaimer")}</p><NotNowButton onClick={onNotNow} /></div>- <button type="button" onClick={onClose} aria-label={t("cloudAdd.close")} className="ui-icon-button absolute end-4 top-4"><X size={16} /></button>+ <button type="button" onClick={onClose} aria-label={t("cloudAdd.close")} className={cn(CLOSE, "absolute end-4 top-4")}><X size={16} /></button></div></div>;}diff --git a/src/components/CloudTrialIntro.tsx b/src/components/CloudTrialIntro.tsxindex e811ee46d9..4cb2e15d8d 100644--- a/src/components/CloudTrialIntro.tsx+++ b/src/components/CloudTrialIntro.tsx@@ -1,7 +1,9 @@import { Check, Cloud } from "lucide-react";import type { CloudOffer } from "../../electron/cloud-home.mjs";+import { cn } from "@/lib/cn";import { cloudIntroView } from "@/lib/cloud-plan";import { t } from "@/lib/i18n";+import { LINK, Tag } from "./cloud-buy/parts";import { NoticeCard, NotNowButton, PRIMARY_BUTTON } from "./NoticeCard";export function CloudTrialIntroCard({ offer, onStart, onHowTo, onSignIn, onNotNow, onDismiss }: {@@ -13,7 +15,7 @@ export function CloudTrialIntroCard({ offer, onStart, onHowTo, onSignIn, onNotNoconst view = cloudIntroView(offer);if (!view) return null;return <NoticeCard titleId="cloud-intro-title" notice="cloud-intro" icon={Cloud} title={t("cloudIntro.title")} onDismiss={onDismiss}>- <p className="mt-2 inline-flex rounded-full bg-accent/15 px-2 py-0.5 text-[12px] font-medium text-accent-text">{view.badge}</p>+ <Tag className="mt-2">{view.badge}</Tag><p className="mt-2 text-[13px] leading-relaxed text-ink-secondary">{t("cloudIntro.body")}</p><ul className="mt-2 flex flex-col gap-1.5 text-[13px] text-ink">{view.points.map(point => <li key={point} className="flex items-start gap-2"><Check size={14} className="mt-0.5 shrink-0 text-ink-secondary" aria-hidden="true" />{point}</li>)}@@ -25,7 +27,7 @@ export function CloudTrialIntroCard({ offer, onStart, onHowTo, onSignIn, onNotNo<button type="button" className="ui-button" onClick={onHowTo}>{t("cloudIntro.howTo")}</button></div><div className="mt-1 flex items-center justify-between gap-3">- {onSignIn ? <button type="button" className="py-2 text-left text-[12px] font-medium text-accent-text underline underline-offset-2 hover:text-ink" onClick={onSignIn}>{t("cloudAccount.signIn")}</button> : <span />}+ {onSignIn ? <button type="button" className={cn(LINK, "py-2 text-left text-[12px]")} onClick={onSignIn}>{t("cloudAccount.signIn")}</button> : <span />}<NotNowButton onClick={onNotNow} /></div></NoticeCard>;diff --git a/src/components/cloud-buy/ChooseScreen.tsx b/src/components/cloud-buy/ChooseScreen.tsxindex 969f51774c..3c1212d2c1 100644--- a/src/components/cloud-buy/ChooseScreen.tsx+++ b/src/components/cloud-buy/ChooseScreen.tsx@@ -1,48 +1,69 @@-// Screen 1: what MausBot Cloud is, then the plans the Admin sells now as cards, each with its own button, and the money in one line.-import { Check, CloudUpload, Lock, Monitor, Moon, Smartphone, type LucideIcon } from "lucide-react";+// Screen 1: MausBot Cloud in a line, then the plans the Admin sells now as cards that show only what sets each apart,+// each with its own button; what every plan includes and the money are said once, under them.+import { useState } from "react";+import { AudioLines, ChevronDown, CloudUpload, HardDrive, Lock, Monitor, Moon, Power, Smartphone, Timer, type LucideIcon } from "lucide-react";import type { CloudOffer, CloudOfferPlan } from "../../../electron/cloud-home.mjs";import { cn } from "@/lib/cn";-import { moneyBackShort, planCards, sharedTrialDays, trialTimeline, type CloudPlanCard } from "@/lib/cloud-plan";+import { cardRows, moneyBackShort, planCards, sharedTrialDays, trialTimeline, type CloudPlanCard, type CloudPlanCardRow } from "@/lib/cloud-plan";import { t } from "@/lib/i18n";import type { LocaleKey } from "@/locales";-import { CloudMascotScene } from "./CloudMascotScene";-import { LINK, PRIMARY_WIDE } from "./parts";+import { CloudMascots } from "./CloudMascots";+import { Heading, LINK, PRIMARY_WIDE, QUIET_WIDE, SCREEN, Tag } from "./parts";-const BENEFITS: ReadonlyArray<readonly [LucideIcon, LocaleKey, LocaleKey]> = [+const FEATURES: ReadonlyArray<readonly [LucideIcon, LocaleKey, LocaleKey]> = [[Moon, "cloudBuy.benefit.awayTitle", "cloudBuy.benefit.away"],[Lock, "cloudBuy.benefit.privateTitle", "cloudBuy.benefit.private"],[Smartphone, "cloudBuy.benefit.anywhereTitle", "cloudBuy.benefit.anywhere"],[Monitor, "cloudBuy.benefit.browserTitle", "cloudBuy.benefit.browser"],[CloudUpload, "cloudBuy.benefit.moveTitle", "cloudBuy.benefit.move"],];+const ROW_ICON: Partial<Record<CloudPlanCardRow["key"], LucideIcon>> = { power: Power, hours: Timer, storage: HardDrive, voice: AudioLines };-/** Cards side by side on a wide sheet, written out for Tailwind to find; four go two by two. */-const COLUMNS: Record<number, string> = { 1: "md:grid-cols-1", 2: "md:grid-cols-2", 3: "md:grid-cols-3", 4: "md:grid-cols-2" };+/** Cards side by side on a wide sheet, written out for Tailwind to find. */+const COLUMNS: Record<number, string> = { 1: "md:grid-cols-1", 2: "md:grid-cols-2", 3: "md:grid-cols-3", 4: "md:grid-cols-2 lg:grid-cols-4" };-/** On a wide sheet the cards share their rows (a subgrid), so every card's button and list start at the same height. */-function PlanCard({ card, busy, onStart }: { card: CloudPlanCard; busy: boolean; onStart: (tier: string) => void }) {+const detailsId = (tier: string) => `cloud-plan-details-${tier}`;++/** On a wide sheet the cards share their rows (a subgrid), so every card's price, numbers and button line up. */+function PlanCard({ card, shown, details, compare, busy, onStart }: {+ card: CloudPlanCard; shown: CloudPlanCardRow[]; details: CloudPlanCardRow[]; compare: boolean; busy: boolean; onStart: (tier: string) => void;+}) {const nameId = `cloud-plan-${card.tier}`;return <li data-plan={card.tier} aria-labelledby={nameId} data-plan-current={card.current ? "" : undefined}- className={cn("row-span-6 grid min-w-0 grid-rows-subgrid gap-y-3 rounded-2xl border bg-card p-5", card.popular ? "border-accent" : "border-hairline")}>- <div className="flex flex-wrap items-center justify-between gap-2">- <h4 id={nameId} className="text-[16px] font-semibold text-ink">{card.name}</h4>- {card.popular && <span data-plan-popular className="rounded-full bg-accent px-2 py-0.5 text-[11px] font-semibold tracking-[0.02em] text-accent-ink">{t("cloudAdd.popular")}</span>}+ className={cn("grid min-w-0 grid-rows-subgrid gap-y-3 rounded-[14px] border-[0.5px] bg-menu p-4", compare ? "row-span-5" : "row-span-4",+ card.popular ? "border-ink/25" : "border-ink/10")}>+ <div className="flex min-h-6 flex-wrap items-center justify-between gap-x-2 gap-y-1">+ <h4 id={nameId} className="text-[15px] font-medium leading-[22px] text-ink">{card.name}</h4>+ {card.popular && <Tag data-plan-popular="">{t("cloudAdd.popular")}</Tag>}+ </div>+ <div className="flex flex-col gap-1.5">+ <p className="flex items-baseline gap-1">+ <span className="text-[28px] font-semibold leading-8 tracking-[-0.02em] tabular-nums text-ink">{card.price}</span>+ <span className="text-[13px] text-ink-tertiary">{t("cloudBuy.perMonth")}</span>+ </p>+ {card.promise && <p data-plan-promise="" className="text-[13px] leading-[18px] text-ink-secondary">{card.promise}</p>}</div>- <p className="flex items-baseline gap-1">- <span className="text-[32px] font-bold leading-none tracking-[-0.02em] tabular-nums text-ink">{card.price}</span>- <span className="text-[13px] font-medium text-ink-tertiary">{t("cloudBuy.perMonth")}</span>- </p>- <p data-plan-promise className="text-[13px] leading-snug text-ink-secondary">{card.promise}</p>- {card.action- ? <button type="button" data-plan-buy={card.tier} aria-describedby={nameId} className={PRIMARY_WIDE} disabled={busy} onClick={() => onStart(card.tier)}>{card.action}</button>- : <p data-plan-mine className="grid min-h-11 place-items-center rounded-xl border border-hairline bg-raised text-[14px] font-semibold text-ink-secondary">{t("cloudBuy.card.current")}</p>}- <p className="-mt-1.5 text-center text-[12px] leading-snug text-ink-tertiary">{card.terms}</p>- <ul className="flex flex-col gap-2 border-t border-hairline/60 pt-3">- {card.rows.map(row => <li key={row.key} data-plan-row={row.key} className="grid grid-cols-[14px_minmax(0,1fr)] items-start gap-2 text-[13px] leading-snug text-ink">- <Check size={14} aria-hidden="true" className="mt-0.5 text-accent-text" />- <span>{row.text}{row.note && <small className="block text-[11px] text-ink-tertiary">{row.note}</small>}</span>+ <ul className="flex flex-col gap-2.5 pt-1">+ {shown.map(row => {+ const Icon = ROW_ICON[row.key];+ return <li key={row.key} data-plan-row={row.key} className="grid grid-cols-[16px_minmax(0,1fr)] items-start gap-2.5 text-[13px] leading-[18px] text-ink">+ {Icon ? <Icon size={16} strokeWidth={1.5} aria-hidden="true" className="mt-px text-ink-tertiary" /> : <span />}+ <span>{row.text}{row.note && <small className="block text-[12px] leading-4 text-ink-tertiary">{row.note}</small>}</span>+ </li>;+ })}+ </ul>+ <ul id={detailsId(card.tier)} hidden={!compare} className="flex flex-col gap-2 border-t-[0.5px] border-ink/10 pt-4 text-[12px] leading-4 text-ink-secondary">+ {details.map(row => <li key={row.key} data-plan-row={row.key}>+ {row.text}{row.note && <small className="block text-[12px] leading-4 text-ink-tertiary">{row.note}</small>}</li>)}</ul>+ <div className="flex flex-col gap-2 self-start pt-1">+ {card.action+ ? <button type="button" data-plan-buy={card.tier} aria-describedby={nameId} className={card.popular ? PRIMARY_WIDE : QUIET_WIDE} disabled={busy}+ onClick={() => onStart(card.tier)}>{card.action}</button>+ : <p data-plan-mine="" className="grid min-h-9 place-items-center rounded-full bg-ink/[0.04] px-4 text-[14px] text-ink-secondary">{t("cloudBuy.card.current")}</p>}+ {card.terms && <p className="text-center text-[12px] leading-4 text-ink-tertiary">{card.terms}</p>}+ </div></li>;}@@ -53,57 +74,60 @@ export function ChooseScreen({ offer, current = null, own = null, now, busy, signow: number; busy: boolean; signedOut: boolean; notice: string | null;onStart: (tier: string) => void; onSignIn: () => void;}) {+ const [compare, setCompare] = useState(false);const cards = planCards(offer, { current, own });+ const rows = cardRows(cards);const timeline = trialTimeline(offer, now);const moneyBack = moneyBackShort(offer);- return <div data-cloud-add={offer.plans.some(plan => plan.trialDays) ? "offer-trial" : "offer"} className="flex flex-col">- <div className="grid gap-x-6 gap-y-[18px] border-b border-hairline/60 bg-linear-to-b from-accent/15 via-accent/[0.04] to-transparent px-7 pb-5 pt-6 md:grid-cols-[minmax(0,1fr)_minmax(0,300px)] md:items-center">- <div>- <p className="text-[12px] font-semibold uppercase tracking-[0.08em] text-accent-text">{t("pro.name")}</p>- <h2 id="cloud-add-title" tabIndex={-1} className="mb-1.5 mt-1 pe-8 text-[27px] font-bold leading-[1.12] tracking-[-0.025em] text-ink outline-none [text-wrap:balance]">{t("cloudBuy.title")}</h2>- <p className="max-w-[44ch] text-[14px] leading-relaxed text-ink-secondary">{t("cloudBuy.lede")}</p>- </div>- <div className="md:me-8 md:mt-4"><CloudMascotScene variant="hero" /></div>- <ul aria-label={t("cloudBuy.benefits")} className="grid gap-3 sm:grid-cols-2 md:col-span-2 md:grid-cols-5">- {BENEFITS.map(([Icon, title, body]) => <li key={title} className="grid grid-cols-[26px_minmax(0,1fr)] items-start gap-2">- <span aria-hidden="true" className="grid size-[26px] place-items-center rounded-[8px] bg-accent/12 text-accent-text"><Icon size={15} /></span>- <span><span className="block text-[13px] font-semibold leading-snug text-ink">{t(title)}</span><span className="block text-[12px] leading-snug text-ink-secondary">{t(body)}</span></span>- </li>)}- </ul>+ const trial = Boolean(sharedTrialDays(offer));+ return <div data-cloud-add={offer.plans.some(plan => plan.trialDays) ? "offer-trial" : "offer"} className={SCREEN}>+ <div className="grid gap-y-2 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end sm:gap-x-6">+ <Heading mark={<CloudMascots size={22} />} title={t("pro.name")}+ sub={<><span className="font-medium text-ink">{t("cloudBuy.title")}</span> {t("cloudBuy.lede")}</>} />+ <button type="button" aria-expanded={compare} aria-controls={cards.map(card => detailsId(card.tier)).join(" ")} onClick={() => setCompare(!compare)}+ className="-ms-2.5 inline-flex items-center gap-1 justify-self-start rounded-full py-0.5 pe-1.5 ps-2.5 text-[13px] leading-[18px] text-ink-secondary transition-colors hover:bg-ink/[0.06] hover:text-ink sm:-me-2 sm:ms-0 sm:justify-self-end motion-reduce:transition-none">+ {t("pro.seePlans")}<ChevronDown size={14} strokeWidth={1.5} aria-hidden="true" className={cn("transition-transform motion-reduce:transition-none", compare && "rotate-180")} />+ </button></div>- <div className="flex min-w-0 flex-col gap-4 px-7 pb-5 pt-5">- <h3 id="cloud-add-plans" className="text-[15px] font-semibold text-ink">{t("cloudBuy.choose")}</h3>- {notice && <p role="status" className="text-[13px] text-ink">{notice}</p>}+ {notice && <p role="status" className="rounded-[12px] bg-ink/[0.04] px-4 py-3 text-[13px] leading-[18px] text-ink">{notice}</p>}+ <section aria-labelledby="cloud-add-plans">+ <h3 id="cloud-add-plans" className="sr-only">{t("cloudBuy.choose")}</h3><ul aria-labelledby="cloud-add-plans" className={cn("grid gap-3", COLUMNS[cards.length] ?? "md:grid-cols-3")}>- {cards.map(card => <PlanCard key={card.tier} card={card} busy={busy} onStart={onStart} />)}+ {cards.map((card, index) => <PlanCard key={card.tier} card={card} shown={rows[index]!.shown} details={rows[index]!.details} compare={compare} busy={busy} onStart={onStart} />)}</ul>- {sharedTrialDays(offer) && <div aria-live="polite" className="flex flex-col gap-2 rounded-xl border border-hairline/70 bg-card/70 px-4 py-3">- <p className="text-[13px] leading-relaxed text-ink-secondary">{t("cloudBuy.trialTerms")}</p>- {timeline.length > 1 && <ol aria-label={t("cloudBuy.timeline")} className="relative mt-1 grid" style={{ gridTemplateColumns: `repeat(${timeline.length}, minmax(0, 1fr))` }}>- <span aria-hidden="true" className="absolute inset-x-1.5 top-[6px] h-0.5 bg-hairline" />- {timeline.map((step, index) => {- const last = index === timeline.length - 1, first = index === 0;- return <li key={step.when} className={cn("relative min-w-0 pt-[18px] text-[12px] leading-snug text-ink-secondary", !first && !last && "text-center", last && "text-end")}>- <span aria-hidden="true" className={cn("absolute top-px size-3 rounded-full border-2", first ? "start-0 border-accent bg-accent" : "border-ink-tertiary bg-panel",- !first && !last && "start-[calc(50%-6px)]", last && "end-0")} />- <b className="block text-[12px] font-semibold text-ink">{step.when}</b>{step.text}- </li>;- })}- </ol>}- </div>}- <div className="flex flex-col items-center gap-1.5 text-center text-[12px] text-ink-tertiary">- <p className="flex flex-wrap items-center justify-center gap-x-3.5 gap-y-1">- <span className="inline-flex items-center gap-1.5"><Lock size={13} aria-hidden="true" />{t("cloudBuy.secure")}</span>- <span role="img" aria-label={t("cloudBuy.wallets")} className="inline-flex gap-1">- {[t("cloudBuy.applePay"), t("cloudBuy.googlePay"), t("cloudBuy.card")].map(mark => <span key={mark} aria-hidden="true"- className="rounded-[5px] border border-hairline px-[5px] py-px text-[11px] font-semibold text-ink-secondary">{mark}</span>)}+ </section>+ <div aria-live="polite" className="flex flex-col gap-1.5 text-[13px] leading-[18px] text-ink-secondary">+ {timeline.length > 1 && <ol aria-label={t("cloudBuy.timeline")} className="flex flex-wrap items-center gap-x-4 gap-y-1">+ {timeline.map((step, index) => <li key={step.when} className="inline-flex items-center gap-1.5">+ <span aria-hidden="true" className={cn("size-1.5 shrink-0 rounded-full", index === 0 ? "bg-ink" : "border border-ink/40")} />+ <b className="font-medium text-ink">{step.when}</b>{step.text}+ </li>)}+ </ol>}+ {(trial || moneyBack) && <p className="flex flex-wrap gap-x-1.5">+ {trial && <span>{t("cloudBuy.trialTerms")}</span>}{trial && moneyBack && <span aria-hidden="true">·</span>}{moneyBack && <span>{moneyBack}</span>}+ </p>}+ </div>+ <section aria-labelledby="cloud-add-includes" className="flex flex-col gap-2.5">+ <h3 id="cloud-add-includes" className="text-[13px] font-medium leading-[18px] text-ink-secondary">{t("cloudBuy.includes")}</h3>+ <ul className="flex flex-wrap gap-x-5 gap-y-2">+ {FEATURES.map(([Icon, title, body]) => <li key={title} className="flex text-[13px] leading-[18px] text-ink">+ <span aria-hidden="true" title={t(body)} className="inline-flex items-center gap-1.5">+ <Icon size={16} strokeWidth={1.5} className="shrink-0 text-ink-tertiary" />{t(title)}</span>- </p>- <p className="flex flex-wrap items-center justify-center gap-x-3.5 gap-y-1">- <span>{t("cloudBuy.cancelEasy")}</span>{moneyBack && <span>{moneyBack}</span>}- </p>- {signedOut && <button type="button" className={LINK} onClick={onSignIn}>{t("cloudBuy.haveAccount")}</button>}- </div>+ <span className="sr-only">{t(title)}: {t(body)}</span>+ </li>)}+ </ul>+ </section>+ <div className="flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-t-[0.5px] border-ink/10 pt-4 text-[12px] leading-4 text-ink-tertiary">+ <p className="flex flex-wrap items-center gap-x-2.5 gap-y-1">+ <span className="inline-flex items-center gap-1.5"><Lock size={13} strokeWidth={1.5} aria-hidden="true" />{t("cloudBuy.secure")}</span>+ <span role="img" aria-label={t("cloudBuy.wallets")} className="inline-flex gap-1">+ {[t("cloudBuy.applePay"), t("cloudBuy.googlePay"), t("cloudBuy.card")].map(mark => <span key={mark} aria-hidden="true"+ className="rounded-[5px] border-[0.5px] border-ink/20 px-1.5 py-px text-[11px] font-medium text-ink-secondary">{mark}</span>)}+ </span>+ <span aria-hidden="true">·</span><span>{t("cloudBuy.cancelEasy")}</span>+ </p>+ {signedOut && <button type="button" className={LINK} onClick={onSignIn}>{t("cloudBuy.haveAccount")}</button>}</div></div>;}diff --git a/src/components/cloud-buy/CloudMascotScene.test.ts b/src/components/cloud-buy/CloudMascotScene.test.tsdeleted file mode 100644index 3451b80722..0000000000--- a/src/components/cloud-buy/CloudMascotScene.test.ts+++ /dev/null@@ -1,124 +0,0 @@-// @vitest-environment happy-dom-import { readFileSync } from "node:fs";-import { act, createElement } from "react";-import { createRoot, type Root } from "react-dom/client";-import { afterEach, beforeEach, expect, it, vi } from "vitest";-import { setLocale } from "@/lib/i18n";-import { MAUS_COLOR_NAMES } from "@/lib/mascot";-import en from "@/locales/en.json";--type Seen = { color: string; state: string; animated: boolean; trackPointer?: boolean; size: number };-vi.mock("@/components/Avatar", () => ({- MausAvatar: ({ color, state, animated, trackPointer, size: _size, ...choreography }: Seen) => createElement("i", {- "data-maus": color, "data-state": state, "data-animated": String(animated), "data-pointer": String(trackPointer),- "data-extra": Object.keys(choreography).join(",") }),-}));-const { CloudMascotScene } = await import("./CloudMascotScene");--(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;-let host: HTMLDivElement, root: Root;-const render = async (props: { variant: "hero" | "beat"; paused?: boolean }) => { await act(async () => { root.render(createElement(CloudMascotScene, props)); }); };-const scene = () => host.querySelector<HTMLElement>("[data-cloud-scene]")!;-const mascots = () => [...host.querySelectorAll<HTMLElement>("[data-maus]")];-const animated = () => mascots().map(node => node.dataset.animated);-const twinkling = () => host.querySelectorAll(".cloud-scene-twinkle").length;-const drifting = () => host.querySelectorAll(".cloud-scene-z").length;--beforeEach(() => { setLocale("en"); host = document.createElement("div"); document.body.append(host); root = createRoot(host); });-afterEach(async () => {- await act(async () => root.unmount());- host.remove();- delete document.documentElement.dataset.reducedMotion;- vi.useRealTimers(); vi.unstubAllGlobals(); vi.restoreAllMocks();-});--it("three of the app's own mascots in three colours, each in its own calm state, one picture named for its message", async () => {- for (const variant of ["hero", "beat"] as const) {- await render({ variant });- const colors = mascots().map(node => node.dataset.maus!);- expect(colors, variant).toHaveLength(3);- expect(new Set(colors).size, variant).toBe(3);- for (const color of colors) expect(MAUS_COLOR_NAMES).toContain(color);- expect(mascots().map(node => node.dataset.state), variant).toEqual(["working", "idle", "thinking"]);- expect(mascots().map(node => node.dataset.extra), "no faces, gazes or motions laid on top").toEqual(["", "", ""]);- expect(mascots().map(node => node.dataset.pointer)).toEqual(["false", "false", "false"]);- expect(scene().dataset.cloudScene).toBe(variant);- expect(scene().getAttribute("role")).toBe("img");- expect(scene().getAttribute("aria-label")).toBe(en["cloudScene.label"]);- }- expect(en["cloudScene.label"]).toMatch(/^Three bots keep working .* while this computer sleeps$/);-});--it("live, the only motion is the mascots' own, a few twinkling stars and three drifting z's: no timer or frame of its own", async () => {- vi.useFakeTimers();- await render({ variant: "hero" });- expect(scene().hasAttribute("data-paused")).toBe(false);- expect(animated()).toEqual(["true", "true", "true"]);- expect(twinkling()).toBe(6);- expect(drifting()).toBe(3);- expect(vi.getTimerCount(), "no setTimeout, setInterval or requestAnimationFrame").toBe(0);- const markup = host.innerHTML;- await act(async () => { vi.advanceTimersByTime(60_000); });- expect(host.innerHTML, "nothing changes on a clock").toBe(markup);-});--it("its CSS moves two things, slowly, and holds them while paused", () => {- const css = readFileSync("src/styles.css", "utf8");- expect([...css.matchAll(/@keyframes (cloud-scene-[\w-]+)/g)].map(match => match[1])).toEqual(["cloud-scene-twinkle", "cloud-scene-z"]);- for (const [, seconds] of css.matchAll(/animation: cloud-scene-[\w-]+ ([\d.]+)s/g)) expect(Number(seconds)).toBeGreaterThanOrEqual(4);- expect(css).toContain(".cloud-scene[data-paused] * { animation-play-state: paused; }");-});--it("reduced motion is the same picture held still: no CSS animation and no mascot moving", async () => {- document.documentElement.dataset.reducedMotion = "true";- await render({ variant: "hero" });- expect(animated()).toEqual(["false", "false", "false"]);- expect(twinkling()).toBe(0);- expect(drifting()).toBe(0);- expect(host.querySelectorAll("[style*='animation']")).toHaveLength(0);- expect(host.querySelectorAll("path[d^='M-2.4-2.4']"), "the z's still rise from the laptop").toHaveLength(3);-});--it("the system setting or the dev hook, switched while the scene is shown, stills it at once and lets it go again", async () => {- let reduce = false;- const changes = new Set<() => void>();- vi.spyOn(window, "matchMedia").mockImplementation(query => ({ matches: reduce && query.includes("reduce"), media: query,- addEventListener: (_: string, changed: () => void) => changes.add(changed), removeEventListener: (_: string, changed: () => void) => changes.delete(changed) }) as unknown as MediaQueryList);- const still = () => twinkling() + drifting() === 0 && animated().every(flag => flag === "false");- const moving = () => twinkling() + drifting() > 0 && animated().every(flag => flag === "true");- await render({ variant: "beat" });- expect(moving()).toBe(true);- reduce = true;- await act(async () => { changes.forEach(changed => changed()); });- expect(still(), "system setting on").toBe(true);- reduce = false;- await act(async () => { changes.forEach(changed => changed()); });- expect(moving(), "system setting off").toBe(true);- await act(async () => { document.documentElement.dataset.reducedMotion = "true"; await Promise.resolve(); });- expect(still(), "dev hook on").toBe(true);- await act(async () => { delete document.documentElement.dataset.reducedMotion; await Promise.resolve(); });- expect(moving(), "dev hook off").toBe(true);-});--it("paused or out of view it holds: the mascots stop and the CSS animations pause until it is back", async () => {- let visible: (seen: boolean) => void = () => {};- vi.stubGlobal("IntersectionObserver", class {- constructor(report: IntersectionObserverCallback) {- visible = seen => report([{ isIntersecting: seen } as IntersectionObserverEntry], this as unknown as IntersectionObserver);- }- observe() {}- disconnect() {}- });- await render({ variant: "beat", paused: true });- expect(scene().hasAttribute("data-paused")).toBe(true);- expect(animated()).toEqual(["false", "false", "false"]);- await render({ variant: "beat" });- expect(scene().hasAttribute("data-paused")).toBe(false);- expect(animated()).toEqual(["true", "true", "true"]);- await act(async () => visible(false));- expect(scene().hasAttribute("data-paused")).toBe(true);- expect(animated()).toEqual(["false", "false", "false"]);- await act(async () => visible(true));- expect(scene().hasAttribute("data-paused")).toBe(false);- expect(animated()).toEqual(["true", "true", "true"]);-});diff --git a/src/components/cloud-buy/CloudMascotScene.tsx b/src/components/cloud-buy/CloudMascotScene.tsxdeleted file mode 100644index 0ce4ef577e..0000000000--- a/src/components/cloud-buy/CloudMascotScene.tsx+++ /dev/null@@ -1,196 +0,0 @@-// MausBot Cloud's night shift: three Maus bots work on a cloud under the moon while this computer sleeps on its hill.-import { memo, useEffect, useId, useRef, useState, useSyncExternalStore, type CSSProperties, type RefObject } from "react";-import { MausAvatar } from "@/components/Avatar";-import { t } from "@/lib/i18n";-import type { MausColor, MausState } from "@/lib/mascot";-import { reducedMotion } from "@/lib/onboarding";--type Variant = "hero" | "beat";-type Spot = readonly [x: number, y: number, size: number];-type Area = readonly [width: number, height: number];--const CREW_AREA: Area = [220, 86];-const HOME_WIDTH = 100;-const LAYOUTS: Record<Variant, { area: Area; crew: Spot; home: Spot; moon: Spot }> = {- hero: { area: [320, 150], crew: [10, 56, 220], home: [210, 92, 104], moon: [278, 30, 13] },- beat: { area: [400, 116], crew: [40, 28, 204], home: [270, 56, 114], moon: [334, 24, 11] },-};--/** Each bot keeps one calm state, which the mascot animates by itself (its faces, blinks and a slow bob or sway). */-const CREW: readonly { color: MausColor; state: MausState; spot: Spot }[] = [- { color: "orange", state: "working", spot: [30, 14, 46] },- { color: "pink", state: "idle", spot: [84, 7, 52] },- { color: "green", state: "thinking", spot: [144, 14, 46] },-];-const BACK_PUFFS = [[36, 50, 18], [72, 36, 26], [114, 33, 26], [152, 40, 23], [186, 50, 19]] as const;-const FRONT_PUFFS = [[28, 68, 12], [55, 65, 16], [90, 64, 18], [126, 65, 16.5], [158, 66, 15], [190, 68, 12.5]] as const;-/** [x %, y %, radius, seconds per twinkle (0: steady), delay]; sparkles add a tint. */-const STARS = [- [3, 20, 1.1, 0, 0], [7, 56, 0.8, 0, 0], [11, 8, 1.3, 5.6, -2.6], [21, 46, 0.8, 0, 0], [26, 12, 0.9, 0, 0],- [33, 4, 1.1, 0, 0], [38, 26, 0.7, 0, 0], [45, 9, 1.2, 6.4, -2], [51, 3, 0.8, 0, 0], [57, 24, 1, 0, 0],- [62, 8, 0.7, 0, 0], [68, 30, 0.9, 4.8, -1.5], [73, 6, 1.1, 0, 0], [87, 32, 1, 0, 0], [92, 9, 1.2, 0, 0], [97, 44, 0.9, 0, 0],-] as const;-const SPARKLES = [[16, 30, 3.2, 6, -1.4, "#ffc4e4"], [64, 16, 2.6, 7, -2.9, "#b5f2ff"], [95, 24, 2.4, 5.2, -0.6, "#ffe9a8"]] as const;-/** The z bubbles where the still frame shows them; live, the CSS drifts each one up the same path, a third of a loop apart. */-const ZS = [[0, 0, 0.62], [7, -11, 0.85], [16, -23, 1.08]] as const;-const Z = "M-2.4-2.4h4.8l-4.8 4.8h4.8";--const percent = (part: number, whole: number) => `${(part / whole) * 100}%`;-const place = ([x, y, width]: Spot, [areaWidth, areaHeight]: Area, height = width): CSSProperties => ({- left: percent(x, areaWidth), top: percent(y, areaHeight), width: percent(width, areaWidth), height: percent(height, areaHeight),-});-const twinkle = (live: boolean, seconds: number, delay: number): { className?: string; style?: CSSProperties } =>- live && seconds ? { className: "cloud-scene-twinkle", style: { animationDuration: `${seconds}s`, animationDelay: `${delay}s` } } : {};-const sparkle = (r: number) => {- const k = r * 0.18;- return `M0 ${-r}Q${k} ${-k} ${r} 0Q${k} ${k} 0 ${r}Q${-k} ${k} ${-r} 0Q${-k} ${-k} 0 ${-r}Z`;-};--function subscribeReducedMotion(changed: () => void) {- const query = globalThis.window?.matchMedia?.("(prefers-reduced-motion: reduce)");- query?.addEventListener?.("change", changed);- const root = globalThis.document?.documentElement;- const hook = root && typeof MutationObserver === "function" ? new MutationObserver(changed) : null;- if (root) hook?.observe(root, { attributes: true, attributeFilter: ["data-reduced-motion"] });- return () => {- query?.removeEventListener?.("change", changed);- hook?.disconnect();- };-}--function useInView(target: RefObject<HTMLElement | null>) {- const [inView, setInView] = useState(true);- useEffect(() => {- const node = target.current;- if (!node || typeof IntersectionObserver !== "function") return;- const watch = new IntersectionObserver(entries => setInView(entries.at(-1)?.isIntersecting ?? true));- watch.observe(node);- return () => watch.disconnect();- }, [target]);- return inView;-}--function Laptop({ metal, glass }: { metal: string; glass: string }) {- return <g transform="translate(46 32)">- <ellipse cx="4" cy="2.6" rx="29" ry="3.6" fill="#000" opacity=".32" />- <path d="M-21-1.5 19 1v2.2l-40-2.5Z" fill="#8a92b1" />- <path d="M19 1 27-6.5v2.2L19 3.2Z" fill="#646c8c" />- <path d="M-21-1.5 19 1 27-6.5-13-9Z" fill={metal} stroke="#eef0f8" strokeWidth=".7" strokeLinejoin="round" />- <path d="M-15.4-6.3 15.6-4.4 20.5-8.4-10.6-10.3Z" fill="#4b5272" opacity=".55" transform="translate(.6 2.2)" />- <path d="M-3.3-.6 5.3-.1 6.9-2.2-1.7-2.7Z" fill="#fff" opacity=".55" />- <path d="M-13-9 27-6.5 29.2-31.6-10.8-34.1Z" fill="#c9cee0" />- <path d="M-11.6-10.4 25.6-8.1 27.5-30.1-9.7-32.4Z" fill={glass} />- <path d="M-2.5-31.8 10.6-31 0-9.5-13.1-10.3Z" fill="#fff" opacity=".07" />- <circle cx="13.3" cy="2.35" r=".95" fill="#b6f5d2" opacity=".7" />- </g>;-}--/** The Cloud scene for the buying sheet ("hero") and the welcome's Cloud beat ("beat"). The bots keep their own calm- * states, a few stars twinkle and the z's drift up. `paused` (something covers it) or out of view holds all of it;- * reduced motion shows it still. */-export const CloudMascotScene = memo(function CloudMascotScene({ variant, paused = false }: { variant: Variant; paused?: boolean }) {- const { area, crew, home: [homeX, homeY, homeWidth], moon: [moonX, moonY, moonR] } = LAYOUTS[variant];- const [areaWidth, areaHeight] = area;- const uid = `cloud-scene${useId().replace(/[^a-zA-Z0-9]/g, "")}`;- const root = useRef<HTMLDivElement>(null);- const inView = useInView(root);- const live = !useSyncExternalStore(subscribeReducedMotion, reducedMotion, reducedMotion);- const moving = live && !paused && inView;- const url = (name: string) => `url(#${uid}-${name})`;-- return <div ref={root} role="img" aria-label={t("cloudScene.label")} data-cloud-scene={variant} data-paused={moving ? undefined : ""}- className={`cloud-scene cloud-scene-${variant}`}>- <svg className="cloud-scene-layer" aria-hidden="true">- {STARS.map(([x, y, r, seconds, delay]) => <circle key={`${x}-${y}`} cx={`${x}%`} cy={`${y}%`} r={r} fill="var(--cloud-scene-star)"- opacity={seconds ? undefined : 0.7} {...twinkle(live, seconds, delay)} />)}- {SPARKLES.map(([x, y, r, seconds, delay, tint]) => <svg key={`${x}-${y}`} x={`${x}%`} y={`${y}%`} overflow="visible">- <path d={sparkle(r)} fill={tint} {...twinkle(live, seconds, delay)} />- </svg>)}- </svg>- <div className="cloud-scene-stage">- <svg className="cloud-scene-layer" viewBox={`0 0 ${areaWidth} ${areaHeight}`} aria-hidden="true">- <defs>- <radialGradient id={`${uid}-halo`}>- <stop offset="0" style={{ stopColor: "var(--cloud-scene-moon-glow)" }} />- <stop offset="1" style={{ stopColor: "var(--cloud-scene-moon-glow)", stopOpacity: 0 }} />- </radialGradient>- <linearGradient id={`${uid}-moon`} x1="0" y1="0" x2="1" y2="1">- <stop offset="0" stopColor="#fff4c9" />- <stop offset="1" stopColor="#f6c453" />- </linearGradient>- <mask id={`${uid}-crescent`}>- <rect width={areaWidth} height={areaHeight} fill="#fff" />- <circle cx={moonX + moonR * 0.42} cy={moonY - moonR * 0.34} r={moonR * 0.86} fill="#000" />- </mask>- <linearGradient id={`${uid}-lid`} x1="0" y1="0" x2="1" y2="1">- <stop offset="0" stopColor="#f6f7fc" />- <stop offset="1" stopColor="#b7bdd6" />- </linearGradient>- <linearGradient id={`${uid}-glass`} x1="0" y1="0" x2="1" y2="1">- <stop offset="0" stopColor="#262c52" />- <stop offset="1" stopColor="#0d1024" />- </linearGradient>- <linearGradient id={`${uid}-hill`} x1="0" y1="0" x2="0" y2="1">- <stop offset="0" style={{ stopColor: "var(--cloud-scene-hill-top)" }} />- <stop offset=".5" style={{ stopColor: "var(--cloud-scene-hill-bottom)" }} />- </linearGradient>- <radialGradient id={`${uid}-mist`}>- <stop offset="0" style={{ stopColor: "var(--cloud-scene-mist)" }} />- <stop offset="1" style={{ stopColor: "var(--cloud-scene-mist)", stopOpacity: 0 }} />- </radialGradient>- <radialGradient id={`${uid}-lamp`}>- <stop offset="0" style={{ stopColor: "var(--cloud-scene-lamp)", stopOpacity: 0.62 }} />- <stop offset=".55" style={{ stopColor: "var(--cloud-scene-lamp)", stopOpacity: 0.22 }} />- <stop offset="1" style={{ stopColor: "var(--cloud-scene-lamp)", stopOpacity: 0 }} />- </radialGradient>- <radialGradient id={`${uid}-shadow`}>- <stop offset="0" style={{ stopColor: "var(--cloud-scene-cloud-shade)", stopOpacity: 0.85 }} />- <stop offset="1" style={{ stopColor: "var(--cloud-scene-cloud-shade)", stopOpacity: 0 }} />- </radialGradient>- <linearGradient id={`${uid}-back`} gradientUnits="userSpaceOnUse" x1="0" y1="4" x2="0" y2="80">- <stop offset="0" style={{ stopColor: "var(--cloud-scene-cloud-top)" }} />- <stop offset="1" style={{ stopColor: "var(--cloud-scene-cloud-shade)" }} />- </linearGradient>- <linearGradient id={`${uid}-front`} gradientUnits="userSpaceOnUse" x1="0" y1="44" x2="0" y2="82">- <stop offset="0" stopColor="#fff" />- <stop offset="1" style={{ stopColor: "var(--cloud-scene-cloud-low)" }} />- </linearGradient>- </defs>- <circle cx={moonX} cy={moonY} r={moonR * 2.7} fill={url("halo")} />- <circle cx={moonX} cy={moonY} r={moonR} fill={url("moon")} mask={url("crescent")} />- <g transform={`translate(${homeX} ${homeY}) scale(${homeWidth / HOME_WIDTH})`}>- <path d="M-14 62C-2 45 16 35 46 34.6S110 37.5 400 45V62Z" fill={url("hill")} />- <path d="M-14 62C-2 45 16 35 46 34.6S110 37.5 400 45" fill="none" stroke="var(--cloud-scene-rim)" strokeWidth="1" />- <Laptop metal={url("lid")} glass={url("glass")} />- <g transform="translate(76 -4)">- {ZS.map(([x, y, scale]) => <g key={x} className={live ? "cloud-scene-z" : undefined} transform={`translate(${x} ${y}) scale(${scale})`}>- <circle r="7.5" fill="var(--cloud-scene-bubble)" stroke="var(--cloud-scene-bubble-edge)" strokeWidth="1" />- <circle cx="-4.3" cy="-4.3" r="1.1" fill="#fff" opacity=".85" />- <path d={Z} fill="none" stroke="#fff" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" />- </g>)}- </g>- </g>- </svg>- <div className="cloud-scene-box" style={place(crew, area, (crew[2] * CREW_AREA[1]) / CREW_AREA[0])}>- <svg className="cloud-scene-layer" viewBox={`0 0 ${CREW_AREA[0]} ${CREW_AREA[1]}`} aria-hidden="true">- <ellipse cx="110" cy="50" rx="140" ry="62" fill={url("mist")} />- <g fill={url("back")}>- <rect x="10" y="44" width="200" height="34" rx="17" />- {BACK_PUFFS.map(([cx, cy, r]) => <circle key={cx} cx={cx} cy={cy} r={r} />)}- </g>- {CREW.map(({ color, spot: [x, y, size] }) => <ellipse key={color} cx={x + size * 0.5} cy={y + size * 0.8} rx={size * 0.5} ry={size * 0.13} fill={url("shadow")} />)}- </svg>- {CREW.map(({ color, state, spot }) => <div key={color} className="cloud-scene-box" style={place(spot, CREW_AREA)}>- <MausAvatar color={color} state={state} size={spot[2]} animated={moving} trackPointer={false} />- </div>)}- <svg className="cloud-scene-layer" viewBox={`0 0 ${CREW_AREA[0]} ${CREW_AREA[1]}`} aria-hidden="true">- <g fill={url("front")}>- <rect x="15" y="60" width="190" height="20" rx="10" />- {FRONT_PUFFS.map(([cx, cy, r]) => <circle key={cx} cx={cx} cy={cy} r={r} />)}- </g>- {CREW.map(({ color, spot: [x, y, size] }) => <ellipse key={color} cx={x + size * 0.48} cy={y + size * 1.02} rx={size * 0.66} ry={size * 0.17} fill={url("lamp")} />)}- </svg>- </div>- </div>- </div>;-});diff --git a/src/components/cloud-buy/CloudMascots.test.ts b/src/components/cloud-buy/CloudMascots.test.tsnew file mode 100644index 0000000000..9d86ce44ed--- /dev/null+++ b/src/components/cloud-buy/CloudMascots.test.ts@@ -0,0 +1,101 @@+// @vitest-environment happy-dom+import { act, createElement } from "react";+import { createRoot, type Root } from "react-dom/client";+import { afterEach, beforeEach, expect, it, vi } from "vitest";+import { MAUS_COLOR_NAMES } from "@/lib/mascot";++type Seen = { color: string; state: string; animated: boolean; trackPointer?: boolean; size: number };+vi.mock("@/components/Avatar", () => ({+ MausAvatar: ({ color, state, animated, trackPointer, size, ...choreography }: Seen) => createElement("i", {+ "data-maus": color, "data-state": state, "data-animated": String(animated), "data-pointer": String(trackPointer), "data-size": String(size),+ "data-extra": Object.keys(choreography).join(",") }),+}));+const { CloudMascots } = await import("./CloudMascots");++(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;+let host: HTMLDivElement, root: Root;+const render = async (size?: number) => { await act(async () => { root.render(createElement(CloudMascots, size === undefined ? {} : { size })); }); };+const mark = () => host.querySelector<HTMLElement>("[data-cloud-mascots]")!;+const mascots = () => [...host.querySelectorAll<HTMLElement>("[data-maus]")];+const animated = () => mascots().map(node => node.dataset.animated);++beforeEach(() => { host = document.createElement("div"); document.body.append(host); root = createRoot(host); });+afterEach(async () => {+ await act(async () => root.unmount());+ host.remove();+ delete document.documentElement.dataset.reducedMotion;+ vi.useRealTimers(); vi.unstubAllGlobals(); vi.restoreAllMocks();+});++it("three of the app's own mascots in three colours, each in its own calm state, small and hidden from screen readers beside the name", async () => {+ await render();+ const colors = mascots().map(node => node.dataset.maus!);+ expect(colors).toHaveLength(3);+ expect(new Set(colors).size).toBe(3);+ for (const color of colors) expect(MAUS_COLOR_NAMES).toContain(color);+ expect(mascots().map(node => node.dataset.state)).toEqual(["working", "idle", "thinking"]);+ expect(mascots().map(node => node.dataset.extra), "no faces, gazes or motions laid on top").toEqual(["", "", ""]);+ expect(mascots().map(node => node.dataset.pointer), "they never follow the pointer").toEqual(["false", "false", "false"]);+ expect(mascots().map(node => node.dataset.size)).toEqual(["20", "20", "20"]);+ expect(mark().getAttribute("aria-hidden")).toBe("true");+ await render(22);+ expect(mascots().map(node => node.dataset.size)).toEqual(["22", "22", "22"]);+});++it("live, the only motion is the mascots' own: no timer or frame of its own", async () => {+ vi.useFakeTimers();+ await render();+ expect(mark().hasAttribute("data-paused")).toBe(false);+ expect(animated()).toEqual(["true", "true", "true"]);+ expect(vi.getTimerCount(), "no setTimeout, setInterval or requestAnimationFrame").toBe(0);+ const markup = host.innerHTML;+ await act(async () => { vi.advanceTimersByTime(60_000); });+ expect(host.innerHTML, "nothing changes on a clock").toBe(markup);+});++it("reduced motion holds them still", async () => {+ document.documentElement.dataset.reducedMotion = "true";+ await render();+ expect(animated()).toEqual(["false", "false", "false"]);+ expect(mark().hasAttribute("data-paused")).toBe(true);+});++it("the system setting or the dev hook, switched while they are shown, stills them at once and lets them go again", async () => {+ let reduce = false;+ const changes = new Set<() => void>();+ vi.spyOn(window, "matchMedia").mockImplementation(query => ({ matches: reduce && query.includes("reduce"), media: query,+ addEventListener: (_: string, changed: () => void) => changes.add(changed), removeEventListener: (_: string, changed: () => void) => changes.delete(changed) }) as unknown as MediaQueryList);+ const still = () => animated().every(flag => flag === "false");+ const moving = () => animated().every(flag => flag === "true");+ await render();+ expect(moving()).toBe(true);+ reduce = true;+ await act(async () => { changes.forEach(changed => changed()); });+ expect(still(), "system setting on").toBe(true);+ reduce = false;+ await act(async () => { changes.forEach(changed => changed()); });+ expect(moving(), "system setting off").toBe(true);+ await act(async () => { document.documentElement.dataset.reducedMotion = "true"; await Promise.resolve(); });+ expect(still(), "dev hook on").toBe(true);+ await act(async () => { delete document.documentElement.dataset.reducedMotion; await Promise.resolve(); });+ expect(moving(), "dev hook off").toBe(true);+});++it("out of view they hold still until they are back", async () => {+ let visible: (seen: boolean) => void = () => {};+ vi.stubGlobal("IntersectionObserver", class {+ constructor(report: IntersectionObserverCallback) {+ visible = seen => report([{ isIntersecting: seen } as IntersectionObserverEntry], this as unknown as IntersectionObserver);+ }+ observe() {}+ disconnect() {}+ });+ await render();+ expect(animated()).toEqual(["true", "true", "true"]);+ await act(async () => visible(false));+ expect(mark().hasAttribute("data-paused")).toBe(true);+ expect(animated()).toEqual(["false", "false", "false"]);+ await act(async () => visible(true));+ expect(mark().hasAttribute("data-paused")).toBe(false);+ expect(animated()).toEqual(["true", "true", "true"]);+});diff --git a/src/components/cloud-buy/CloudMascots.tsx b/src/components/cloud-buy/CloudMascots.tsxnew file mode 100644index 0000000000..f830be0bea--- /dev/null+++ b/src/components/cloud-buy/CloudMascots.tsx@@ -0,0 +1,47 @@+// MausBot Cloud's mark: three of the app's own Maus bots, small, beside the Cloud's name.+import { memo, useEffect, useRef, useState, useSyncExternalStore, type RefObject } from "react";+import { MausAvatar } from "@/components/Avatar";+import type { MausColor, MausState } from "@/lib/mascot";+import { reducedMotion } from "@/lib/onboarding";++/** Each bot keeps one calm state, which the mascot animates by itself (its faces, blinks and a slow bob or sway). */+const CREW: readonly { color: MausColor; state: MausState }[] = [+ { color: "orange", state: "working" },+ { color: "pink", state: "idle" },+ { color: "green", state: "thinking" },+];++function subscribeReducedMotion(changed: () => void) {+ const query = globalThis.window?.matchMedia?.("(prefers-reduced-motion: reduce)");+ query?.addEventListener?.("change", changed);+ const root = globalThis.document?.documentElement;+ const hook = root && typeof MutationObserver === "function" ? new MutationObserver(changed) : null;+ if (root) hook?.observe(root, { attributes: true, attributeFilter: ["data-reduced-motion"] });+ return () => {+ query?.removeEventListener?.("change", changed);+ hook?.disconnect();+ };+}++function useInView(target: RefObject<HTMLElement | null>) {+ const [inView, setInView] = useState(true);+ useEffect(() => {+ const node = target.current;+ if (!node || typeof IntersectionObserver !== "function") return;+ const watch = new IntersectionObserver(entries => setInView(entries.at(-1)?.isIntersecting ?? true));+ watch.observe(node);+ return () => watch.disconnect();+ }, [target]);+ return inView;+}++/** Hidden from screen readers: the name beside it says what it is. */+export const CloudMascots = memo(function CloudMascots({ size = 20 }: { size?: number }) {+ const root = useRef<HTMLSpanElement>(null);+ const inView = useInView(root);+ const live = !useSyncExternalStore(subscribeReducedMotion, reducedMotion, reducedMotion);+ const moving = live && inView;+ return <span ref={root} aria-hidden="true" data-cloud-mascots="" data-paused={moving ? undefined : ""} className="inline-flex shrink-0 items-center gap-0.5">+ {CREW.map(({ color, state }) => <MausAvatar key={color} color={color} state={state} size={size} animated={moving} trackPointer={false} />)}+ </span>;+});diff --git a/src/components/cloud-buy/OneCloudScreen.tsx b/src/components/cloud-buy/OneCloudScreen.tsxindex 8a644f5129..141b3f7f37 100644--- a/src/components/cloud-buy/OneCloudScreen.tsx+++ b/src/components/cloud-buy/OneCloudScreen.tsx@@ -2,19 +2,21 @@import { Loader2 } from "lucide-react";import type { CloudColor } from "../../../electron/cloud-buy.mjs";import { t } from "@/lib/i18n";-import { CloudTile, Heading } from "./parts";+import { ACTIONS, CloudTile, Heading, PRIMARY, QUIET, SCREEN } from "./parts";export function OneCloudScreen({ name, color, busy, interest, openFailed, onInterest, onOpen }: {name: string; color: CloudColor; busy: boolean; interest: "sent" | "failed" | null; openFailed: boolean; onInterest: () => void; onOpen: () => void;}) {- return <div data-cloud-add="has-cloud" className="flex flex-col gap-4 px-[30px] pb-[26px] pt-7">- <CloudTile color={color} size={36} />- <Heading title={t("cloudBuy.one.title")} sub={t("cloudBuy.one.sub", { name })} />- <div className="flex flex-wrap items-center justify-end gap-2">- {interest !== "sent" && <button type="button" className="ui-button" disabled={busy} onClick={onInterest}>{t("cloudBuy.one.email")}</button>}- <button type="button" className="ui-button ui-button-primary" disabled={busy} onClick={onOpen}>{t("cloudBuy.setup.open", { name })}</button>+ return <div data-cloud-add="has-cloud" className={SCREEN}>+ <div className="flex flex-col gap-3">+ <CloudTile color={color} size={32} />+ <Heading title={t("cloudBuy.one.title")} sub={t("cloudBuy.one.sub", { name })} /></div>- <div aria-live="polite" className="text-[13px] empty:-mt-4">+ <div className={ACTIONS}>+ {interest !== "sent" && <button type="button" className={QUIET} disabled={busy} onClick={onInterest}>{t("cloudBuy.one.email")}</button>}+ <button type="button" className={PRIMARY} disabled={busy} onClick={onOpen}>{t("cloudBuy.setup.open", { name })}</button>+ </div>+ <div aria-live="polite" className="text-[13px] leading-[18px] empty:-mt-5">{interest === "sent" && <p className="text-ink-secondary">{t("cloudBuy.one.thanks")}</p>}{interest === "failed" && <p role="alert" className="text-danger">{t("cloudBuy.one.failed")}</p>}{openFailed && <p role="alert" className="text-danger">{t("cloudBuy.openFailed", { name })}</p>}@@ -24,13 +26,13 @@ export function OneCloudScreen({ name, color, busy, interest, openFailed, onInte/** Checking, Cloud out of reach, or a checkout that did not open: one line and one next step. */export function StatusScreen({ kind, line, onRetry, onClose }: { kind: string; line: string | null; onRetry?: () => void; onClose: () => void }) {- return <div data-cloud-add={kind} className="flex flex-col gap-4 px-[30px] pb-[26px] pt-7">+ return <div data-cloud-add={kind} className={SCREEN}><Heading title={t("cloudAdd.title")} />- {line ? <p role="alert" className="text-[14px] leading-relaxed text-ink">{line}</p>- : <p role="status" className="flex items-center gap-2 text-[13px] text-ink-secondary"><Loader2 size={14} className="animate-spin motion-reduce:animate-none" aria-hidden="true" />{t("cloudAdd.checking")}</p>}- <div className="flex flex-wrap items-center justify-end gap-2">- <button type="button" className="ui-button" onClick={onClose}>{t("cloudAdd.close")}</button>- {onRetry && <button type="button" className="ui-button ui-button-primary" onClick={onRetry}>{t("cloudAdd.tryAgain")}</button>}+ {line ? <p role="alert" className="text-[14px] leading-5 text-ink">{line}</p>+ : <p role="status" className="flex items-center gap-2 text-[13px] leading-[18px] text-ink-secondary"><Loader2 size={14} className="animate-spin motion-reduce:animate-none" aria-hidden="true" />{t("cloudAdd.checking")}</p>}+ <div className={ACTIONS}>+ <button type="button" className={QUIET} onClick={onClose}>{t("cloudAdd.close")}</button>+ {onRetry && <button type="button" className={PRIMARY} onClick={onRetry}>{t("cloudAdd.tryAgain")}</button>}</div></div>;}diff --git a/src/components/cloud-buy/PayScreen.tsx b/src/components/cloud-buy/PayScreen.tsxindex 571c7cf42f..ba4cc45338 100644--- a/src/components/cloud-buy/PayScreen.tsx+++ b/src/components/cloud-buy/PayScreen.tsx@@ -3,7 +3,7 @@ import { Copy, ExternalLink } from "lucide-react";import type { CloudOffer } from "../../../electron/cloud-home.mjs";import { cloudPlanLabel, dueToday, offerPlanLabel, usd } from "@/lib/cloud-plan";import { t } from "@/lib/i18n";-import { Checklist, Heading, LINK } from "./parts";+import { Checklist, Heading, LINK, PRIMARY, QUIET, SCREEN } from "./parts";export function PayScreen({ plan, offer, browser, late, link, email, busy, copied, failed, onReopen, onCopy, onChangePlan }: {plan: string; offer: CloudOffer | null; browser: "checkout" | "signin"; late: boolean; link: boolean; email: string | null;@@ -13,7 +13,7 @@ export function PayScreen({ plan, offer, browser, late, link, email, busy, copieconst name = sold ? offerPlanLabel(sold) : cloudPlanLabel(plan);const detail = sold?.trialDays ? t("cloudBuy.pay.planTrial", { plan: name, days: sold.trialDays, due: dueToday(0) }): sold ? t("cloudBuy.pay.planPaid", { plan: name, price: usd(sold.amount / 100) }) : name;- return <div data-cloud-add={late ? "waiting-late" : browser === "signin" ? "waiting-signin" : "waiting"} className="flex flex-col gap-4 px-[30px] pb-[26px] pt-7">+ return <div data-cloud-add={late ? "waiting-late" : browser === "signin" ? "waiting-signin" : "waiting"} className={SCREEN}><Heading title={late ? t("cloudBuy.pay.lateTitle") : t("cloudAdd.browserTitle")}sub={late ? t("cloudBuy.pay.lateSub") : t(browser === "signin" ? "cloudBuy.pay.subSignIn" : "cloudBuy.pay.sub")} /><Checklist items={[@@ -22,12 +22,12 @@ export function PayScreen({ plan, offer, browser, late, link, email, busy, copie{ key: "setup", state: "next", title: t("cloudBuy.pay.setup"), detail: t("cloudBuy.pay.setupHint") },]} /><div className="flex flex-wrap items-center gap-2">- <button type="button" className={late ? "ui-button ui-button-primary" : "ui-button"} disabled={busy} onClick={onReopen}>+ <button type="button" className={late ? PRIMARY : QUIET} disabled={busy} onClick={onReopen}><ExternalLink size={14} aria-hidden="true" />{t("cloudAdd.reopenCheckout")}</button>- {link && <button type="button" className="ui-button" disabled={busy} onClick={onCopy}><Copy size={14} aria-hidden="true" />{t("cloudBuy.pay.copy")}</button>}- <button type="button" className={`${LINK} px-1 py-1`} onClick={onChangePlan}>{t("cloudAdd.changePlan")}</button>+ {link && <button type="button" className={QUIET} disabled={busy} onClick={onCopy}><Copy size={14} aria-hidden="true" />{t("cloudBuy.pay.copy")}</button>}+ <button type="button" className={`${LINK} ms-1 px-1 py-1`} onClick={onChangePlan}>{t("cloudAdd.changePlan")}</button></div>- <div aria-live="polite" className="text-[13px] empty:-mt-4">+ <div aria-live="polite" className="text-[13px] leading-[18px] empty:-mt-5">{copied && <p className="text-ink-secondary">{t("cloudBuy.pay.copied")}</p>}{failed && <p role="alert" className="text-danger">{t("cloudBuy.pay.failed")}</p>}</div>diff --git a/src/components/cloud-buy/SetupScreen.tsx b/src/components/cloud-buy/SetupScreen.tsxindex ef8c59301f..9d6093e6b8 100644--- a/src/components/cloud-buy/SetupScreen.tsx+++ b/src/components/cloud-buy/SetupScreen.tsx@@ -6,7 +6,7 @@ import { CLOUD_COLOR_LABEL, CLOUD_COLORS, CLOUD_NAME_MAX, cloudColorFill } fromimport { cloudPlanLabel, usd, type CloudStarted } from "@/lib/cloud-plan";import { t } from "@/lib/i18n";import type { LocaleKey } from "@/locales";-import { Badge, Checklist, CloudTile, FIELD, Heading, ProgressBar } from "./parts";+import { ACTIONS, Badge, Checklist, CloudTile, FIELD, Heading, PRIMARY, ProgressBar, QUIET, SCREEN } from "./parts";const STEPS = [["reserving", "cloudHome.step.reserving"], ["storage", "cloudHome.step.storage"], ["starting", "cloudBuy.step.starting"], ["checking", "cloudHome.step.checking"]] as const satisfiesReadonlyArray<readonly [CloudSetupStep, LocaleKey]>;@@ -28,27 +28,29 @@ export function SetupScreen({ started, received, step, slow, ready, sleeps = fal}) {const at = ready ? STEPS.length : Math.max(0, STEPS.findIndex(([key]) => key === step));const plan = cloudPlanLabel(started.tier ?? started.trial?.tier ?? undefined);- return <div data-cloud-add={ready ? "ready" : received ? "received" : "starting"} data-cloud-setup={ready ? "ready" : step ?? "reserving"} className="flex flex-col gap-4 px-[30px] pb-[26px] pt-7">- <Badge>{startedBadge(started, received)}</Badge>- <Heading title={ready ? t("cloudBuy.ready.title", { name }) : t("cloudBuy.setup.title")}- sub={ready ? t("cloudBuy.ready.sub") : received ? t("cloudAccount.purchaseNoteNoDate") : t("cloudBuy.setup.sub")} />- <div className="grid gap-[18px] sm:grid-cols-2">+ return <div data-cloud-add={ready ? "ready" : received ? "received" : "starting"} data-cloud-setup={ready ? "ready" : step ?? "reserving"} className={SCREEN}>+ <div className="flex flex-col gap-3">+ <Badge>{startedBadge(started, received)}</Badge>+ <Heading title={ready ? t("cloudBuy.ready.title", { name }) : t("cloudBuy.setup.title")}+ sub={ready ? t("cloudBuy.ready.sub") : received ? t("cloudAccount.purchaseNoteNoDate") : t("cloudBuy.setup.sub")} />+ </div>+ <div className="grid gap-6 sm:grid-cols-2"><div className="flex flex-col gap-3"><ProgressBar value={at / STEPS.length} label={t("cloudBuy.setup.progress")} /><Checklist label={t("cloudBuy.setup.progress")} items={STEPS.map(([key, label], index) => ({key, title: t(label, { name }),state: index < at ? "done" as const : index === at ? "now" as const : "next" as const,}))} />- {slow && !ready && <p role="status" className="text-[13px] text-ink-secondary">{t("cloudHome.slow")}</p>}+ {slow && !ready && <p role="status" className="px-3 text-[13px] leading-[18px] text-ink-secondary">{t("cloudHome.slow")}</p>}</div>- <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-4"><div className="flex flex-col gap-1.5">- <label htmlFor="cloud-add-name" className="text-[13px] font-medium text-ink-secondary">{t("cloudBuy.setup.name")}</label>+ <label htmlFor="cloud-add-name" className="text-[13px] leading-[18px] text-ink-secondary">{t("cloudBuy.setup.name")}</label><input id="cloud-add-name" value={typed} maxLength={CLOUD_NAME_MAX} placeholder={t("cloudSetup.myCloud")} autoComplete="off" spellCheck={false}onChange={event => onName(event.target.value)} className={FIELD} /></div><div className="flex flex-col gap-1.5">- <span id="cloud-add-color" className="text-[13px] font-medium text-ink-secondary">{t("cloudBuy.setup.color")}</span>+ <span id="cloud-add-color" className="text-[13px] leading-[18px] text-ink-secondary">{t("cloudBuy.setup.color")}</span><div role="radiogroup" aria-labelledby="cloud-add-color" className="flex flex-wrap gap-2">{CLOUD_COLORS.map(option => <button key={option} type="button" role="radio" aria-checked={option === color} aria-label={t(CLOUD_COLOR_LABEL[option])}tabIndex={option === color ? 0 : -1} data-color={option} onClick={() => onColor(option)}@@ -62,26 +64,26 @@ export function SetupScreen({ started, received, step, slow, ready, sleeps = fal}}style={{ background: cloudColorFill(option) }}className={cn("size-[26px] rounded-lg border-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",- option === color ? "border-ink shadow-[inset_0_0_0_2px_var(--color-panel)]" : "border-transparent")} />)}+ option === color ? "border-ink shadow-[inset_0_0_0_2px_var(--color-app)]" : "border-transparent")} />)}</div></div><div className="flex flex-col gap-1.5">- <span className="text-[13px] font-medium text-ink-secondary">{t("cloudBuy.setup.preview")}</span>- <span data-cloud-preview className="inline-flex max-w-full items-center gap-2 self-start rounded-[10px] border border-hairline/70 bg-app py-1.5 pe-2.5 ps-1.5">+ <span className="text-[13px] leading-[18px] text-ink-secondary">{t("cloudBuy.setup.preview")}</span>+ <span data-cloud-preview className="inline-flex max-w-full items-center gap-2 self-start rounded-[12px] border-[0.5px] border-ink/10 bg-menu py-1.5 pe-3 ps-1.5"><CloudTile color={color} />- <span className="min-w-0"><span className="block truncate text-[13px] font-semibold leading-tight text-ink">{name}</span>+ <span className="min-w-0"><span className="block truncate text-[13px] font-medium leading-4 text-ink">{name}</span><span className="block truncate text-[12px] text-ink-tertiary">{t(sleeps ? "cloudBuy.setup.previewLineSleeps" : "cloudBuy.setup.previewLine", { plan })}</span></span></span></div></div></div>- <div className="flex flex-wrap items-center justify-end gap-x-3 gap-y-2">- {counting !== null && <span role="status" className="text-[13px] text-ink-secondary">{t("cloudBuy.setup.openingIn", { seconds: counting })}</span>}- {counting !== null && <button type="button" className="ui-button" onClick={onNotNow}>{t("notice.notNow")}</button>}- <button type="button" className="ui-button ui-button-primary" disabled={!ready || busy} onClick={onOpen}>{t("cloudBuy.setup.open", { name })}</button>+ {ready && counting === null && <p className="text-[13px] leading-[18px] text-ink-tertiary">{t("cloudBuy.ready.hint", { name })}</p>}+ <div className={ACTIONS}>+ {counting !== null && <span role="status" className="me-1 text-[13px] text-ink-secondary">{t("cloudBuy.setup.openingIn", { seconds: counting })}</span>}+ {counting !== null && <button type="button" className={QUIET} onClick={onNotNow}>{t("notice.notNow")}</button>}+ <button type="button" className={PRIMARY} disabled={!ready || busy} onClick={onOpen}>{t("cloudBuy.setup.open", { name })}</button></div>- {ready && counting === null && <p className="text-[12px] text-ink-tertiary">{t("cloudBuy.ready.hint", { name })}</p>}- {openFailed && <p role="alert" className="text-[13px] text-danger">{t("cloudBuy.openFailed", { name })}</p>}+ {openFailed && <p role="alert" className="-mt-2 text-end text-[13px] leading-[18px] text-danger">{t("cloudBuy.openFailed", { name })}</p>}</div>;}@@ -89,24 +91,26 @@ export function SetupScreen({ started, received, step, slow, ready, sleeps = fal* colour here: the team's name is the Admin's. */export function TeamSetupScreen({ team, step, slow }: { team: string | null; step: CloudSetupStep | null; slow: boolean }) {const at = Math.max(0, STEPS.findIndex(([key]) => key === step)), name = team ?? t("cloudBuy.team.unnamed");- return <div data-cloud-add="team-starting" data-cloud-setup={step ?? "reserving"} className="flex flex-col gap-4 px-[30px] pb-[26px] pt-7">+ return <div data-cloud-add="team-starting" data-cloud-setup={step ?? "reserving"} className={SCREEN}><Heading title={t("cloudBuy.team.setupTitle")} sub={t("cloudBuy.team.setupSub")} />- <ProgressBar value={at / STEPS.length} label={t("cloudBuy.setup.progress")} />- <Checklist label={t("cloudBuy.setup.progress")} items={STEPS.map(([key, label], index) => ({- key, title: t(label, { name }), state: index < at ? "done" as const : index === at ? "now" as const : "next" as const,- }))} />- {slow && <p role="status" className="text-[13px] text-ink-secondary">{t("cloudHome.slow")}</p>}+ <div className="flex flex-col gap-3">+ <ProgressBar value={at / STEPS.length} label={t("cloudBuy.setup.progress")} />+ <Checklist label={t("cloudBuy.setup.progress")} items={STEPS.map(([key, label], index) => ({+ key, title: t(label, { name }), state: index < at ? "done" as const : index === at ? "now" as const : "next" as const,+ }))} />+ {slow && <p role="status" className="px-3 text-[13px] leading-[18px] text-ink-secondary">{t("cloudHome.slow")}</p>}+ </div></div>;}/** A Team or Business plan's Cloud, ready: the team's, opened as the switcher opens it. */export function TeamReadyScreen({ name, busy, openFailed, onOpen }: { name: string; busy: boolean; openFailed: boolean; onOpen: () => void }) {- return <div data-cloud-add="team-ready" className="flex flex-col gap-4 px-[30px] pb-[26px] pt-7">+ return <div data-cloud-add="team-ready" className={SCREEN}><Heading title={t("cloudBuy.team.readyTitle")} sub={t("cloudBuy.team.readySub", { name })} />- <div className="flex flex-wrap items-center justify-end gap-2">- <button type="button" data-autofocus className="ui-button ui-button-primary" disabled={busy} onClick={onOpen}>{t("cloudBuy.setup.open", { name })}</button>+ <p className="text-[13px] leading-[18px] text-ink-tertiary">{t("cloudBuy.ready.hint", { name })}</p>+ <div className={ACTIONS}>+ <button type="button" data-autofocus className={PRIMARY} disabled={busy} onClick={onOpen}>{t("cloudBuy.setup.open", { name })}</button></div>- <p className="text-[12px] text-ink-tertiary">{t("cloudBuy.ready.hint", { name })}</p>- {openFailed && <p role="alert" className="text-[13px] text-danger">{t("cloudBuy.openFailed", { name })}</p>}+ {openFailed && <p role="alert" className="-mt-2 text-end text-[13px] leading-[18px] text-danger">{t("cloudBuy.openFailed", { name })}</p>}</div>;}diff --git a/src/components/cloud-buy/SignInScreen.tsx b/src/components/cloud-buy/SignInScreen.tsxindex 68e232b8a4..4d64d65686 100644--- a/src/components/cloud-buy/SignInScreen.tsx+++ b/src/components/cloud-buy/SignInScreen.tsx@@ -1,9 +1,10 @@// Screen 2: sign in inside the sheet with an emailed code; single sign-on and two-step accounts continue in the browser.import type { ClipboardEvent, FormEvent, KeyboardEvent } from "react";import { Check, ExternalLink, Loader2 } from "lucide-react";+import { cn } from "@/lib/cn";import type { CloudSignInPhase, CloudSignInProblem } from "@/lib/cloud-plan";import { t } from "@/lib/i18n";-import { BackLink, FIELD, Heading, LINK, PRIMARY_WIDE } from "./parts";+import { ACTIONS, BackLink, FIELD, Heading, LINK, PRIMARY, PRIMARY_WIDE, QUIET, SCREEN } from "./parts";const DIGITS = 8;const BROWSER_PROBLEMS: ReadonlySet<CloudSignInProblem> = new Set(["sso", "two-factor", "browser"]);@@ -58,23 +59,23 @@ export function SignInScreen({ phase, email, code, profileEmail, busy, now, onBafocusBox(event.currentTarget, Math.min(DIGITS - 1, pasted.length));};const submit = (event: FormEvent) => { event.preventDefault(); if (!busy) onSend(); };- return <div data-cloud-add={`sign-in-${phase.step}`} className="flex flex-col gap-4 px-[30px] pb-[26px] pt-7">- <div>+ return <div data-cloud-add={`sign-in-${phase.step}`} className={SCREEN}>+ <div className="flex flex-col gap-3"><BackLink label={t("cloudBuy.back")} onClick={onBack} /><Heading title={title} sub={t("cloudBuy.signIn.sub")} /></div>{phase.step === "email" && <form className="flex flex-col gap-1.5" onSubmit={submit} noValidate>- <label htmlFor="cloud-add-email" className="text-[13px] font-medium text-ink-secondary">{t("cloudBuy.signIn.email")}</label>+ <label htmlFor="cloud-add-email" className="text-[13px] leading-[18px] text-ink-secondary">{t("cloudBuy.signIn.email")}</label><input id="cloud-add-email" data-autofocus type="email" autoComplete="email" inputMode="email" spellCheck={false} value={email} disabled={busy}aria-invalid={problem === "invalid-email" || undefined} aria-describedby={problem ? "cloud-add-problem" : undefined}onChange={event => onEmail(event.target.value)} className={FIELD} />- <button type="submit" className={`${PRIMARY_WIDE} mt-1.5`} disabled={busy || !email.trim()}>+ <button type="submit" className={`${PRIMARY_WIDE} mt-2`} disabled={busy || !email.trim()}>{busy && <Loader2 size={16} className="animate-spin motion-reduce:animate-none" aria-hidden="true" />}{t("cloudBuy.signIn.send")}</button>- {profileEmail && email.trim().toLowerCase() === profileEmail.trim().toLowerCase() && <p className="text-[13px] text-ink-tertiary">{t("cloudBuy.signIn.fromProfile")}</p>}+ {profileEmail && email.trim().toLowerCase() === profileEmail.trim().toLowerCase() && <p className="text-[13px] leading-[18px] text-ink-tertiary">{t("cloudBuy.signIn.fromProfile")}</p>}</form>}- {phase.step === "code" && <div className="flex flex-col gap-2">- <p id="cloud-add-code-label" className="text-[13px] font-medium text-ink-secondary">+ {phase.step === "code" && <div className="flex flex-col gap-2.5">+ <p id="cloud-add-code-label" className="text-[13px] leading-[18px] text-ink-secondary">{t("cloudBuy.signIn.codeLabel", { email: phase.email })} · <button type="button" className={LINK} disabled={busy} onClick={onChangeEmail}>{t("cloudBuy.signIn.change")}</button></p><div role="group" aria-labelledby="cloud-add-code-label" className="grid grid-cols-8 gap-1.5" dir="ltr">@@ -84,24 +85,25 @@ export function SignInScreen({ phase, email, code, profileEmail, busy, now, onBaaria-invalid={problem === "wrong-code" || undefined} aria-describedby={problem ? "cloud-add-problem" : undefined}onChange={event => typeDigit(index, event.target.value, event.currentTarget)} onKeyDown={onKeyDown(index)} onPaste={onPaste}onFocus={event => event.currentTarget.select()}- className={`${FIELD} min-w-0 px-0 py-2.5 text-center text-[20px] font-semibold tabular-nums`} />)}+ className={cn(FIELD, "h-11 min-w-0 px-0 text-center text-[20px] font-medium tabular-nums")} />)}</div>- {phase.signupOpen === false && <p data-cloud-signup-closed className="text-[13px] leading-relaxed text-ink-secondary">{t("cloudBuy.signIn.signupClosedNote")}</p>}+ {phase.signupOpen === false && <p data-cloud-signup-closed className="text-[13px] leading-[18px] text-ink-secondary">{t("cloudBuy.signIn.signupClosedNote")}</p>}<div className="flex min-h-6 items-center justify-between gap-3 text-[13px] text-ink-tertiary">{busy ? <span role="status" className="inline-flex items-center gap-1.5"><Loader2 size={13} className="animate-spin motion-reduce:animate-none" aria-hidden="true" />{t("cloudBuy.signIn.checking")}</span>: phase.resendAt > now ? <span>{t("cloudBuy.signIn.resendIn", { time: clock(phase.resendAt - now) })}</span>: <button type="button" className={LINK} onClick={onResend}>{t("cloudBuy.signIn.resend")}</button>}</div></div>}- {phase.step === "done" && <p role="status" className="flex items-center gap-2 text-[14px] font-medium text-success">- <Check size={18} strokeWidth={2.6} aria-hidden="true" />{phase.intent ? t("cloudBuy.signIn.done") : t("cloudBuy.signIn.donePlain")}+ {phase.step === "done" && <p role="status" className="flex items-center gap-2 text-[14px] leading-5 text-ink">+ <span aria-hidden="true" className="grid size-5 shrink-0 place-items-center rounded-full bg-ink text-app"><Check size={12} strokeWidth={2.4} /></span>+ {phase.intent ? t("cloudBuy.signIn.done") : t("cloudBuy.signIn.donePlain")}</p>}- {problem && <div id="cloud-add-problem" role="alert" className="flex flex-col items-start gap-2.5 rounded-xl border border-hairline/70 bg-card/70 px-3.5 py-3 text-[13px] text-ink">+ {problem && <div id="cloud-add-problem" role="alert" className="flex flex-col items-start gap-3 rounded-[12px] bg-ink/[0.04] px-4 py-3 text-[13px] leading-[18px] text-ink"><p>{problemLine(problem, phase.step === "code" ? phase.triesLeft : null)}</p>- {browser && <button type="button" className="ui-button ui-button-primary" onClick={onBrowser}>{t("cloudBuy.signIn.continueBrowser")}<ExternalLink size={14} aria-hidden="true" /></button>}- {problem === "expired" && phase.step === "code" && <button type="button" className="ui-button" disabled={busy} onClick={onResend}>{t("cloudBuy.signIn.newCode")}</button>}+ {browser && <button type="button" className={PRIMARY} onClick={onBrowser}>{t("cloudBuy.signIn.continueBrowser")}<ExternalLink size={14} aria-hidden="true" /></button>}+ {problem === "expired" && phase.step === "code" && <button type="button" className={QUIET} disabled={busy} onClick={onResend}>{t("cloudBuy.signIn.newCode")}</button>}</div>}- {phase.step !== "done" && !browser && <p className="text-[13px] text-ink-tertiary">{t("cloudBuy.signIn.ssoHint")}{" "}+ {phase.step !== "done" && !browser && <p className="text-[13px] leading-[18px] text-ink-tertiary">{t("cloudBuy.signIn.ssoHint")}{" "}<button type="button" className={LINK} onClick={onBrowser}>{t("cloudBuy.signIn.continueBrowser")}</button></p>}</div>;}@@ -110,16 +112,16 @@ export function SignInScreen({ phase, email, code, profileEmail, busy, now, onBaexport function BrowserSignInScreen({ code, checkout, trial, busy, onReopen, onCancel }: {code: string | null; checkout: boolean; trial: boolean; busy: boolean; onReopen: () => void; onCancel: () => void;}) {- return <div data-cloud-add="signing-in" className="flex flex-col gap-4 px-[30px] pb-[26px] pt-7">+ return <div data-cloud-add="signing-in" className={SCREEN}><Heading title={t("cloudAdd.browserTitle")} />- {code ? <ol className="list-decimal ps-5 text-[14px] leading-relaxed text-ink marker:text-ink-tertiary">+ {code ? <ol className="flex list-decimal flex-col gap-1.5 ps-5 text-[14px] leading-5 text-ink marker:text-ink-tertiary"><li>{t("cloudAdd.signInStep1")}</li>- <li>{t("cloudAccount.codeCheck")}<code dir="ltr" className="mt-1 block select-all text-[18px] font-semibold tracking-widest">{code}</code></li>+ <li>{t("cloudAccount.codeCheck")}<code dir="ltr" className="mt-1.5 block w-fit select-all rounded-[10px] bg-ink/[0.05] px-3 py-1.5 font-mono text-[17px] font-medium tracking-[0.12em]">{code}</code></li><li>{t(!checkout ? "cloudAdd.signInStep3Connect" : trial ? "cloudAdd.signInStep3Trial" : "cloudAdd.signInStep3")}</li></ol> : <p role="status" className="flex items-center gap-2 text-[13px] text-ink-secondary"><Loader2 size={14} className="animate-spin motion-reduce:animate-none" aria-hidden="true" />{t("cloudAdd.opening")}</p>}- <div className="flex flex-wrap items-center justify-end gap-2">- <button type="button" className="ui-button" disabled={busy} onClick={onCancel}>{t("cloudAdd.cancel")}</button>- <button type="button" className="ui-button ui-button-primary" disabled={busy || !code} onClick={onReopen}>{t("cloudAdd.reopenBrowser")}<ExternalLink size={14} aria-hidden="true" /></button>+ <div className={ACTIONS}>+ <button type="button" className={QUIET} disabled={busy} onClick={onCancel}>{t("cloudAdd.cancel")}</button>+ <button type="button" className={PRIMARY} disabled={busy || !code} onClick={onReopen}>{t("cloudAdd.reopenBrowser")}<ExternalLink size={14} aria-hidden="true" /></button></div></div>;}diff --git a/src/components/cloud-buy/parts.tsx b/src/components/cloud-buy/parts.tsxindex 5cf107cf6b..873384ad8c 100644--- a/src/components/cloud-buy/parts.tsx+++ b/src/components/cloud-buy/parts.tsx@@ -1,45 +1,60 @@// The buying sheet's small pieces, drawn only with the skin's tokens so every skin gets its own version.-import type { ReactNode } from "react";+import type { HTMLAttributes, ReactNode } from "react";import { Check, ChevronLeft, Cloud } from "lucide-react";import { cn } from "@/lib/cn";import { cloudColorFill } from "@/lib/cloud-look";import { t } from "@/lib/i18n";-/** The app's primary action, full width, for the one next step of a screen. */-export const PRIMARY_WIDE = "ui-button ui-button-primary min-h-11 w-full rounded-xl px-4 text-[15px] font-semibold";-export const LINK = "rounded-md text-[13px] font-medium text-accent-text underline-offset-2 hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus disabled:opacity-50";-export const FIELD = "w-full rounded-lg border border-hairline bg-app px-3 py-2.5 text-[14px] text-ink outline-none transition-[border-color,box-shadow] duration-150 placeholder:text-ink-tertiary focus:border-accent focus:ring-[3px] focus:ring-accent/25 disabled:opacity-60 motion-reduce:transition-none";+export const SHEET = "rounded-2xl border-[0.5px] border-ink/10 bg-app text-ink";+export const SCREEN = "flex flex-col gap-5 px-6 pb-6 pt-5";+export const CLOSE = "flex size-8 items-center justify-center rounded-full text-ink-secondary transition-colors hover:bg-ink/[0.06] hover:text-ink motion-reduce:transition-none";+/** A neutral ink pill in Midnight and Daylight, the skin's accent elsewhere. */+export const PRIMARY = "ui-button ui-button-primary ui-button-pill";+export const QUIET = "ui-button ui-button-pill";+export const PRIMARY_WIDE = `${PRIMARY} ui-button-lg w-full`;+export const QUIET_WIDE = `${QUIET} ui-button-lg w-full`;+export const ACTIONS = "flex flex-wrap items-center justify-end gap-2";+export const LINK = "rounded-sm text-[13px] font-medium text-ink underline decoration-ink/30 underline-offset-[3px] hover:decoration-ink disabled:opacity-50";+export const FIELD = "h-9 w-full rounded-[10px] border border-ink/15 bg-transparent px-3 text-[14px] text-ink outline-none transition-[border-color] duration-150 placeholder:text-ink-tertiary disabled:opacity-60 motion-reduce:transition-none";+const TAG = "inline-flex min-h-5 items-center gap-1 rounded-full bg-ink/[0.06] px-2 text-[12px] font-medium leading-4 text-ink-secondary";-export function Heading({ title, sub }: { title: string; sub?: ReactNode }) {- return <div className="pe-8">- <h2 id="cloud-add-title" tabIndex={-1} className="text-[22px] font-semibold leading-tight tracking-[-0.02em] text-ink outline-none [text-wrap:balance]">{title}</h2>- {sub && <p className="mt-1.5 text-[14px] leading-relaxed text-ink-secondary">{sub}</p>}+export function Heading({ title, sub, mark }: { title: string; sub?: ReactNode; mark?: ReactNode }) {+ return <div className="flex flex-col gap-1 pe-10">+ <div className="flex items-center gap-2.5">+ {mark}+ <h2 id="cloud-add-title" tabIndex={-1} className="text-[17px] font-medium leading-6 tracking-[-0.008em] text-ink outline-none! [text-wrap:balance]">{title}</h2>+ </div>+ {sub && <p className="text-[14px] leading-5 text-ink-secondary [text-wrap:pretty]">{sub}</p>}</div>;}export function BackLink({ label, onClick }: { label: string; onClick: () => void }) {return <button type="button" onClick={onClick}- className="-ms-1 mb-2 inline-flex items-center gap-0.5 rounded-md px-1 py-0.5 text-[13px] text-ink-secondary hover:text-ink focus-visible:outline-2 focus-visible:outline-focus">- <ChevronLeft size={15} aria-hidden="true" />{label}+ className="-ms-1.5 inline-flex items-center gap-0.5 self-start rounded-full py-1 pe-2.5 ps-1 text-[13px] leading-[18px] text-ink-secondary transition-colors hover:bg-ink/[0.06] hover:text-ink motion-reduce:transition-none">+ <ChevronLeft size={16} strokeWidth={1.5} aria-hidden="true" className="rtl:-scale-x-100" />{label}</button>;}+export function Tag({ children, className, ...props }: HTMLAttributes<HTMLSpanElement>) {+ return <span {...props} className={cn(TAG, className)}>{children}</span>;+}+/** A step of a short checklist: done (a tick), now (turning, still in reduced motion), or next (an empty ring). */-export function StepMark({ state, size = 22 }: { state: "done" | "now" | "next"; size?: number }) {+export function StepMark({ state, size = 20 }: { state: "done" | "now" | "next"; size?: number }) {if (state === "done") return <span aria-hidden="true" style={{ width: size, height: size }}- className="grid shrink-0 place-items-center rounded-full bg-success text-[var(--color-success-ink)]"><Check size={Math.round(size * 0.62)} strokeWidth={2.6} /></span>;+ className="grid shrink-0 place-items-center rounded-full bg-ink text-app"><Check size={Math.round(size * 0.6)} strokeWidth={2.4} /></span>;return <span aria-hidden="true" style={{ width: size, height: size }}- className={cn("block shrink-0 rounded-full border-2", state === "now" ? "animate-spin border-accent/25 border-t-accent motion-reduce:animate-none" : "border-hairline")} />;+ className={cn("block shrink-0 rounded-full border-[1.5px]", state === "now" ? "animate-spin border-ink/15 border-t-ink motion-reduce:animate-none" : "border-ink/20")} />;}export function Checklist({ items, label }: { label?: string; items: Array<{ key: string; state: "done" | "now" | "next"; title: string; detail?: string | null }> }) {- return <ol aria-label={label} className="flex flex-col gap-1">+ return <ol aria-label={label} className="flex flex-col gap-0.5">{items.map(item => <li key={item.key} aria-current={item.state === "now" ? "step" : undefined}- className={cn("grid grid-cols-[22px_minmax(0,1fr)] items-start gap-3 rounded-xl px-3 py-2.5", item.state === "now" && "bg-accent/10")}>+ className={cn("grid grid-cols-[20px_minmax(0,1fr)] items-start gap-3 rounded-[12px] px-3 py-2.5", item.state === "now" && "bg-ink/[0.04]")}><StepMark state={item.state} /><span className="min-w-0">- <span className={cn("block text-[14px] font-semibold", item.state === "next" ? "text-ink-secondary" : "text-ink")}>{item.title}</span>- {item.detail && <span className="block break-words text-[13px] text-ink-secondary">{item.detail}</span>}+ <span className={cn("block text-[14px] leading-5", item.state === "next" ? "text-ink-secondary" : "text-ink")}>{item.title}</span>+ {item.detail && <span className="block break-words text-[13px] leading-[18px] text-ink-secondary">{item.detail}</span>}</span></li>)}</ol>;@@ -47,8 +62,8 @@ export function Checklist({ items, label }: { label?: string; items: Array<{ keyexport function ProgressBar({ value, label }: { value: number; label: string }) {const percent = Math.round(Math.max(0, Math.min(1, value)) * 100);- return <div role="progressbar" aria-label={label} aria-valuemin={0} aria-valuemax={100} aria-valuenow={percent} className="h-1.5 overflow-hidden rounded-full bg-raised">- <div className="h-full rounded-full bg-accent transition-[width] duration-500 ease-out motion-reduce:transition-none" style={{ width: `${percent}%` }} />+ return <div role="progressbar" aria-label={label} aria-valuemin={0} aria-valuemax={100} aria-valuenow={percent} className="h-1 overflow-hidden rounded-full bg-ink/10">+ <div className="h-full rounded-full bg-ink transition-[width] duration-500 ease-out motion-reduce:transition-none" style={{ width: `${percent}%` }} /></div>;}@@ -59,8 +74,8 @@ export function CloudTile({ color, size = 22 }: { color: unknown; size?: number}export function Badge({ children }: { children: ReactNode }) {- return <span className="inline-flex items-center gap-1.5 self-start rounded-full bg-success/12 px-2.5 py-1 text-[12px] font-semibold text-success">- <Check size={13} strokeWidth={2.6} aria-hidden="true" />{children}+ return <span className={cn(TAG, "min-h-6 self-start px-2.5")}>+ <Check size={13} strokeWidth={2.2} aria-hidden="true" />{children}</span>;}diff --git a/src/lib/cloud-plan.test.ts b/src/lib/cloud-plan.test.tsindex 22914eb024..dff4a9533a 100644--- a/src/lib/cloud-plan.test.ts+++ b/src/lib/cloud-plan.test.ts@@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest";import type { CloudAccountState, CloudPlanSnapshot } from "../../electron/cloud-account.mjs";import { CHECKOUT_SOURCES } from "../../electron/cloud-account.mjs";import type { CloudCredit, CloudOffer, CloudOfferPlan, CloudTeam, CloudTrial } from "../../electron/cloud-home.mjs";-import { buyOfferAllowed, CLOUD_SOURCES, cloudAddView, cloudCreditLine, cloudIntroView, cloudNoticeKind, cloudPlanLine, cloudPlanView, cloudTrialNotice, cloudTrialView,+import { buyOfferAllowed, cardRows, CLOUD_SOURCES, cloudAddView, cloudCreditLine, cloudIntroView, cloudNoticeKind, cloudPlanLine, cloudPlanView, cloudTrialNotice, cloudTrialView,dueToday, moneyBackLine, moneyBackShort, offerPlan, offerTrialDays, planCardRows, planCards, sameTerms, sharedTrialDays, trialTimeline, usd,type CloudSignInPhase } from "./cloud-plan";import { setLocale } from "./i18n";@@ -197,6 +197,28 @@ describe("what is for sale, as the Admin says", () => {expect(JSON.stringify(cards)).not.toMatch(/a day|credit|Everything in/);});+ it("a card shows the numbers a person weighs up, and sleeping only where the plans differ; Compare plans keeps the rest of its rows", () => {+ const pro = { tier: "pro", label: "Pro", amount: 4900, allowances: { cpus: 4, cpuKind: "shared" as const, memoryMb: 4096, swapMb: 4096, diskGb: 10, maxDiskGb: 100, computers: 15,+ computerHours: 300, voiceCharacters: 60_000, snapshotDays: 14 } };+ const starter = { ...pro, tier: "starter", label: "Starter", amount: 1500, allowances: { ...pro.allowances, cpus: 2, memoryMb: 2048, maxDiskGb: 20, computerHours: 100 } };+ const max = { ...pro, tier: "max", label: "Max", amount: 9900, allowances: { ...pro.allowances, cpus: 8, memoryMb: 8192, computerHours: 800 } };+ const keys = (rows: Array<{ key: string }>) => rows.map(row => row.key);+ const cards = planCards({ plans: [starter, pro, max], recommended: "pro" });+ const split = cardRows(cards);+ expect(split.map(card => keys(card.shown))).toEqual(Array(3).fill(["hours", "storage", "voice"]));+ expect(split.map(card => keys(card.details))).toEqual(Array(3).fill(["power", "desktops", "machine", "backups"]));+ expect(split.map(card => [...card.shown, ...card.details].length), "no row is dropped").toEqual(cards.map(card => card.rows.length));+ const asleep = (plan: typeof pro) => ({ ...plan, allowances: { ...plan.allowances, sleeps: true as const } });+ const one = cardRows(planCards({ plans: [asleep(starter), pro, max], recommended: "pro" }));+ expect(one.map(card => card.shown[0]!.text), "one plan sleeps: every card says how it runs")+ .toEqual(["Sleeps when idle, wakes in about a second", "Always on, around the clock", "Always on, around the clock"]);+ expect(one.map(card => keys(card.details))).toEqual(Array(3).fill(["desktops", "machine", "backups"]));+ const all = cardRows(planCards({ plans: [starter, pro, max].map(asleep), recommended: "pro" }));+ expect(all.map(card => keys(card.shown)), "every plan sleeps: nothing sets them apart there").toEqual(Array(3).fill(["hours", "storage", "voice"]));+ const bare = cardRows(planCards({ plans: [{ tier: "team", label: "Team", amount: 19900 }, pro], recommended: "pro" }));+ expect(bare.map(card => keys(card.shown)), "a plan without allowances sets nothing apart").toEqual([[], ["hours", "storage", "voice"]]);+ });+it("speaks the reader's language, numbers included", () => {setLocale("de");const [card] = planCards({ plans: [{ tier: "max", amount: 9900, trialDays: 3, allowances: { cpus: 8, cpuKind: "shared", memoryMb: 8192, diskGb: 10, maxDiskGb: 100, computers: 15,diff --git a/src/lib/cloud-plan.ts b/src/lib/cloud-plan.tsindex 3731958c2e..53163b6ca5 100644--- a/src/lib/cloud-plan.ts+++ b/src/lib/cloud-plan.ts@@ -213,6 +213,15 @@ export function planCards(offer: CloudOffer, { current = null, own = null }: { creturn plans.map(plan => planCard(plan, offer.recommended, current));}+const WEIGHED: ReadonlySet<CloudPlanCardRow["key"]> = new Set(["hours", "storage", "voice"]);+/** What each card shows itself: the numbers a person weighs up, and whether it sleeps when the plans differ there. The+ * rest of its rows are its details, for Compare plans. */+export function cardRows(cards: readonly CloudPlanCard[]): Array<{ shown: CloudPlanCardRow[]; details: CloudPlanCardRow[] }> {+ const power = new Set(cards.flatMap(card => card.rows.filter(row => row.key === "power").map(row => row.text)));+ const shown = (row: CloudPlanCardRow) => WEIGHED.has(row.key) || (row.key === "power" && power.size > 1);+ return cards.map(card => ({ shown: card.rows.filter(shown), details: card.rows.filter(row => !shown(row)) }));+}+const DAY_MS = 86_400_000;/** The free trial's days when every plan on sale has the same ones, so one timeline is true of all of them. */export function sharedTrialDays(offer: CloudOffer): number | null {diff --git a/src/locales/de.json b/src/locales/de.jsonindex 016f7da7b5..d0fadf9123 100644--- a/src/locales/de.json+++ b/src/locales/de.json@@ -2,6 +2,7 @@"highlevel.unavailable": "Hier nicht verfügbar.","pro.fromPrice": "MausBot Cloud-Tarife ab {price}/Monat zzgl. Steuern.","pro.seePlans": "Tarife vergleichen",+ "cloudBuy.includes": "In jedem Tarif enthalten","pro.reauthShort": "Melde dich erneut an, um die Cloud auf diesem Computer zu nutzen. Dein Tarif ist davon nicht betroffen.","pro.openCloudSettings": "MausBot Cloud-Einstellungen","pro.settingsSummary": "Hält deine Bots und Routinen rund um die Uhr am Laufen, auch wenn dieser Computer aus ist.",diff --git a/src/locales/en.json b/src/locales/en.jsonindex 47fc32e3f7..e188422993 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -138,8 +138,7 @@"cloudAdd.receivedTitle": "Payment received","cloudBuy.title": "Your bots, always on.","cloudBuy.lede": "Runs your bots 24/7 in the cloud, even when this computer is off.",- "cloudScene.label": "Three bots keep working on a cloud under the moon while this computer sleeps",- "cloudBuy.benefits": "What MausBot Cloud gives you",+ "cloudBuy.includes": "Every plan includes","cloudBuy.benefit.awayTitle": "Works while you're away","cloudBuy.benefit.away": "Routines, long jobs and replies keep going around the clock.","cloudBuy.benefit.privateTitle": "Private to you",diff --git a/src/locales/es.json b/src/locales/es.jsonindex ce146e54b2..9051eb007f 100644--- a/src/locales/es.json+++ b/src/locales/es.json@@ -108,8 +108,7 @@"cloudAdd.receivedTitle": "Pago recibido","cloudBuy.title": "Tus bots, siempre activos.","cloudBuy.lede": "Mantiene tus bots en marcha 24/7 en la nube, incluso con este equipo apagado.",- "cloudScene.label": "Tres bots siguen trabajando en una nube bajo la luna mientras este equipo duerme",- "cloudBuy.benefits": "Lo que te da MausBot Cloud",+ "cloudBuy.includes": "Todos los planes incluyen","cloudBuy.benefit.awayTitle": "Trabaja mientras no estás","cloudBuy.benefit.away": "Las rutinas, los trabajos largos y las respuestas siguen en marcha las 24 horas.","cloudBuy.benefit.privateTitle": "Solo para ti",diff --git a/src/locales/everyday-words.test.ts b/src/locales/everyday-words.test.tsindex 12c8e60038..d6a632d127 100644--- a/src/locales/everyday-words.test.ts+++ b/src/locales/everyday-words.test.ts@@ -18,7 +18,7 @@ const EVERYDAY_PREFIXES: Record<string, readonly string[]> = {"computer.screen.", "vm.cloud.", "browser.",],"MausBot Cloud: buying it, setting it up, moving to it and sharing with it": [- "cloudBuy.", "cloudIntro.", "cloudTrial.", "cloudSetup.", "cloudIntent.", "cloudNotice.", "cloudHowTo.", "cloudScene.", "cloudProPopup.",+ "cloudBuy.", "cloudIntro.", "cloudTrial.", "cloudSetup.", "cloudIntent.", "cloudNotice.", "cloudHowTo.", "cloudProPopup.","cloudCredit.", "cloudPower.", "cloudSignIn.", "cloudAdd.", "cloudHome.", "cloudPhone.", "cloudAccount.", "pro.", "lending.","files.", "usageMeter.",],diff --git a/src/locales/fr.json b/src/locales/fr.jsonindex e47f166702..f720bdbc73 100644--- a/src/locales/fr.json+++ b/src/locales/fr.json@@ -2,6 +2,7 @@"highlevel.unavailable": "Non disponible ici.","pro.fromPrice": "Forfaits MausBot Cloud à partir de {price}/mois + taxes.","pro.seePlans": "Comparer les forfaits",+ "cloudBuy.includes": "Inclus dans tous les forfaits","pro.reauthShort": "Reconnectez-vous pour utiliser le Cloud sur cet ordinateur. Votre forfait n'est pas concerné.","pro.openCloudSettings": "Paramètres MausBot Cloud","pro.settingsSummary": "Vos bots et vos routines tournent 24 h/24, même quand cet ordinateur est éteint.",diff --git a/src/locales/hi.json b/src/locales/hi.jsonindex 67a9672c66..93b976c583 100644--- a/src/locales/hi.json+++ b/src/locales/hi.json@@ -2,6 +2,7 @@"highlevel.unavailable": "यहाँ उपलब्ध नहीं।","pro.fromPrice": "MausBot Cloud प्लान {price}/माह से, साथ में टैक्स।","pro.seePlans": "प्लान की तुलना करें",+ "cloudBuy.includes": "हर प्लान में शामिल","pro.reauthShort": "इस कंप्यूटर पर Cloud इस्तेमाल करने के लिए फिर से साइन इन करें। आपके प्लान पर कोई असर नहीं पड़ता।","pro.openCloudSettings": "MausBot Cloud सेटिंग्स","pro.settingsSummary": "आपके बॉट और रूटीन 24/7 चलते रहते हैं, तब भी जब यह कंप्यूटर बंद हो।",diff --git a/src/locales/it.json b/src/locales/it.jsonindex f8d17a994b..53ecf2221c 100644--- a/src/locales/it.json+++ b/src/locales/it.json@@ -113,8 +113,7 @@"cloudAdd.receivedTitle": "Pagamento ricevuto","cloudBuy.title": "I tuoi bot, sempre attivi.","cloudBuy.lede": "Fa lavorare i tuoi bot 24/7 nel cloud, anche con questo computer spento.",- "cloudScene.label": "Tre bot continuano a lavorare su una nuvola sotto la luna mentre questo computer dorme",- "cloudBuy.benefits": "Cosa ti dà MausBot Cloud",+ "cloudBuy.includes": "Ogni piano include","cloudBuy.benefit.awayTitle": "Lavora quando non ci sei","cloudBuy.benefit.away": "Routine, lavori lunghi e risposte proseguono a qualsiasi ora.","cloudBuy.benefit.privateTitle": "Solo tuo",diff --git a/src/locales/ja.json b/src/locales/ja.jsonindex 50459081ec..d282389a37 100644--- a/src/locales/ja.json+++ b/src/locales/ja.json@@ -116,8 +116,7 @@"cloudAdd.receivedTitle": "お支払いを受け付けました","cloudBuy.title": "ボットを、いつでも稼働。","cloudBuy.lede": "このコンピューターの電源が切れていても、クラウドでボットを24時間365日動かし続けます。",- "cloudScene.label": "このコンピューターがスリープしている間も、月明かりの下の雲の上で3体のボットが働き続けています",- "cloudBuy.benefits": "MausBot Cloudでできること",+ "cloudBuy.includes": "すべてのプランに含まれるもの","cloudBuy.benefit.awayTitle": "不在の間も稼働","cloudBuy.benefit.away": "ルーティン、長時間のジョブ、返信が24時間止まらず動き続けます。","cloudBuy.benefit.privateTitle": "あなただけの環境",diff --git a/src/locales/pl.json b/src/locales/pl.jsonindex e75b0294b7..e35880a00a 100644--- a/src/locales/pl.json+++ b/src/locales/pl.json@@ -116,8 +116,7 @@"cloudAdd.receivedTitle": "Otrzymano płatność","cloudBuy.title": "Twoje boty, zawsze włączone.","cloudBuy.lede": "Uruchamia twoje boty 24/7 w chmurze, nawet gdy ten komputer jest wyłączony.",- "cloudScene.label": "Trzy boty pracują dalej w chmurze pod księżycem, gdy ten komputer śpi",- "cloudBuy.benefits": "Co daje ci MausBot Cloud",+ "cloudBuy.includes": "Każdy plan zawiera","cloudBuy.benefit.awayTitle": "Działa, gdy cię nie ma","cloudBuy.benefit.away": "Rutyny, długie zadania i odpowiedzi działają bez przerwy.","cloudBuy.benefit.privateTitle": "Tylko dla ciebie",diff --git a/src/locales/pt-br.json b/src/locales/pt-br.jsonindex 20cd4517c6..b5b71df622 100644--- a/src/locales/pt-br.json+++ b/src/locales/pt-br.json@@ -108,8 +108,7 @@"cloudAdd.receivedTitle": "Pagamento recebido","cloudBuy.title": "Seus bots, sempre ligados.","cloudBuy.lede": "Roda seus bots 24/7 na nuvem, mesmo quando este computador está desligado.",- "cloudScene.label": "Três bots continuam trabalhando em uma nuvem sob a lua enquanto este computador dorme",- "cloudBuy.benefits": "O que o MausBot Cloud oferece",+ "cloudBuy.includes": "Todos os planos incluem","cloudBuy.benefit.awayTitle": "Trabalha enquanto você está fora","cloudBuy.benefit.away": "Rotinas, tarefas longas e respostas continuam 24 horas por dia.","cloudBuy.benefit.privateTitle": "Só seu",diff --git a/src/locales/ru.json b/src/locales/ru.jsonindex d870875f39..7d77f9af95 100644--- a/src/locales/ru.json+++ b/src/locales/ru.json@@ -116,8 +116,7 @@"cloudAdd.receivedTitle": "Платёж получен","cloudBuy.title": "Ваши боты всегда включены.","cloudBuy.lede": "Запускает ваших ботов 24/7 в облаке, даже когда этот компьютер выключен.",- "cloudScene.label": "Три бота продолжают работать на облаке под луной, пока этот компьютер спит",- "cloudBuy.benefits": "Что даёт вам MausBot Cloud",+ "cloudBuy.includes": "В каждый тариф входит","cloudBuy.benefit.awayTitle": "Работает, пока вас нет","cloudBuy.benefit.away": "Регулярные задачи, длительные задания и ответы продолжаются круглосуточно.","cloudBuy.benefit.privateTitle": "Только для вас",diff --git a/src/locales/source-hashes.json b/src/locales/source-hashes.jsonindex bee17afb61..97c1b1aeb5 100644--- a/src/locales/source-hashes.json+++ b/src/locales/source-hashes.json@@ -2559,8 +2559,6 @@"cloudAdd.receivedTitle": "2fef7951de07b776486b685c68ec683dff52117cdfca257634242f13dfc2566b","cloudBuy.title": "f0500ce41cf1d668cbd1b0bd4f59f1c9513203b015bd954eee43300621ac93c6","cloudBuy.lede": "a3ad77abc6e48f2f871fd7d01cb1d2b4cf2579f891fd5ca232693ca06a8f7929",- "cloudScene.label": "0caf530207d3aa7734645fba2257a3716a47cde7672d99e3ac844f05e17c88f2",- "cloudBuy.benefits": "490aff6c63b9c10218bb5da5516561d235ca5b69856f2f9b6e19f7db30cb3822","cloudBuy.benefit.awayTitle": "41ccfb6bf8cfb681c3b6f65816ff2a723ec586e382cf1b318d83da9e67e28f23","cloudBuy.benefit.away": "28888845b5f9095aba7400a44b0253b50ac3dba829ae01fe4b14a77f03c705ea","cloudBuy.benefit.privateTitle": "c2dbbd29e41a814e3d965eb02f1c92a0b59b538f5c8fa10dda689f0d66add2a4",@@ -12840,8 +12838,6 @@"cloudAdd.receivedTitle": "2fef7951de07b776486b685c68ec683dff52117cdfca257634242f13dfc2566b","cloudBuy.title": "f0500ce41cf1d668cbd1b0bd4f59f1c9513203b015bd954eee43300621ac93c6","cloudBuy.lede": "a3ad77abc6e48f2f871fd7d01cb1d2b4cf2579f891fd5ca232693ca06a8f7929",- "cloudScene.label": "0caf530207d3aa7734645fba2257a3716a47cde7672d99e3ac844f05e17c88f2",- "cloudBuy.benefits": "490aff6c63b9c10218bb5da5516561d235ca5b69856f2f9b6e19f7db30cb3822","cloudBuy.benefit.awayTitle": "41ccfb6bf8cfb681c3b6f65816ff2a723ec586e382cf1b318d83da9e67e28f23","cloudBuy.benefit.away": "28888845b5f9095aba7400a44b0253b50ac3dba829ae01fe4b14a77f03c705ea","cloudBuy.benefit.privateTitle": "c2dbbd29e41a814e3d965eb02f1c92a0b59b538f5c8fa10dda689f0d66add2a4",@@ -19196,8 +19192,6 @@"cloudAdd.receivedTitle": "2fef7951de07b776486b685c68ec683dff52117cdfca257634242f13dfc2566b","cloudBuy.title": "f0500ce41cf1d668cbd1b0bd4f59f1c9513203b015bd954eee43300621ac93c6","cloudBuy.lede": "a3ad77abc6e48f2f871fd7d01cb1d2b4cf2579f891fd5ca232693ca06a8f7929",- "cloudScene.label": "0caf530207d3aa7734645fba2257a3716a47cde7672d99e3ac844f05e17c88f2",- "cloudBuy.benefits": "490aff6c63b9c10218bb5da5516561d235ca5b69856f2f9b6e19f7db30cb3822","cloudBuy.benefit.awayTitle": "41ccfb6bf8cfb681c3b6f65816ff2a723ec586e382cf1b318d83da9e67e28f23","cloudBuy.benefit.away": "28888845b5f9095aba7400a44b0253b50ac3dba829ae01fe4b14a77f03c705ea","cloudBuy.benefit.privateTitle": "c2dbbd29e41a814e3d965eb02f1c92a0b59b538f5c8fa10dda689f0d66add2a4",@@ -45553,8 +45547,6 @@"cloudAdd.receivedTitle": "2fef7951de07b776486b685c68ec683dff52117cdfca257634242f13dfc2566b","cloudBuy.title": "f0500ce41cf1d668cbd1b0bd4f59f1c9513203b015bd954eee43300621ac93c6","cloudBuy.lede": "a3ad77abc6e48f2f871fd7d01cb1d2b4cf2579f891fd5ca232693ca06a8f7929",- "cloudScene.label": "0caf530207d3aa7734645fba2257a3716a47cde7672d99e3ac844f05e17c88f2",- "cloudBuy.benefits": "490aff6c63b9c10218bb5da5516561d235ca5b69856f2f9b6e19f7db30cb3822","cloudBuy.benefit.awayTitle": "41ccfb6bf8cfb681c3b6f65816ff2a723ec586e382cf1b318d83da9e67e28f23","cloudBuy.benefit.away": "28888845b5f9095aba7400a44b0253b50ac3dba829ae01fe4b14a77f03c705ea","cloudBuy.benefit.privateTitle": "c2dbbd29e41a814e3d965eb02f1c92a0b59b538f5c8fa10dda689f0d66add2a4",@@ -51811,8 +51803,6 @@"cloudAdd.receivedTitle": "2fef7951de07b776486b685c68ec683dff52117cdfca257634242f13dfc2566b","cloudBuy.title": "f0500ce41cf1d668cbd1b0bd4f59f1c9513203b015bd954eee43300621ac93c6","cloudBuy.lede": "a3ad77abc6e48f2f871fd7d01cb1d2b4cf2579f891fd5ca232693ca06a8f7929",- "cloudScene.label": "0caf530207d3aa7734645fba2257a3716a47cde7672d99e3ac844f05e17c88f2",- "cloudBuy.benefits": "490aff6c63b9c10218bb5da5516561d235ca5b69856f2f9b6e19f7db30cb3822","cloudBuy.benefit.awayTitle": "41ccfb6bf8cfb681c3b6f65816ff2a723ec586e382cf1b318d83da9e67e28f23","cloudBuy.benefit.away": "28888845b5f9095aba7400a44b0253b50ac3dba829ae01fe4b14a77f03c705ea","cloudBuy.benefit.privateTitle": "c2dbbd29e41a814e3d965eb02f1c92a0b59b538f5c8fa10dda689f0d66add2a4",@@ -58156,8 +58146,6 @@"cloudAdd.receivedTitle": "2fef7951de07b776486b685c68ec683dff52117cdfca257634242f13dfc2566b","cloudBuy.title": "f0500ce41cf1d668cbd1b0bd4f59f1c9513203b015bd954eee43300621ac93c6","cloudBuy.lede": "a3ad77abc6e48f2f871fd7d01cb1d2b4cf2579f891fd5ca232693ca06a8f7929",- "cloudScene.label": "0caf530207d3aa7734645fba2257a3716a47cde7672d99e3ac844f05e17c88f2",- "cloudBuy.benefits": "490aff6c63b9c10218bb5da5516561d235ca5b69856f2f9b6e19f7db30cb3822","cloudBuy.benefit.awayTitle": "41ccfb6bf8cfb681c3b6f65816ff2a723ec586e382cf1b318d83da9e67e28f23","cloudBuy.benefit.away": "28888845b5f9095aba7400a44b0253b50ac3dba829ae01fe4b14a77f03c705ea","cloudBuy.benefit.privateTitle": "c2dbbd29e41a814e3d965eb02f1c92a0b59b538f5c8fa10dda689f0d66add2a4",diff --git a/src/locales/tr.json b/src/locales/tr.jsonindex 47755bf0f8..f9dd3fb51c 100644--- a/src/locales/tr.json+++ b/src/locales/tr.json@@ -34,6 +34,7 @@"pro.name": "MausBot Cloud","pro.fromPrice": "MausBot Cloud planları aylık {price} + vergiden başlar.","pro.seePlans": "Planları karşılaştır",+ "cloudBuy.includes": "Her plana dahil","pro.reauthShort": "Cloud'u bu bilgisayarda kullanmak için tekrar giriş yapın. Planınız bundan etkilenmez.","pro.openCloudSettings": "MausBot Cloud ayarları","pro.settingsSummary": "Bu bilgisayar kapalıyken bile botlarınızı ve rutinlerinizi 7/24 çalışır durumda tutar.",diff --git a/src/locales/uk.json b/src/locales/uk.jsonindex 938235a9ce..1e9a973bef 100644--- a/src/locales/uk.json+++ b/src/locales/uk.json@@ -2,6 +2,7 @@"highlevel.unavailable": "Тут недоступно.","pro.fromPrice": "Плани MausBot Cloud від {price}/міс. + податки.","pro.seePlans": "Порівняти плани",+ "cloudBuy.includes": "У кожен план входить","pro.reauthShort": "Увійдіть знову, щоб користуватися Cloud на цьому комп’ютері. Ваш план від цього не змінюється.","pro.openCloudSettings": "Налаштування MausBot Cloud","pro.settingsSummary": "Ваші боти й рутини працюють цілодобово, навіть коли цей комп’ютер вимкнено.",diff --git a/src/locales/vi.json b/src/locales/vi.jsonindex 6b442e8afb..2ddae59b91 100644--- a/src/locales/vi.json+++ b/src/locales/vi.json@@ -34,6 +34,7 @@"pro.name": "MausBot Cloud","pro.fromPrice": "Các gói MausBot Cloud từ {price}/tháng + thuế.","pro.seePlans": "So sánh các gói",+ "cloudBuy.includes": "Mọi gói đều có","pro.reauthShort": "Đăng nhập lại để sử dụng Cloud trên máy tính này. Gói của bạn không bị ảnh hưởng.","pro.openCloudSettings": "Cài đặt MausBot Cloud","pro.settingsSummary": "Giúp các bot và tác vụ định kỳ của bạn tiếp tục chạy 24/7, ngay cả khi máy tính này đã tắt.",diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.jsonindex 4e93e078bd..3f1d827fba 100644--- a/src/locales/zh-tw.json+++ b/src/locales/zh-tw.json@@ -33,6 +33,7 @@"pro.name": "MausBot Cloud","pro.fromPrice": "MausBot Cloud 方案每月 {price} 起,另加稅費。","pro.seePlans": "比較方案",+ "cloudBuy.includes": "所有方案皆包含","pro.reauthShort": "重新登入即可在這台電腦上使用 Cloud。你的方案不受影響。","pro.openCloudSettings": "MausBot Cloud 設定","pro.settingsSummary": "即使這台電腦關機,你的機器人和例行工作也會全天候運作。",diff --git a/src/locales/zh.json b/src/locales/zh.jsonindex 63d7a8a995..ec626f95ac 100644--- a/src/locales/zh.json+++ b/src/locales/zh.json@@ -2,6 +2,7 @@"highlevel.unavailable": "这里不可用。","pro.fromPrice": "MausBot Cloud 方案每月 {price} 起,另加税费。","pro.seePlans": "比较方案",+ "cloudBuy.includes": "所有方案均包含","pro.reauthShort": "重新登录即可在这台电脑上使用 Cloud。你的方案不受影响。","pro.openCloudSettings": "MausBot Cloud 设置","pro.settingsSummary": "即使这台电脑关机,你的机器人和例行任务也会全天候运行。",diff --git a/src/styles.css b/src/styles.cssindex 3f1aaa286f..240d70dc01 100644--- a/src/styles.css+++ b/src/styles.css@@ -2871,61 +2871,6 @@ button:disabled.bg-danger {color: var(--bubble-selection-ink, #ffffff);}-/* The Cloud night shift scene: a night sky tinted by the skin's accent, an- evening sky in light skins. Only stars twinkle and the z's drift up; the- z's need transform-box to grow around their own centre instead of the- SVG's origin. */-.cloud-scene {- --cloud-scene-sky-top: light-dark(color-mix(in oklab, var(--color-accent) 26%, #3d4598), color-mix(in oklab, var(--color-accent) 14%, #080d26));- --cloud-scene-sky-bottom: light-dark(color-mix(in oklab, var(--color-accent) 16%, #a49ae0), color-mix(in oklab, var(--color-accent) 20%, #262b68));- --cloud-scene-haze: light-dark(rgb(255 191 211 / 0.42), color-mix(in oklab, color-mix(in oklab, var(--color-accent) 35%, #8a6cf0) 42%, transparent));- --cloud-scene-glow: color-mix(in oklab, color-mix(in oklab, var(--color-accent) 70%, #ffffff) 40%, transparent);- --cloud-scene-rose: rgb(244 114 182 / 0.32);- --cloud-scene-cloud-top: #f4f3ff;- --cloud-scene-cloud-low: light-dark(color-mix(in oklab, var(--color-accent) 8%, #d6d3f6), color-mix(in oklab, var(--color-accent) 10%, #cdc4f2));- --cloud-scene-cloud-shade: light-dark(color-mix(in oklab, var(--color-accent) 10%, #b4aeea), color-mix(in oklab, var(--color-accent) 16%, #9fa3df));- --cloud-scene-mist: rgb(190 194 255 / 0.3);- --cloud-scene-hill-top: light-dark(color-mix(in oklab, var(--color-accent) 10%, #5a5fb0), color-mix(in oklab, var(--color-accent) 10%, #2b3170));- --cloud-scene-hill-bottom: light-dark(color-mix(in oklab, var(--color-accent) 8%, #3a3f8a), color-mix(in oklab, var(--color-accent) 8%, #141838));- --cloud-scene-rim: rgb(206 212 255 / 0.5);- --cloud-scene-star: #fff7dd;- --cloud-scene-lamp: #ffcf87;- --cloud-scene-bubble: rgb(176 186 255 / 0.34);- --cloud-scene-bubble-edge: rgb(255 255 255 / 0.9);- --cloud-scene-moon-glow: rgb(255 222 140 / 0.42);- --cloud-scene-ring: light-dark(color-mix(in oklab, var(--color-accent) 22%, transparent), rgb(255 255 255 / 0.08));- position: relative;- width: 100%;- overflow: hidden;- isolation: isolate;- border-radius: 16px;- color-scheme: var(--code-color-scheme);- background:- radial-gradient(70% 85% at 38% 110%, var(--cloud-scene-haze), transparent 72%),- radial-gradient(45% 70% at 4% 0%, var(--cloud-scene-glow), transparent 70%),- radial-gradient(40% 60% at 100% 100%, var(--cloud-scene-rose), transparent 72%),- linear-gradient(180deg, var(--cloud-scene-sky-top), var(--cloud-scene-sky-bottom));- box-shadow: inset 0 0 0 1px var(--cloud-scene-ring);-}-.cloud-scene-beat { border-radius: 12px; }-.cloud-scene-stage { position: relative; margin-inline: auto; width: min(100%, 320px); aspect-ratio: 320 / 150; }-.cloud-scene-beat .cloud-scene-stage { width: min(100%, 400px); aspect-ratio: 400 / 116; }-.cloud-scene-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }-.cloud-scene-box { position: absolute; }-.cloud-scene-box > span { display: flex; width: 100%; height: 100%; }-.cloud-scene-box > span > svg { width: 100%; height: 100%; }-.cloud-scene-twinkle { animation: cloud-scene-twinkle 6s ease-in-out infinite; }-.cloud-scene-z { transform-box: fill-box; transform-origin: center; animation: cloud-scene-z 6s linear infinite; }-.cloud-scene-z:nth-child(2) { animation-delay: -2s; }-.cloud-scene-z:nth-child(3) { animation-delay: -4s; }-.cloud-scene[data-paused] * { animation-play-state: paused; }-@keyframes cloud-scene-twinkle { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }-@keyframes cloud-scene-z {- 0% { opacity: 0; transform: translate(0, 0) scale(0.5); }- 15%, 70% { opacity: 1; }- 100% { opacity: 0; transform: translate(20px, -34px) scale(1.1); }-}-/* Trace waterfall: AI steps lavender, tools pale teal, errors red, each mixed into the skin's card so every skin keeps its contrast. */.trace-bar { border: 1px solid transparent; }.trace-bar-step {