Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

feat(cloud): purple Cloud light-switch + 4-options gate + one-time onboarding (David-Durchklick 10.7)

purple5fb42abe3845
diff --git a/e2e/cloud-create.spec.ts b/e2e/cloud-create.spec.ts
index 5124dc11..3d774133 100644
--- a/e2e/cloud-create.spec.ts
+++ b/e2e/cloud-create.spec.ts
@@ -1,6 +1,6 @@
import { test, expect, type Page } from '@playwright/test'
import { tauriMockInit, DEFAULT_ASSISTANT_REPLY, DEFAULT_MODEL_NAME } from './support/tauri-mock'
-import { routeCloud, seedOnboardingDone, signInViaGate, type CloudScenario } from './support/cloud-mock'
+import { routeCloud, seedOnboardingDone, signInViaGate, cloudSwitch, type CloudScenario } from './support/cloud-mock'
/**
* 2.5.7 cloud create — hosted rendering through the global Cloud mode.
@@ -20,9 +20,9 @@ async function bootIntoCloudCreate(page: Page, scenario: CloudScenario) {
await seedOnboardingDone(page)
await routeCloud(page, scenario)
await page.goto('/')
- await expect(page.getByRole('radio', { name: /Local/i })).toBeVisible({ timeout: 20_000 })
+ await expect(cloudSwitch(page)).toBeVisible({ timeout: 20_000 })
await signInViaGate(page)
- await expect(page.getByRole('radio', { name: /Cloud/i })).toBeChecked({ timeout: 20_000 })
+ await expect(cloudSwitch(page)).toBeChecked({ timeout: 20_000 })
await page.getByRole('button', { name: /^Create$/ }).click()
}
@@ -73,7 +73,7 @@ test('local mode offers only the local lane (no cloud-only ops)', async ({ page
await seedOnboardingDone(page)
await routeCloud(page, { license: 'active', access: true, mediaLive: true })
await page.goto('/')
- await expect(page.getByRole('radio', { name: /Local/i })).toBeVisible({ timeout: 20_000 })
+ await expect(cloudSwitch(page)).toBeVisible({ timeout: 20_000 })
await page.getByRole('button', { name: /^Create$/ }).click()
await expect(page.getByRole('radio', { name: /^Image$/i })).toBeVisible({ timeout: 15_000 })
diff --git a/e2e/cloud-gate.spec.ts b/e2e/cloud-gate.spec.ts
index a81ec7ec..b15d1b30 100644
--- a/e2e/cloud-gate.spec.ts
+++ b/e2e/cloud-gate.spec.ts
@@ -1,15 +1,16 @@
import { test, expect, type Page } from '@playwright/test'
import { tauriMockInit, DEFAULT_ASSISTANT_REPLY, DEFAULT_MODEL_NAME } from './support/tauri-mock'
-import { routeCloud, seedOnboardingDone, signInViaGate, type CloudScenario } from './support/cloud-mock'
+import { routeCloud, seedOnboardingDone, signInViaGate, cloudSwitch, type CloudScenario } from './support/cloud-mock'
/**
- * 2.5.7 cloud gate — the wall in front of Cloud mode.
+ * 2.5.7 cloud gate — the wall in front of Cloud mode (David's 4-options flow).
*
- * (a) signed in without a plan → plan CTA opens lu-labs.ai/pricing in the
- * SYSTEM browser (asserted via the mocked shell-open recorder), the mode
- * stays Local;
+ * (a) signed in without a plan → the three plan buttons open lu-labs.ai/pricing
+ * in the SYSTEM browser (asserted via the mocked shell-open recorder),
+ * the switch stays off;
* (b) licensed but behind the Max-only launch gate (access:false) → the
- * closed-beta wall, mode stays Local.
+ * closed-beta wall, switch stays off;
+ * (c) "Stay on Local" closes the gate with the switch off.
*/
async function boot(page: Page, scenario: CloudScenario) {
@@ -20,27 +21,43 @@ async function boot(page: Page, scenario: CloudScenario) {
await seedOnboardingDone(page)
await routeCloud(page, scenario)
await page.goto('/')
- await expect(page.getByRole('radio', { name: /Local/i })).toBeVisible({ timeout: 20_000 })
+ await expect(cloudSwitch(page)).toBeVisible({ timeout: 20_000 })
}
-test('signed in without a plan: plan CTA → browser, mode stays Local', async ({ page }) => {
+test('signed in without a plan: plan buttons → browser, switch stays off', async ({ page }) => {
await boot(page, { license: 'none' })
await signInViaGate(page)
await expect(page.getByText(/no active plan/i)).toBeVisible({ timeout: 20_000 })
- await page.getByRole('button', { name: /View plans/i }).click()
+
+ // David's 4 options: three plans + back to Local.
+ await expect(page.getByRole('button', { name: 'Hosted lu-labs.ai' })).toBeVisible()
+ await expect(page.getByRole('button', { name: 'Pro lu-labs.ai' })).toBeVisible()
+ await expect(page.getByRole('button', { name: /Stay on Local/i })).toBeVisible()
+ await page.getByRole('button', { name: 'Max lu-labs.ai' }).click()
const opened = await page.evaluate(() => (window as unknown as { __E2E_OPENED_URLS__?: string[] }).__E2E_OPENED_URLS__ ?? [])
expect(opened.some((u) => u.includes('lu-labs.ai/pricing'))).toBe(true)
- // Gate holds: the switch is still on Local.
- await expect(page.getByRole('radio', { name: /Local/i })).toBeChecked()
+ // Gate holds: the switch is still off.
+ await expect(cloudSwitch(page)).not.toBeChecked()
})
-test('licensed but beta-gated (access:false): closed-beta wall, mode stays Local', async ({ page }) => {
+test('licensed but beta-gated (access:false): closed-beta wall, switch stays off', async ({ page }) => {
await boot(page, { license: 'active', tier: 'hosted-pro', access: false })
await signInViaGate(page)
await expect(page.getByText(/closed beta/i)).toBeVisible({ timeout: 20_000 })
- await expect(page.getByRole('radio', { name: /Local/i })).toBeChecked()
+ await expect(cloudSwitch(page)).not.toBeChecked()
+})
+
+test('"Stay on Local" closes the gate with the switch off', async ({ page }) => {
+ await boot(page, { license: 'none' })
+ await signInViaGate(page)
+
+ await expect(page.getByText(/no active plan/i)).toBeVisible({ timeout: 20_000 })
+ await page.getByRole('button', { name: /Stay on Local/i }).click()
+
+ await expect(page.getByText(/no active plan/i)).toBeHidden()
+ await expect(cloudSwitch(page)).not.toBeChecked()
})
diff --git a/e2e/cloud-onboarding.spec.ts b/e2e/cloud-onboarding.spec.ts
index 349ce6b4..fcd472c8 100644
--- a/e2e/cloud-onboarding.spec.ts
+++ b/e2e/cloud-onboarding.spec.ts
@@ -1,26 +1,27 @@
import { test, expect, type Page } from '@playwright/test'
import { tauriMockInit, DEFAULT_ASSISTANT_REPLY, DEFAULT_MODEL_NAME } from './support/tauri-mock'
-import { routeCloud, seedOnboardingDone, signInViaGate } from './support/cloud-mock'
+import { routeCloud, seedOnboardingDone, signInViaGate, cloudSwitch } from './support/cloud-mock'
/**
- * 2.5.7 cloud onboarding — header switch → gate login → cloud mode.
+ * 2.5.7 cloud onboarding — purple header switch → gate login → cloud mode.
*
- * A Max-plan account flips the global switch to Cloud through the gate modal:
- * login (email+password against the mocked Supabase), /api/me grants access,
- * the modal closes itself, and the chat picker surfaces ONLY the hosted
- * catalog (the mocked /api/inference/v1/models list) while the local-hardware
- * tabs disappear. Flipping back to Local restores today's app.
+ * A Max-plan account flips the switch to Cloud through the gate modal: login
+ * (email+password against the mocked Supabase), /api/me grants access, the
+ * modal closes itself, and the chat picker surfaces ONLY the hosted catalog
+ * while the local-hardware tabs disappear. Flipping back to Local restores
+ * today's app. The very FIRST successful flip runs the one-time cloud
+ * onboarding (own spec below).
*/
-async function boot(page: Page) {
+async function boot(page: Page, opts?: { cloudOnboardingSeen?: boolean }) {
await page.addInitScript(tauriMockInit, {
assistantReply: DEFAULT_ASSISTANT_REPLY,
modelName: DEFAULT_MODEL_NAME,
})
- await seedOnboardingDone(page)
+ await seedOnboardingDone(page, opts)
await routeCloud(page, { license: 'active', tier: 'hosted-max', access: true })
await page.goto('/')
- await expect(page.getByRole('radio', { name: /Local/i })).toBeVisible({ timeout: 20_000 })
+ await expect(cloudSwitch(page)).toBeVisible({ timeout: 20_000 })
}
test('Max account: switch → login → cloud mode with the hosted catalog', async ({ page }) => {
@@ -32,7 +33,7 @@ test('Max account: switch → login → cloud mode with the hosted catalog', asy
await signInViaGate(page)
// The gate flips the mode itself once the account clears every check.
- await expect(page.getByRole('radio', { name: /Cloud/i })).toBeChecked({ timeout: 20_000 })
+ await expect(cloudSwitch(page)).toBeChecked({ timeout: 20_000 })
// Local-hardware surfaces are gone in cloud mode.
await expect(page.getByRole('button', { name: /^Models$/ })).toBeHidden()
@@ -44,6 +45,27 @@ test('Max account: switch → login → cloud mode with the hosted catalog', asy
await expect(picker).toBeVisible({ timeout: 20_000 })
// Flipping back to Local always works and restores the local tabs.
- await page.getByRole('radio', { name: /Local/i }).click()
+ await cloudSwitch(page).click()
+ await expect(cloudSwitch(page)).not.toBeChecked()
await expect(page.getByRole('button', { name: /^Models$/ })).toBeVisible()
})
+
+test('first flip runs the one-time cloud onboarding before switching', async ({ page }) => {
+ await boot(page, { cloudOnboardingSeen: false })
+
+ await signInViaGate(page)
+
+ // Instead of flipping silently, the one-time onboarding appears.
+ await expect(page.getByText(/Welcome to LU Cloud/i)).toBeVisible({ timeout: 20_000 })
+ await expect(cloudSwitch(page)).not.toBeChecked()
+
+ await page.getByRole('button', { name: /Start Cloud mode/i }).click()
+ await expect(cloudSwitch(page)).toBeChecked()
+
+ // Seen persists: flipping off and on again is silent now.
+ await cloudSwitch(page).click()
+ await expect(cloudSwitch(page)).not.toBeChecked()
+ await cloudSwitch(page).click()
+ await expect(cloudSwitch(page)).toBeChecked()
+ await expect(page.getByText(/Welcome to LU Cloud/i)).toBeHidden()
+})
diff --git a/e2e/support/cloud-mock.ts b/e2e/support/cloud-mock.ts
index 93504391..47d805cd 100644
--- a/e2e/support/cloud-mock.ts
+++ b/e2e/support/cloud-mock.ts
@@ -189,19 +189,27 @@ export async function routeCloud(page: Page, scenario: CloudScenario): Promise<v
* Pre-seed the persisted settings so the app boots straight into chat (no
* onboarding walk) in LOCAL mode. The settingsStore merge() backfills every
* missing field from defaults, so the minimal shape is enough.
+ * cloudOnboardingSeen defaults to true here so the specs exercising the
+ * silent flip stay silent — the first-flip onboarding has its own spec.
*/
-export async function seedOnboardingDone(page: Page): Promise<void> {
- await page.addInitScript(() => {
+export async function seedOnboardingDone(page: Page, opts?: { cloudOnboardingSeen?: boolean }): Promise<void> {
+ const cloudOnboardingSeen = opts?.cloudOnboardingSeen !== false
+ await page.addInitScript((seen) => {
window.localStorage.setItem(
'chat-settings',
- JSON.stringify({ state: { settings: { onboardingDone: true, appMode: 'local' }, _version: 10 }, version: 10 }),
+ JSON.stringify({ state: { settings: { onboardingDone: true, appMode: 'local', cloudOnboardingSeen: seen }, _version: 10 }, version: 10 }),
)
- })
+ }, cloudOnboardingSeen)
+}
+
+/** The purple Cloud light-switch in the header (right cluster). */
+export function cloudSwitch(page: Page) {
+ return page.getByRole('switch', { name: /^Cloud$/i })
}
/** Sign in through the CloudGateModal that the header switch opens. */
export async function signInViaGate(page: Page): Promise<void> {
- await page.getByRole('radio', { name: /Cloud/i }).click()
+ await cloudSwitch(page).click()
await page.getByPlaceholder('Email').fill('[email protected]')
await page.getByPlaceholder('Password').fill('e2e-password')
await page.getByRole('button', { name: /^Sign in$/i }).click()
diff --git a/src/components/cloud/CloudGateModal.tsx b/src/components/cloud/CloudGateModal.tsx
index c717b198..47ea3561 100644
--- a/src/components/cloud/CloudGateModal.tsx
+++ b/src/components/cloud/CloudGateModal.tsx
@@ -1,15 +1,15 @@
-// The gate in front of the global Cloud mode. Opened by the header's
-// Local/Cloud switch whenever the cloud axis isn't usable yet; walks the
-// account through its actual blocker and flips the mode the moment
-// deriveCloudAvailable passes:
-// signed-out → login (email+password + Google/GitHub)
-// licensed? no → plan CTA → lu-labs.ai/pricing in the browser
-// beta gate (access=no) → closed-beta copy → lu-labs.ai
-// no credit budget → honest copy → lu-labs.ai/account in the browser
+// The gate in front of the global Cloud mode. Opened by the header's purple
+// Cloud switch whenever the cloud axis isn't usable yet. David 2026-07-10:
+// every no-subscription state offers FOUR options — back to Local (switch
+// stays off) or one of the three plans (Hosted / Pro / Max), which open
+// lu-labs.ai/pricing in the browser (login → pay there). Signed-out
+// additionally offers the in-app login for accounts that already subscribed.
+// The moment deriveCloudAvailable passes, the mode flips — via the one-time
+// cloud onboarding on the very first flip.
// Payment stays on lu-labs.ai (browser) — the app never touches Stripe.
import { useEffect, useRef } from 'react'
-import { Cloud, ExternalLink, RefreshCw } from 'lucide-react'
+import { Cloud, ExternalLink, HardDrive, RefreshCw } from 'lucide-react'
import { Modal } from '../ui/Modal'
import { useUIStore } from '../../stores/uiStore'
import { useSettingsStore } from '../../stores/settingsStore'
@@ -19,10 +19,50 @@ import { AccountPanel } from '../auth/AccountPanel'
import { CLOUD_BASE } from '../../api/cloud/config'
import { openExternal } from '../../api/backend'
+const PLANS = [
+ { anchor: 'hosted', name: 'Hosted' },
+ { anchor: 'pro', name: 'Pro' },
+ { anchor: 'max', name: 'Max' },
+] as const
+
+/** David's 4-options block: three plan buttons → pricing in the browser,
+ * plus "Stay on Local" so the switch simply stays off. */
+function PlanOptions({ onLocal }: { onLocal: () => void }) {
+ return (
+ <div className="space-y-2">
+ <p className="text-[0.65rem] text-gray-500 dark:text-gray-500">
+ Pick a plan on lu-labs.ai — payment stays in the browser.
+ </p>
+ <div className="grid grid-cols-3 gap-2">
+ {PLANS.map((p) => (
+ <button
+ key={p.anchor}
+ onClick={() => void openExternal(`${CLOUD_BASE}/pricing#${p.anchor}`)}
+ className="flex flex-col items-center gap-0.5 px-2 py-2 rounded-lg border border-[#7c3aed]/40 bg-[#7c3aed]/5 hover:bg-[#7c3aed]/15 transition-colors"
+ >
+ <span className="text-[0.7rem] font-semibold text-[#7c3aed] dark:text-[#a78bfa]">{p.name}</span>
+ <span className="flex items-center gap-1 text-[0.55rem] text-gray-500">
+ <ExternalLink size={8} /> lu-labs.ai
+ </span>
+ </button>
+ ))}
+ </div>
+ <button
+ onClick={onLocal}
+ className="w-full flex items-center justify-center gap-1.5 px-3 py-1.5 rounded text-[0.7rem] font-medium border border-gray-200 dark:border-white/10 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 transition-colors"
+ >
+ <HardDrive size={11} /> Stay on Local
+ </button>
+ </div>
+ )
+}
+
export function CloudGateModal() {
const open = useUIStore((s) => s.cloudGateOpen)
const setOpen = useUIStore((s) => s.setCloudGateOpen)
+ const setCloudOnboardingOpen = useUIStore((s) => s.setCloudOnboardingOpen)
const updateSettings = useSettingsStore((s) => s.updateSettings)
+ const cloudOnboardingSeen = useSettingsStore((s) => s.settings.cloudOnboardingSeen)
const { refresh } = useCloudAuth()
const status = useCloudAuthStore((s) => s.status)
@@ -33,17 +73,24 @@ export function CloudGateModal() {
const available = deriveCloudAvailable({ user, licenseActive, access, quota })
// The moment the account clears every gate (fresh login, re-check after
- // subscribing), flip the global switch and get out of the way.
+ // subscribing), flip the global switch and get out of the way — via the
+ // one-time cloud onboarding when this is the first successful flip.
const wasOpen = useRef(false)
useEffect(() => {
wasOpen.current = open
}, [open])
useEffect(() => {
if (wasOpen.current && available) {
- updateSettings({ appMode: 'cloud' })
setOpen(false)
+ if (!cloudOnboardingSeen) setCloudOnboardingOpen(true)
+ else updateSettings({ appMode: 'cloud' })
}
- }, [available, setOpen, updateSettings])
+ }, [available, cloudOnboardingSeen, setCloudOnboardingOpen, setOpen, updateSettings])
+
+ const stayLocal = () => {
+ updateSettings({ appMode: 'local' })
+ setOpen(false)
+ }
// Re-probe on open — someone staring at this gate shouldn't wait for the
// 5-minute background interval to clear a transient quota-fetch failure.
@@ -65,7 +112,13 @@ export function CloudGateModal() {
Cloud mode runs chat, image and video on LU's hosted GPUs with your
lu-labs.ai account. Local mode stays free and never needs one.
</p>
- <AccountPanel />
+ <PlanOptions onLocal={stayLocal} />
+ <div className="pt-1 border-t border-gray-200 dark:border-white/10">
+ <p className="text-[0.65rem] text-gray-500 dark:text-gray-500 pt-2 pb-1">
+ Already subscribed? Sign in:
+ </p>
+ <AccountPanel />
+ </div>
</div>
) : !licenseActive ? (
<div className="space-y-3">
@@ -73,14 +126,10 @@ export function CloudGateModal() {
You're signed in as <span className="text-gray-900 dark:text-gray-100">{user.email ?? user.id}</span>,
but this account has no active plan yet. LU Cloud is part of the paid plans on lu-labs.ai.
</p>
- <div className="flex items-center gap-2">
- <button className={linkBtn} onClick={() => void openExternal(`${CLOUD_BASE}/pricing`)}>
- <ExternalLink size={11} /> View plans on lu-labs.ai
- </button>
- <button className={ghostBtn} onClick={() => void refresh()}>
- <RefreshCw size={11} /> I subscribed — re-check
- </button>
- </div>
+ <PlanOptions onLocal={stayLocal} />
+ <button className={ghostBtn} onClick={() => void refresh()}>
+ <RefreshCw size={11} /> I subscribed — re-check
+ </button>
</div>
) : !access ? (
<div className="space-y-3">
@@ -89,14 +138,10 @@ export function CloudGateModal() {
active, but the beta hasn't opened for it yet — you'll get in the
moment it does, nothing to reinstall.
</p>
- <div className="flex items-center gap-2">
- <button className={linkBtn} onClick={() => void openExternal(`${CLOUD_BASE}/pricing`)}>
- <ExternalLink size={11} /> Open lu-labs.ai
- </button>
- <button className={ghostBtn} onClick={() => void refresh()}>
- <RefreshCw size={11} /> Re-check
- </button>
- </div>
+ <PlanOptions onLocal={stayLocal} />
+ <button className={ghostBtn} onClick={() => void refresh()}>
+ <RefreshCw size={11} /> Re-check
+ </button>
</div>
) : quota === null ? (
<div className="space-y-3">
diff --git a/src/components/cloud/CloudOnboardingModal.tsx b/src/components/cloud/CloudOnboardingModal.tsx
new file mode 100644
index 00000000..83e3b4d8
--- /dev/null
+++ b/src/components/cloud/CloudOnboardingModal.tsx
@@ -0,0 +1,70 @@
+// One-time Cloud onboarding (David 2026-07-10): the FIRST successful flip to
+// Cloud lands here instead of switching silently — a short what-changes
+// walkthrough, then the switch flips and cloudOnboardingSeen persists so it
+// never shows again. "Not now" leaves everything on Local.
+
+import { Cloud, Coins, Shield } from 'lucide-react'
+import { Modal } from '../ui/Modal'
+import { useUIStore } from '../../stores/uiStore'
+import { useSettingsStore } from '../../stores/settingsStore'
+
+const POINTS = [
+ {
+ icon: Cloud,
+ title: 'Hosted models everywhere',
+ body: "Chat, image and video switch to LU's hosted GPU fleet — the full cloud catalog, no downloads, no VRAM limits. The Create tab gains the cloud-only ops (edit, animate, upscale, erase, enhance).",
+ },
+ {
+ icon: Coins,
+ title: 'Your plan pays with credits',
+ body: 'Every render and chat draws from the monthly credit budget of your plan — the meter in Create always shows what is left. Local-hardware surfaces (Model Manager, Benchmark) hide while Cloud is on.',
+ },
+ {
+ icon: Shield,
+ title: 'Local stays local',
+ body: 'Cloud mode is a switch, not a migration: flip back to Local anytime and everything runs on this machine again — free, private, no account needed.',
+ },
+]
+
+export function CloudOnboardingModal() {
+ const open = useUIStore((s) => s.cloudOnboardingOpen)
+ const setOpen = useUIStore((s) => s.setCloudOnboardingOpen)
+ const updateSettings = useSettingsStore((s) => s.updateSettings)
+
+ const start = () => {
+ updateSettings({ appMode: 'cloud', cloudOnboardingSeen: true })
+ setOpen(false)
+ }
+
+ return (
+ <Modal open={open} onClose={() => setOpen(false)} title="Welcome to LU Cloud">
+ <div className="space-y-4">
+ {POINTS.map(({ icon: Icon, title, body }) => (
+ <div key={title} className="flex items-start gap-3">
+ <span className="mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-[#7c3aed]/10 text-[#7c3aed] dark:text-[#a78bfa]">
+ <Icon size={14} />
+ </span>
+ <div className="space-y-0.5">
+ <p className="text-[0.75rem] font-medium text-gray-900 dark:text-gray-100">{title}</p>
+ <p className="text-[0.7rem] leading-relaxed text-gray-600 dark:text-gray-400">{body}</p>
+ </div>
+ </div>
+ ))}
+ <div className="flex items-center gap-2 pt-1">
+ <button
+ onClick={start}
+ className="flex items-center gap-1.5 px-3 py-1.5 rounded text-[0.7rem] font-medium bg-[#7c3aed] text-white hover:opacity-90 transition-opacity"
+ >
+ <Cloud size={11} /> Start Cloud mode
+ </button>
+ <button
+ onClick={() => setOpen(false)}
+ className="px-3 py-1.5 rounded text-[0.7rem] font-medium border border-gray-200 dark:border-white/10 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 transition-colors"
+ >
+ Not now
+ </button>
+ </div>
+ </div>
+ </Modal>
+ )
+}
diff --git a/src/components/cloud/CloudSwitch.tsx b/src/components/cloud/CloudSwitch.tsx
new file mode 100644
index 00000000..81eb3664
--- /dev/null
+++ b/src/components/cloud/CloudSwitch.tsx
@@ -0,0 +1,75 @@
+// The purple Cloud light-switch (header, right cluster, left of Downloads —
+// David 2026-07-10, purple like the lu-labs.ai website). ON = the whole app
+// runs on LU Cloud: hosted models everywhere, local-hardware surfaces hidden.
+// Flipping ON only succeeds when the cloud axis is usable (signed in +
+// licensed + beta gate + credit budget) — otherwise the CloudGateModal walks
+// the account through login / the three plans. The very FIRST successful flip
+// shows the one-time cloud onboarding instead of switching silently. Flipping
+// OFF always works.
+
+import { Cloud } from 'lucide-react'
+import { useSettingsStore } from '../../stores/settingsStore'
+import { useUIStore } from '../../stores/uiStore'
+import { useCloudAuthStore, deriveCloudAvailable } from '../../stores/cloudAuthStore'
+import { cn } from '../create/ui/cn'
+
+export function CloudSwitch() {
+ const appMode = useSettingsStore((s) => s.settings.appMode)
+ const cloudOnboardingSeen = useSettingsStore((s) => s.settings.cloudOnboardingSeen)
+ const updateSettings = useSettingsStore((s) => s.updateSettings)
+ const setCloudGateOpen = useUIStore((s) => s.setCloudGateOpen)
+ const setCloudOnboardingOpen = useUIStore((s) => s.setCloudOnboardingOpen)
+ const available = useCloudAuthStore(deriveCloudAvailable)
+ const on = appMode === 'cloud'
+
+ const toggle = () => {
+ if (on) {
+ updateSettings({ appMode: 'local' })
+ return
+ }
+ if (!available) {
+ setCloudGateOpen(true)
+ return
+ }
+ if (!cloudOnboardingSeen) {
+ setCloudOnboardingOpen(true)
+ return
+ }
+ updateSettings({ appMode: 'cloud' })
+ }
+
+ return (
+ <button
+ role="switch"
+ aria-checked={on}
+ aria-label="Cloud"
+ title={on
+ ? "Cloud mode is on — chat, image and video run on LU's hosted GPUs. Click to go back to Local."
+ : "Run LU on hosted GPUs with your lu-labs.ai account"}
+ onClick={toggle}
+ className={cn(
+ 'flex items-center gap-1.5 pl-2 pr-1.5 py-[3px] rounded-full border transition-colors',
+ on
+ ? 'border-[#7c3aed] bg-[#7c3aed]/10 text-[#7c3aed] dark:text-[#a78bfa]'
+ : 'border-gray-200 dark:border-white/10 text-gray-500 hover:text-gray-800 dark:hover:text-gray-200 hover:border-gray-300 dark:hover:border-white/20',
+ )}
+ >
+ <Cloud size={12} strokeWidth={on ? 2.25 : 1.75} className="shrink-0" />
+ <span className="text-[0.65rem] font-medium leading-none">Cloud</span>
+ <span
+ aria-hidden
+ className={cn(
+ 'relative w-[22px] h-[12px] rounded-full transition-colors shrink-0',
+ on ? 'bg-[#7c3aed]' : 'bg-gray-300 dark:bg-white/15',
+ )}
+ >
+ <span
+ className={cn(
+ 'absolute top-[2px] w-[8px] h-[8px] rounded-full bg-white shadow-sm transition-[left]',
+ on ? 'left-[12px]' : 'left-[2px]',
+ )}
+ />
+ </span>
+ </button>
+ )
+}
diff --git a/src/components/cloud/ModeSwitch.tsx b/src/components/cloud/ModeSwitch.tsx
deleted file mode 100644
index c0cf7346..00000000
--- a/src/components/cloud/ModeSwitch.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-// The global Local/Cloud switch (header, brand cluster). Flipping to Cloud
-// only succeeds when the whole cloud axis is usable (signed in + licensed +
-// beta gate + credit budget) — otherwise it opens the CloudGateModal, which
-// flips the mode itself once the account clears. Flipping to Local always
-// works. Everything mode-dependent (chat picker, Create backend, hidden
-// local-hardware tabs) hangs off settings.appMode.
-
-import { HardDrive, Cloud } from 'lucide-react'
-import { Segmented } from '../create/ui/Segmented'
-import { useSettingsStore } from '../../stores/settingsStore'
-import { useUIStore } from '../../stores/uiStore'
-import { useCloudAuthStore, deriveCloudAvailable } from '../../stores/cloudAuthStore'
-import type { AppMode } from '../../types/settings'
-
-export function ModeSwitch() {
- const appMode = useSettingsStore((s) => s.settings.appMode)
- const updateSettings = useSettingsStore((s) => s.updateSettings)
- const setCloudGateOpen = useUIStore((s) => s.setCloudGateOpen)
- const available = useCloudAuthStore(deriveCloudAvailable)
-
- const change = (mode: AppMode) => {
- if (mode === appMode) return
- if (mode === 'cloud' && !available) {
- setCloudGateOpen(true)
- return
- }
- updateSettings({ appMode: mode })
- }
-
- return (
- <Segmented<AppMode>
- size="sm"
- layoutId="app-mode"
- ariaLabel="Local or Cloud mode"
- value={appMode}
- onChange={change}
- options={[
- { value: 'local', label: 'Local', icon: HardDrive, title: 'Run everything on this machine' },
- { value: 'cloud', label: 'Cloud', icon: Cloud, title: "Run on LU's hosted GPUs (lu-labs.ai account)" },
- ]}
- />
- )
-}
diff --git a/src/components/layout/AppShell.tsx b/src/components/layout/AppShell.tsx
index 5d027b51..07683601 100644
--- a/src/components/layout/AppShell.tsx
+++ b/src/components/layout/AppShell.tsx
@@ -29,6 +29,7 @@ import { useCloudAuth } from '../../hooks/useCloudAuth'
import { useCloudAuthStore, deriveCloudAvailable } from '../../stores/cloudAuthStore'
import { useCreateStore } from '../../stores/createStore'
import { CloudGateModal } from '../cloud/CloudGateModal'
+import { CloudOnboardingModal } from '../cloud/CloudOnboardingModal'
import { ShortcutsModal } from './ShortcutsModal'
import { Titlebar } from './Titlebar'
@@ -776,6 +777,8 @@ export function AppShell() {
/>
{/* Cloud gate: login → plan → beta wall, opened by the header switch. */}
<CloudGateModal />
+ {/* One-time cloud onboarding — first successful switch flip. */}
+ <CloudOnboardingModal />
<ShortcutsModal />
</div>
)
diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx
index 0f1129e7..7ef4fb95 100644
--- a/src/components/layout/Header.tsx
+++ b/src/components/layout/Header.tsx
@@ -9,7 +9,7 @@ import { ModelSelector } from '../models/ModelSelector'
import { MemoryDebugToggle } from '../chat/MemoryDebugPanel'
import { UpdateBadge } from './UpdateBadge'
import { DownloadBadge } from './DownloadBadge'
-import { ModeSwitch } from '../cloud/ModeSwitch'
+import { CloudSwitch } from '../cloud/CloudSwitch'
import { loadModel } from '../../api/ollama'
import { getProviderIdFromModel } from '../../api/providers'
import { ModelLoadError } from '../../lib/ollama-errors'
@@ -190,10 +190,6 @@ export function Header() {
inverted per theme. Matches the web companion. */}
<img src="/LU-monogram-bw.png" alt="" width={33} height={33} className="dark:invert-0 invert opacity-80" />
</button>
- {/* Global Local/Cloud switch (2.5.7) — replaced the waitlist teaser
- the moment the cloud tier became real. Gated: flipping to Cloud
- without a usable account opens the CloudGateModal instead. */}
- <ModeSwitch />
</div>
{/* Center: model picker, geometrically centered between the logo (left)
@@ -251,6 +247,11 @@ export function Header() {
{/* Right: text nav + icon utilities */}
<div className="flex items-center justify-end gap-2.5 min-w-0">
+ {/* Purple Cloud light-switch (David 2026-07-10): left of Downloads,
+ purple like the website. Gated: flipping ON without a usable
+ account opens the CloudGateModal; the first successful flip runs
+ the one-time cloud onboarding. */}
+ <CloudSwitch />
<DownloadBadge />
<button
diff --git a/src/lib/constants.ts b/src/lib/constants.ts
index 64721c14..30ac852e 100644
--- a/src/lib/constants.ts
+++ b/src/lib/constants.ts
@@ -16,6 +16,7 @@ export const DEFAULT_SETTINGS: Settings = {
onboardingDone: false,
// Global Local/Cloud switch (2.5.7) — local is and stays the default.
appMode: 'local',
+ cloudOnboardingSeen: false,
personasEnabled: true,
thinkingEnabled: true,
// Small-Model Mode (v2.5.0) — lean profile for 3B-8B local models.
diff --git a/src/stores/settingsStore.ts b/src/stores/settingsStore.ts
index 78a33563..df1c6757 100644
--- a/src/stores/settingsStore.ts
+++ b/src/stores/settingsStore.ts
@@ -33,7 +33,9 @@ import { DEFAULT_SETTINGS, BUILT_IN_PERSONAS } from '../lib/constants'
// v12 (2.5.7): added settings.comfyGpuMode ('auto'|'cpu'|'gpu', default
// 'auto') for the AMD ComfyUI GPU path (rhodium92). Additive — the merge
// fills the default while preserving every existing value; NVIDIA unaffected.
-const STORE_VERSION = 12
+// v13 (2.5.7): added settings.cloudOnboardingSeen (one-time Cloud onboarding
+// on the first successful switch flip, default false). Additive merge.
+const STORE_VERSION = 13
interface SettingsState {
settings: Settings
diff --git a/src/stores/uiStore.ts b/src/stores/uiStore.ts
index 525e49bc..738f5c56 100644
--- a/src/stores/uiStore.ts
+++ b/src/stores/uiStore.ts
@@ -6,18 +6,23 @@ interface UIState {
currentView: View
sidebarOpen: boolean
/** CloudGateModal (login → plan → beta gate) — opened by the header's
- * Local/Cloud switch when the cloud side isn't usable yet. */
+ * Cloud switch when the cloud side isn't usable yet. */
cloudGateOpen: boolean
+ /** One-time Cloud onboarding — opened on the first successful flip to
+ * Cloud (subscription present, cloudOnboardingSeen still false). */
+ cloudOnboardingOpen: boolean
setView: (view: View) => void
toggleSidebar: () => void
setSidebarOpen: (open: boolean) => void
setCloudGateOpen: (open: boolean) => void
+ setCloudOnboardingOpen: (open: boolean) => void
}
export const useUIStore = create<UIState>()((set) => ({
currentView: 'chat',
sidebarOpen: true,
cloudGateOpen: false,
+ cloudOnboardingOpen: false,
// Sidebar visibility follows the view: it's the conversation list, which
// only makes sense in Chat. The hamburger toggle still works on other views;
@@ -26,4 +31,5 @@ export const useUIStore = create<UIState>()((set) => ({
toggleSidebar: () => set((state) => ({ sidebarOpen: !state.sidebarOpen })),
setSidebarOpen: (open) => set({ sidebarOpen: open }),
setCloudGateOpen: (open) => set({ cloudGateOpen: open }),
+ setCloudOnboardingOpen: (open) => set({ cloudOnboardingOpen: open }),
}))
diff --git a/src/types/settings.ts b/src/types/settings.ts
index 0acb5fc1..4cfe3f8e 100644
--- a/src/types/settings.ts
+++ b/src/types/settings.ts
@@ -23,6 +23,10 @@ export interface Settings {
* you left. Auto-falls back to 'local' when the account signs out.
*/
appMode: AppMode
+ /** One-time Cloud onboarding (David 2026-07-10): the FIRST successful flip
+ * to Cloud shows a short what-changes walkthrough; after that the switch
+ * flips silently. Persisted so it never re-triggers. */
+ cloudOnboardingSeen: boolean
/** Master switch for personas. When off, new chats get no persona system
* prompt (raw model). Default true. Ported from the uselu web companion. */
personasEnabled: boolean