Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

Spaces Settings: six tabs, plain words, one Upgrade button (CUA-2315) (#5982)

cua-agents[bot]37a1ab00d772
diff --git a/apps/cua-spaces-desktop/src/bridge/settings.ts b/apps/cua-spaces-desktop/src/bridge/settings.ts
index e87852644f..54b246c062 100644
--- a/apps/cua-spaces-desktop/src/bridge/settings.ts
+++ b/apps/cua-spaces-desktop/src/bridge/settings.ts
@@ -155,6 +155,18 @@ export function settingsMethods(ctx: BridgeContext): Handlers {
case "auto-connect":
save({ autoConnect: option === "on" });
return;
+ case "global-shortcut": {
+ // The keys that bring the app forward from any app (Mac). The option is the accelerator.
+ const change = parts().system?.setGlobalShortcut;
+ if (!change) throw Failure.failed("This computer has no shortcut to change.");
+ try {
+ change(option);
+ } catch (e) {
+ throw Failure.failed(e instanceof Error ? e.message : String(e));
+ }
+ model.changed("settings");
+ return;
+ }
case "launch-at-login": {
const login = parts().loginItem;
login.set(option === "on");
diff --git a/apps/cua-spaces-desktop/src/bridge/system.ts b/apps/cua-spaces-desktop/src/bridge/system.ts
index eab1882a78..790b6de6e2 100644
--- a/apps/cua-spaces-desktop/src/bridge/system.ts
+++ b/apps/cua-spaces-desktop/src/bridge/system.ts
@@ -40,4 +40,6 @@ export interface SystemServices {
/** The global shortcut (macOS), registered again if the system refused it
* before; absent or null where the shell has none. */
globalShortcut?: () => { label: string; registered: boolean } | null;
+ /** Settings, General, Change: the keys to use instead (an Electron accelerator); throws when another app holds them. Absent where there is no shortcut. */
+ setGlobalShortcut?: (accelerator: string) => { label: string; registered: boolean };
}
diff --git a/apps/cua-spaces-desktop/src/global-shortcut.ts b/apps/cua-spaces-desktop/src/global-shortcut.ts
index 3e96f69a81..faf850a913 100644
--- a/apps/cua-spaces-desktop/src/global-shortcut.ts
+++ b/apps/cua-spaces-desktop/src/global-shortcut.ts
@@ -1,39 +1,79 @@
// SPDX-License-Identifier: FSL-1.1-MIT
// Copyright (c) 2026 Cua AI, Inc.
-// The global shortcut (macOS, as the SwiftUI app's): ⌘⇧Space brings the
-// main window to the front from any app, through Electron's globalShortcut.
+// The global shortcut (macOS, as the SwiftUI app's): ⌘⇧Space (or the keys
+// chosen in Settings, General) brings the main window to the front from any
+// app, through Electron's globalShortcut.
// Another app may already hold the keys; then the registration fails, and
// Settings says so and tries again each time it opens (`ensure`).
import { app, globalShortcut } from "electron";
-export const GLOBAL_SHORTCUT = { label: "⌘⇧Space", accelerator: "Command+Shift+Space" } as const;
+export const DEFAULT_ACCELERATOR = "Command+Shift+Space";
export interface GlobalShortcutState {
label: string;
registered: boolean;
}
+const SYMBOL: Record<string, string> = { Control: "\u2303", Alt: "\u2325", Shift: "\u21e7", Command: "\u2318", Return: "\u21a9", Up: "\u2191", Down: "\u2193", Left: "\u2190", Right: "\u2192" };
+
+/** `Command+Shift+Space` as the Mac writes it: \u2318\u21e7Space. */
+export function shortcutLabel(accelerator: string): string {
+ return accelerator
+ .split("+")
+ .map((p) => SYMBOL[p] ?? p)
+ .join("");
+}
+
+/** A shortcut Settings may set: at least one of Command, Control or Option, then one key (a letter, a digit, F1 to F24, Space or an arrow). */
+const ACCELERATOR = /^(?:(?:Control|Alt|Shift|Command)\+)*(?:Control|Alt|Command)\+(?:(?:Control|Alt|Shift|Command)\+)*(?:[A-Z0-9]|F(?:[1-9]|1\d|2[0-4])|Space|Return|Tab|Backspace|Up|Down|Left|Right)$/;
+
+export const isAccelerator = (value: string): boolean => ACCELERATOR.test(value);
+
export class GlobalShortcut {
private registered = false;
constructor(
private readonly onPress: () => void,
private readonly register: (accelerator: string, callback: () => void) => boolean = (a, cb) => globalShortcut.register(a, cb),
+ private accelerator: string = DEFAULT_ACCELERATOR,
+ private readonly unregister: (accelerator: string) => void = (a) => globalShortcut.unregister(a),
+ private readonly save: (accelerator: string) => void = () => {},
) {}
/** Registers the keys unless they already are; what the system answered. */
ensure(): GlobalShortcutState {
- if (!this.registered) this.registered = this.register(GLOBAL_SHORTCUT.accelerator, this.onPress);
- return { label: GLOBAL_SHORTCUT.label, registered: this.registered };
+ if (!this.registered) this.registered = this.register(this.accelerator, this.onPress);
+ return { label: shortcutLabel(this.accelerator), registered: this.registered };
+ }
+
+ /**
+ * Moves the shortcut to `next`. The new keys are tried first: when another
+ * app holds them the old ones stay, and this throws why.
+ */
+ change(next: string): GlobalShortcutState {
+ if (!isAccelerator(next)) throw new Error(`Not a shortcut Cua Spaces can use: ${next}`);
+ if (next === this.accelerator) return this.ensure();
+ if (!this.register(next, this.onPress)) throw new Error(`Another app is using ${shortcutLabel(next)}. Pick other keys.`);
+ if (this.registered) this.unregister(this.accelerator);
+ this.accelerator = next;
+ this.registered = true;
+ this.save(next);
+ return { label: shortcutLabel(next), registered: true };
}
}
/** The shortcut on macOS (the Windows and Linux shells have none), registered
- * once the app is ready and released when it quits. */
-export function installGlobalShortcut(platform: NodeJS.Platform, onPress: () => void): GlobalShortcut | null {
+ * once the app is ready and released when it quits. `saved` is the keys the
+ * person chose last time (none: the default). */
+export function installGlobalShortcut(
+ platform: NodeJS.Platform,
+ onPress: () => void,
+ saved: { read(): string | undefined; write(accelerator: string): void } = { read: () => undefined, write: () => {} },
+): GlobalShortcut | null {
if (platform !== "darwin") return null;
- const shortcut = new GlobalShortcut(onPress);
+ const stored = saved.read();
+ const shortcut = new GlobalShortcut(onPress, undefined, stored && isAccelerator(stored) ? stored : DEFAULT_ACCELERATOR, undefined, saved.write);
shortcut.ensure();
app.on("will-quit", () => globalShortcut.unregisterAll());
return shortcut;
diff --git a/apps/cua-spaces-desktop/src/main.ts b/apps/cua-spaces-desktop/src/main.ts
index a6db2886e7..9d02dfd56a 100644
--- a/apps/cua-spaces-desktop/src/main.ts
+++ b/apps/cua-spaces-desktop/src/main.ts
@@ -351,10 +351,14 @@ if (!app.requestSingleInstanceLock()) {
// ⌘⇧Space from any app: the main window, in front (never under the e2e switch).
const shortcut = E2E_DEMO
? null
- : installGlobalShortcut(process.platform, () => {
- app.focus({ steal: true });
- showMain();
- });
+ : installGlobalShortcut(
+ process.platform,
+ () => {
+ app.focus({ steal: true });
+ showMain();
+ },
+ { read: () => readSettings().globalShortcut, write: (accelerator) => writeSettings({ globalShortcut: accelerator }) },
+ );
let host: Awaited<ReturnType<typeof startNativeHost>> | null = null;
if (!E2E_DEMO) {
try {
diff --git a/apps/cua-spaces-desktop/src/settings.ts b/apps/cua-spaces-desktop/src/settings.ts
index 50e4174edb..a615c22c9a 100644
--- a/apps/cua-spaces-desktop/src/settings.ts
+++ b/apps/cua-spaces-desktop/src/settings.ts
@@ -45,6 +45,8 @@ export interface Settings {
pipBounds?: { x: number; y: number; width: number; height: number };
/** Where the last Space viewer was left, and its content's width (viewer.ts). */
viewerBounds?: { x: number; y: number; width: number };
+ /** The keys that bring the app forward from any app, as an Electron accelerator (Settings, General; unset: ⌘⇧Space). */
+ globalShortcut?: string;
/** Present once the Swift app's state was taken over (macOS). */
swiftMigration?: SwiftMigration;
}
diff --git a/apps/cua-spaces-desktop/src/system.ts b/apps/cua-spaces-desktop/src/system.ts
index 2b370cf5ad..e30558094f 100644
--- a/apps/cua-spaces-desktop/src/system.ts
+++ b/apps/cua-spaces-desktop/src/system.ts
@@ -73,5 +73,6 @@ export function makeSystem(o: {
updater: ElectronUpdater.start(),
home: process.env.HOME || os.homedir(),
globalShortcut: () => o.globalShortcut?.ensure() ?? null,
+ setGlobalShortcut: o.globalShortcut ? (accelerator) => o.globalShortcut!.change(accelerator) : undefined,
};
}
diff --git a/apps/cua-spaces-desktop/test/global-shortcut.test.ts b/apps/cua-spaces-desktop/test/global-shortcut.test.ts
index b81db04d10..4f23d410f2 100644
--- a/apps/cua-spaces-desktop/test/global-shortcut.test.ts
+++ b/apps/cua-spaces-desktop/test/global-shortcut.test.ts
@@ -8,7 +8,7 @@ import { describe, expect, it, vi } from "vitest";
const register = vi.fn(() => true);
const on = vi.fn();
vi.mock("electron", () => ({ app: { on }, globalShortcut: { register, unregisterAll: vi.fn() } }));
-const { GlobalShortcut, installGlobalShortcut } = await import("../src/global-shortcut");
+const { GlobalShortcut, installGlobalShortcut, isAccelerator, shortcutLabel } = await import("../src/global-shortcut");
describe("the global shortcut", () => {
it("is the Mac's only", () => {
@@ -41,3 +41,57 @@ describe("the global shortcut", () => {
expect(pressed).toHaveBeenCalledOnce();
});
});
+
+describe("changing the global shortcut (Settings, General)", () => {
+ const make = (answers: Record<string, boolean>) => {
+ const registered: string[] = [];
+ const unregistered: string[] = [];
+ const saved: string[] = [];
+ const shortcut = new GlobalShortcut(
+ () => {},
+ (a) => {
+ if (answers[a] === false) return false;
+ registered.push(a);
+ return true;
+ },
+ "Command+Shift+Space",
+ (a) => unregistered.push(a),
+ (a) => saved.push(a),
+ );
+ return { shortcut, registered, unregistered, saved };
+ };
+
+ it("moves to the new keys, lets go of the old ones and remembers the choice", () => {
+ const { shortcut, registered, unregistered, saved } = make({});
+ shortcut.ensure();
+ expect(shortcut.change("Control+Alt+K")).toEqual({ label: "\u2303\u2325K", registered: true });
+ expect(registered).toEqual(["Command+Shift+Space", "Control+Alt+K"]);
+ expect(unregistered).toEqual(["Command+Shift+Space"]);
+ expect(saved).toEqual(["Control+Alt+K"]);
+ expect(shortcut.ensure().label).toBe("\u2303\u2325K");
+ });
+
+ it("keeps the old keys and says why when another app holds the new ones", () => {
+ const { shortcut, unregistered, saved } = make({ "Command+K": false });
+ shortcut.ensure();
+ expect(() => shortcut.change("Command+K")).toThrow("Another app is using \u2318K");
+ expect(unregistered).toEqual([]);
+ expect(saved).toEqual([]);
+ expect(shortcut.ensure()).toEqual({ label: "\u2318\u21e7Space", registered: true });
+ });
+
+ it("takes only shortcuts with Command, Control or Option and one key", () => {
+ for (const ok of ["Command+Shift+Space", "Control+Alt+K", "Alt+1", "Command+F12", "Shift+Command+Up"]) expect(isAccelerator(ok), ok).toBe(true);
+ for (const bad of ["K", "Shift+K", "Command", "Command+Shift", "Command+kk", "Command+F25", "", "Command+Shift+Space+K"]) expect(isAccelerator(bad), bad).toBe(false);
+ expect(() => make({}).shortcut.change("Shift+K")).toThrow("Not a shortcut");
+ expect(shortcutLabel("Command+Shift+Space")).toBe("\u2318\u21e7Space");
+ });
+
+ it("starts on the keys chosen last time, and on the default when the saved ones are not a shortcut", () => {
+ register.mockClear();
+ installGlobalShortcut("darwin", () => {}, { read: () => "Control+Alt+K", write: () => {} });
+ expect(register).toHaveBeenLastCalledWith("Control+Alt+K", expect.any(Function));
+ installGlobalShortcut("darwin", () => {}, { read: () => "nonsense", write: () => {} });
+ expect(register).toHaveBeenLastCalledWith("Command+Shift+Space", expect.any(Function));
+ });
+});
diff --git a/apps/cua-spaces-desktop/test/host-bridge.test.ts b/apps/cua-spaces-desktop/test/host-bridge.test.ts
index 3f12a322a2..2b93f7f002 100644
--- a/apps/cua-spaces-desktop/test/host-bridge.test.ts
+++ b/apps/cua-spaces-desktop/test/host-bridge.test.ts
@@ -534,6 +534,14 @@ describe.skipIf(!built)("This machine, Devices and Settings on the app core", ()
expect(s.globalShortcut).toEqual({ label: "\u2318\u21e7Space", registered: false });
});
+ it("changes the global shortcut from General, and says when another app holds the keys", async () => {
+ await call("settings.choose", { row: "global-shortcut", option: "Control+Alt+K" });
+ expect(system.shortcutChanges).toEqual(["Control+Alt+K"]);
+ expect(((await call("settings.get")) as { globalShortcut: unknown }).globalShortcut).toEqual({ label: "Control+Alt+K", registered: true });
+ expect(await code("settings.choose", { row: "global-shortcut", option: "Command+K" })).toBe("failed");
+ expect(system.shortcutChanges).toEqual(["Control+Alt+K"]);
+ });
+
it("chooses each row as the Swift app does", async () => {
let settingsEvents = 0;
bridge.events.subscribe((e) => e.event === "settings.changed" && settingsEvents++);
diff --git a/apps/cua-spaces-desktop/test/host-fixtures.ts b/apps/cua-spaces-desktop/test/host-fixtures.ts
index 173861282e..e274352ce6 100644
--- a/apps/cua-spaces-desktop/test/host-fixtures.ts
+++ b/apps/cua-spaces-desktop/test/host-fixtures.ts
@@ -302,6 +302,14 @@ export class FixtureSystem implements SystemServices {
globalShortcut() {
return this.shortcut;
}
+ /** Settings, General, Change: the keys asked for; "Command+K" is held by another app. */
+ readonly shortcutChanges: string[] = [];
+ setGlobalShortcut(accelerator: string) {
+ if (accelerator === "Command+K") throw new Error("Another app is using \u2318K. Pick other keys.");
+ this.shortcutChanges.push(accelerator);
+ this.shortcut = { label: accelerator, registered: true };
+ return this.shortcut;
+ }
async openExternal(url: string) {
this.opened.push(url);
}
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/ElasticModel.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/ElasticModel.swift
index 7a1ff8ae40..a1d4acfea2 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/ElasticModel.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/ElasticModel.swift
@@ -207,6 +207,8 @@ public final class ElasticModel {
let reader = readLedger
let text = await Task.detached { reader() }.value
events = ElasticEvent.recent(ledger: text ?? "", limit: Self.eventLimit)
+ // Throttle from when the read finished: a slow read must not make the next one due at once.
+ readAt = Date()
}
/// `cloud_hosts` as it came.
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift
index 3d36f7620f..c33e3999f3 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift
@@ -974,6 +974,8 @@ struct ViewModelTests {
let ids = model.spaces.map(\.id)
#expect(ids.contains("local:fresh") && !ids.contains(row.id), "\(ids)")
#expect(model.creates.pending.isEmpty)
+ // The selection follows the hand-over a beat after the pending row leaves the list.
+ if plan.openDesktop { try await waitUntil { model.selectedSpaceId == "local:fresh" } }
if plan.openDesktop { #expect(model.selectedSpaceId == "local:fresh") }
try await waitUntil { opened == (openWhenReady ? ["local:fresh"] : []) }
try await Task.sleep(for: .milliseconds(100))
diff --git a/apps/cua-spaces-web/e2e/agent-keys.ts b/apps/cua-spaces-web/e2e/agent-keys.ts
index fbb3f8130a..61af130551 100644
--- a/apps/cua-spaces-web/e2e/agent-keys.ts
+++ b/apps/cua-spaces-web/e2e/agent-keys.ts
@@ -2,7 +2,7 @@
// Copyright (c) 2026 Cua AI, Inc.
/**
- * Screen checks for the `agent-keys` flow (Settings → Agents): each section,
+ * Screen checks for the `agent-keys` flow (Settings, Connected apps, Account keys): each section,
* sheet and Remove question the replay reached goes on the real screen
* through `window.__cuaParity.showAgentKeys`, and the screen must show the
* core's words. Then a key is added and removed for real on the demo host,
@@ -13,6 +13,7 @@ import { expect, type Locator, type Page } from "@playwright/test";
import type { ParityCheckpoint } from "../src/bridge/parity";
import type { AgentKeysCheckpoint } from "../src/bridge/parity-agent-keys";
+import { KEYS_ADD_OTHER_BUTTON, KEYS_OTHER_HELP, KEYS_TITLE, plainKeysIntro } from "../src/lib/settings-copy";
type Of<K extends AgentKeysCheckpoint["kind"]> = Extract<AgentKeysCheckpoint, { kind: K }>;
@@ -38,7 +39,7 @@ export async function checkAgentKeys(page: Page, checkpoints: ParityCheckpoint[]
for (const { input, view } of unique(checkpoints, "agent-keys")) {
await page.evaluate((i) => window.__cuaParity!.showAgentKeys(i), input);
- const step = `Settings → Agents with ${input.keys.map((k) => k.env).join(", ") || "no keys"}${view.notice ? " (notice)" : ""}`;
+ const step = `Settings, Connected apps with ${input.keys.map((k) => k.env).join(", ") || "no keys"}${view.notice ? " (notice)" : ""}`;
const rows = page.locator("[data-agent-key-row]");
await expect.poll(() => attrs(rows, "data-agent-key-row"), { message: step }).toEqual(view.rows.map((r) => r.env));
expect(await texts(page.locator("[data-agent-key-title]")), step).toEqual(view.rows.map((r) => r.title));
@@ -50,10 +51,11 @@ export async function checkAgentKeys(page: Page, checkpoints: ParityCheckpoint[]
const added = await texts(page.locator("[data-agent-key-added]"));
expect(added.length, step).toBe(view.rows.filter((r) => r.addedMs !== null).length);
for (const a of added) expect(a.startsWith(`${view.addedLabel} `), step).toBe(true);
- await expect(page.locator("[data-agent-keys-intro]"), step).toHaveText(view.intro);
- await expect(page.locator("[data-agent-keys-title]"), step).toHaveText(view.title);
- await expect(page.locator("[data-agent-key-add-other]"), step).toHaveText(view.addOtherLabel);
- await expect(page.locator("[data-agent-key-other-help]"), step).toHaveText(view.otherHelp);
+ await expect(page.locator("[data-agent-keys-intro]"), step).toHaveText(plainKeysIntro(view.intro));
+ // The page says Account keys where the core says Agents; the rest of the words are the core's.
+ await expect(page.locator("[data-agent-keys-title]"), step).toHaveText(KEYS_TITLE);
+ await expect(page.locator("[data-agent-key-add-other]"), step).toHaveText(KEYS_ADD_OTHER_BUTTON);
+ await expect(page.locator("[data-agent-key-other-help]"), step).toHaveText(KEYS_OTHER_HELP);
if (view.notice) await expect(page.locator("[data-agent-keys-notice]"), step).toContainText(view.notice);
else await expect(page.locator("[data-agent-keys-notice]"), step).toHaveCount(0);
for (const b of await page.locator("[data-agent-key-action], [data-agent-key-add-other]").all()) {
@@ -107,7 +109,7 @@ export async function checkAgentKeys(page: Page, checkpoints: ParityCheckpoint[]
}
// For real on the demo host: add an Anthropic key, then remove it.
- await page.goto("/settings/agents?bridge=demo");
+ await page.goto("/settings/connected-apps?bridge=demo");
const anthropic = page.locator('[data-agent-key-row="ANTHROPIC_API_KEY"]');
await expect(anthropic.locator("[data-agent-key-status]")).toHaveText("Not set");
await anthropic.locator("[data-agent-key-action]").click();
diff --git a/apps/cua-spaces-web/e2e/flows.ts b/apps/cua-spaces-web/e2e/flows.ts
index 15a6e3dabe..5f8a667603 100644
--- a/apps/cua-spaces-web/e2e/flows.ts
+++ b/apps/cua-spaces-web/e2e/flows.ts
@@ -12,7 +12,7 @@
* does not name.
*/
-/** The page a flow opens on: `spaces`, `keyvault`, the Settings tabs,
+/** The page a flow opens on: `spaces`, `keyvault`, the Settings tabs (Account is `settings`),
* `notifications`, `machines` (This machine), `agents`, `volume`,
* `onboarding`, a Space's detail (`space-detail`, opened from Spaces), or a
* sheet over Spaces (`new-space`, `teleport`, `share`). */
@@ -20,10 +20,11 @@ export type ParityScreen =
| "spaces"
| "keyvault"
| "settings"
+ | "settings/general"
| "settings/about"
- | "settings/agents"
+ | "settings/advanced"
+ | "settings/connected-apps"
| "settings/devices"
- | "settings/experiments"
| "notifications"
| "machines"
| "agents"
@@ -63,7 +64,7 @@ export const FLOW_PLAN: Record<string, FlowPlan> = {
"create-stages": { status: "run", screen: "spaces" },
"create-retry": { status: "run", screen: "spaces" },
devices: { status: "run", screen: "settings/devices" },
- "driver-card": { status: "run", screen: "settings" },
+ "driver-card": { status: "run", screen: "settings/connected-apps" },
"share-sheet": { status: "run", screen: "share" },
"agents-page": { status: "run", screen: "agents" },
"drive-page": { status: "run", screen: "volume" },
@@ -72,14 +73,14 @@ export const FLOW_PLAN: Record<string, FlowPlan> = {
status: "skip",
reason: "The 0.10.0 first run has no Cua Volume page (connect the agent, then this computer); Cua Volume is set up from its own page (drive-page, drive-storage)",
},
- "drive-storage": { status: "run", screen: "settings" },
+ "drive-storage": { status: "run", screen: "volume" },
notifications: { status: "run", screen: "notifications" },
about: { status: "run", screen: "settings/about" },
- "agent-keys": { status: "run", screen: "settings/agents" },
+ "agent-keys": { status: "run", screen: "settings/connected-apps" },
"your-cloud": { status: "run", screen: "new-space" },
"telemetry-funnel": { status: "run", screen: "spaces" },
- "launch-at-login": { status: "run", screen: "settings" },
- experiments: { status: "run", screen: "settings/experiments" },
+ "launch-at-login": { status: "run", screen: "settings/general" },
+ experiments: { status: "run", screen: "settings/advanced" },
"placement-picker": { status: "run", screen: "new-space" },
machines: { status: "run", screen: "machines" },
"first-run": {
diff --git a/apps/cua-spaces-web/e2e/parity.spec.ts b/apps/cua-spaces-web/e2e/parity.spec.ts
index 290f34399c..68789dfeda 100644
--- a/apps/cua-spaces-web/e2e/parity.spec.ts
+++ b/apps/cua-spaces-web/e2e/parity.spec.ts
@@ -40,10 +40,11 @@ const PATHS: Record<ParityScreen, string> = {
spaces: "/spaces",
keyvault: "/keyvault",
settings: "/settings",
+ "settings/general": "/settings/general",
"settings/about": "/settings/about",
- "settings/agents": "/settings/agents",
+ "settings/advanced": "/settings/advanced",
+ "settings/connected-apps": "/settings/connected-apps",
"settings/devices": "/settings/devices",
- "settings/experiments": "/settings/experiments",
notifications: "/notifications",
machines: "/machines",
agents: "/agents",
@@ -453,7 +454,7 @@ test.describe("parity flows", () => {
? await checkTeleport(page, cps)
: screen === "share"
? await checkShare(page, cps)
- : screen === "volume" || screen === "onboarding" || screen === "settings"
+ : screen === "volume" || screen === "onboarding" || screen === "settings/connected-apps"
? await checkVolumeFlow(page, name, cps)
: await checkScreens(page, screen, cps);
expect(states, "the replay reached a state the screen draws").toBeGreaterThan(0);
diff --git a/apps/cua-spaces-web/e2e/settings-checks.ts b/apps/cua-spaces-web/e2e/settings-checks.ts
index 6da55c3f04..f842109375 100644
--- a/apps/cua-spaces-web/e2e/settings-checks.ts
+++ b/apps/cua-spaces-web/e2e/settings-checks.ts
@@ -14,6 +14,7 @@ import { expect, type Locator, type Page } from "@playwright/test";
import type { ParityCheckpoint } from "../src/bridge/parity";
import type { SettingsCheckpoint } from "../src/bridge/parity-settings";
import type { SettingsRow } from "../src/bridge/contracts/host";
+import { LAUNCH_HELP, LAUNCH_LABEL, lastChecked, plainDevice, plainDeviceSentence, plainStorage } from "../src/lib/settings-copy";
import { checkAgentKeys } from "./agent-keys";
type Of<K extends SettingsCheckpoint["kind"]> = Extract<SettingsCheckpoint, { kind: K }>;
@@ -32,10 +33,7 @@ const of = <K extends SettingsCheckpoint["kind"]>(checkpoints: ParityCheckpoint[
const texts = (l: Locator) => l.evaluateAll((els) => els.map((el) => (el.textContent ?? "").trim()));
const attrs = (l: Locator, name: string) => l.evaluateAll((els, n) => els.map((el) => el.getAttribute(n) ?? ""), name);
-/** Goes to a Settings tab without reloading (the store keeps what the harness put there). */
-async function tab(page: Page, label: string): Promise<void> {
- await page.locator('nav[aria-label="Settings"]').getByRole("link", { name: label, exact: true }).click();
-}
+const navigate = (page: Page, path: string) => page.evaluate((p) => window.__cuaParity!.navigate(p), path);
/* ---- Rows the core lays out ------------------------------------------------ */
@@ -70,23 +68,23 @@ const readRows = (rows: Locator): Promise<DrawnRow[]> =>
}),
);
-/** What a core row should look like drawn. */
-function expectedRow(r: SettingsRow): DrawnRow {
+/** What a core row should look like drawn. `words` is the page's plain-language pass over the core's text (none: as is). */
+function expectedRow(r: SettingsRow, words: (text: string) => string = (t) => t): DrawnRow {
const active = r.options.find((o) => o.active);
return {
id: r.id,
kind: r.kind,
enabled: String(r.enabled),
- label: r.label,
- value: r.kind === "field" || r.kind === "secret" || r.kind === "text" || r.kind === "prompt" ? (r.value ?? "") : "",
- button: r.kind === "text" ? (r.button ?? "") : "",
+ label: words(r.label),
+ value: r.kind === "field" || r.kind === "secret" || r.kind === "text" || r.kind === "prompt" ? words(r.value ?? "") : "",
+ button: r.kind === "text" ? words(r.button ?? "") : "",
on: r.kind === "toggle" ? String(r.options.find((o) => o.id === "on")?.active ?? false) : null,
- choice: r.kind === "choice" ? (active?.label ?? null) : null,
+ choice: r.kind === "choice" ? (active ? words(active.label) : null) : null,
};
}
-async function expectRows(rows: Locator, want: SettingsRow[], message: string): Promise<void> {
- const expected = want.map(expectedRow);
+async function expectRows(rows: Locator, want: SettingsRow[], message: string, words?: (text: string) => string): Promise<void> {
+ const expected = want.map((r) => expectedRow(r, words));
await expect.poll(() => readRows(rows), { message }).toEqual(expected);
}
@@ -99,7 +97,7 @@ async function checkAbout(page: Page, checkpoints: ParityCheckpoint[]): Promise<
const step = `About for ${view.versionLine}${view.updates ? "" : ", no updater"}`;
await expect(page.locator("[data-about-title]"), step).toHaveText(view.title);
await expect(page.locator("[data-about-version]"), step).toHaveText(view.versionLine);
- await expect.poll(() => texts(page.locator("[data-about-link]")), { message: step }).toEqual(view.links.map((l) => l.label));
+ await expect.poll(() => texts(page.locator("[data-about-link-label]")), { message: step }).toEqual(view.links.map((l) => l.label));
await expect(page.locator("[data-about-copyright]"), step).toHaveText(view.copyright);
const updates = page.locator("[data-about-updates]");
if (!view.updates) {
@@ -107,15 +105,13 @@ async function checkAbout(page: Page, checkpoints: ParityCheckpoint[]): Promise<
continue;
}
const u = view.updates;
- await expect(page.locator("[data-about-check]"), step).toHaveText(u.checkLabel);
+ // The page says "Check now", and one switch for checking and installing; Beta is in Advanced.
+ await expect(page.locator("[data-about-check]"), step).toHaveText("Check now");
if (u.checkEnabled) await expect(page.locator("[data-about-check]"), step).toBeEnabled();
else await expect(page.locator("[data-about-check]"), step).toBeDisabled();
- await expect(page.locator("[data-about-last-check]"), step).toHaveText(u.lastCheck);
+ await expect(page.locator("[data-about-last-check]"), step).toHaveText(lastChecked(u.lastCheck));
await expect(page.locator("[data-about-auto-check]"), step).toHaveAttribute("aria-checked", String(u.autoCheck));
- await expect(page.locator("[data-about-auto-install]"), step).toHaveAttribute("aria-checked", String(u.autoInstall));
- if (u.autoInstallEnabled) await expect(page.locator("[data-about-auto-install]"), step).not.toHaveAttribute("data-disabled");
- else await expect(page.locator("[data-about-auto-install]"), step).toHaveAttribute("data-disabled");
- await expect(updates.getByRole("combobox"), step).toHaveText(u.channels.find((c) => c.active)!.label);
+ await expect(updates.getByRole("combobox"), step).toHaveCount(0);
}
return states.length;
}
@@ -131,21 +127,21 @@ async function checkDevices(page: Page, checkpoints: ParityCheckpoint[]): Promis
const { input, now, view: v } = cp;
await page.evaluate(([i, n]) => window.__cuaParity!.settings.showDevices(i, n), [input, now] as const);
const step = `Devices: ${v.thisDevice.title}`;
- if (v.banner) await expect(page.locator("[data-banner-text]"), step).toHaveText(v.banner.text);
+ if (v.banner) await expect(page.locator("[data-banner-text]"), step).toHaveText(plainDeviceSentence(v.banner.text));
else await expect(page.locator("[data-devices-banner]"), step).toHaveCount(0);
await expect(page.locator("[data-this-device-status]"), step).toHaveAttribute("data-this-device-status", v.thisDevice.kind);
- await expect(page.locator("[data-this-device-status]"), step).toContainText(v.thisDevice.title);
+ await expect(page.locator("[data-this-device-status]"), step).toContainText(plainDevice(v.thisDevice.title));
await expect(page.locator("[data-this-device-enroll]"), step).toHaveCount(v.thisDevice.actionLabel ? 1 : 0);
await expect.poll(() => attrs(page.locator("[data-device-row]"), "data-device-row"), { message: step }).toEqual(v.rows.map((r) => r.id));
expect(await texts(page.locator("[data-device-title]")), step).toEqual(v.rows.map((r) => r.title));
const details = await texts(page.locator("[data-device-detail]"));
- v.rows.forEach((r, i) => expect(details[i], `${step}: ${r.id}`).toContain(r.detail));
+ v.rows.forEach((r, i) => expect(details[i], `${step}: ${r.id}`).toContain(plainDevice(r.detail)));
for (const r of v.rows) {
const row = page.locator(`[data-device-row="${r.id}"]`);
await expect(row.locator("[data-device-approve]"), `${step}: ${r.id} Approve`).toHaveCount(r.actions.includes("approve") ? 1 : 0);
await expect(row.locator("[data-device-menu]"), `${step}: ${r.id} menu`).toHaveCount(r.actions.some((a) => a === "rename" || a === "revoke") ? 1 : 0);
}
- expect(await texts(page.locator("[data-recent-text]")), step).toEqual(v.recent.map((a) => a.text));
+ expect(await texts(page.locator("[data-recent-text]")), step).toEqual(v.recent.map((a) => plainDeviceSentence(a.text)));
expect(await attrs(page.locator("[data-unconfirmed-machine]"), "data-unconfirmed-machine"), step).toEqual(v.unconfirmedMachines.map((m) => m.id));
checked++;
} else if (cp.kind === "enroll" && last) {
@@ -153,7 +149,7 @@ async function checkDevices(page: Page, checkpoints: ParityCheckpoint[]): Promis
await page.evaluate(([i, n, s]) => window.__cuaParity!.settings.showDevices(i, n, { enroll: s }), [last.input, last.now, state] as const);
const sheet = page.locator("[data-enroll]");
const step = `Enroll sheet, ${state.phase}`;
- await expect(sheet.locator("[data-enroll-title]"), step).toHaveText(v.title);
+ await expect(sheet.locator("[data-enroll-title]"), step).toHaveText(plainDeviceSentence(v.title));
expect(await attrs(sheet.locator("[data-enroll-option]"), "data-enroll-option"), step).toEqual(v.options.map((o) => o.method));
await expect(sheet.locator("[data-enroll-code]"), step).toHaveCount(v.code ? 1 : 0);
if (v.code) await expect(sheet.locator("[data-enroll-code]"), step).toHaveText(v.code);
@@ -169,8 +165,8 @@ async function checkDevices(page: Page, checkpoints: ParityCheckpoint[]): Promis
await page.evaluate(([i, n, s]) => window.__cuaParity!.settings.showDevices(i, n, { approve: s }), [last.input, last.now, state] as const);
const sheet = page.locator("[data-approve]");
const step = `Approval sheet for ${state.name}, code "${state.code}"${state.busy ? ", busy" : ""}`;
- await expect(sheet.locator("[data-approve-title]"), step).toHaveText(v.title);
- await expect(sheet.locator("[data-approve-message]"), step).toHaveText(v.message);
+ await expect(sheet.locator("[data-approve-title]"), step).toHaveText(plainDeviceSentence(v.title));
+ await expect(sheet.locator("[data-approve-message]"), step).toHaveText(plainDeviceSentence(v.message));
await expect(sheet.locator("[data-approve-code]"), step).toHaveCount(v.needsCode ? 1 : 0);
if (v.needsCode) await expect(sheet.locator("[data-approve-code]"), step).toHaveValue(v.code);
if (v.error) await expect(sheet.locator("[data-approve-error]"), step).toHaveText(v.error);
@@ -191,7 +187,10 @@ async function checkLoginItem(page: Page, checkpoints: ParityCheckpoint[]): Prom
const states = of(checkpoints, "login-item");
for (const { loginItem, experiments, rows } of states) {
await page.evaluate(([l, x]) => window.__cuaParity!.settings.showLoginItem(l, x), [loginItem, experiments] as const);
- await expectRows(page.locator('[data-setting-row^="launch-at-login"]'), rows, `launch at login, ${JSON.stringify(loginItem)}`);
+ // The page words the switch itself and puts its one line (the core's note) under the label.
+ const shown = rows.filter((r) => r.id !== "launch-at-login-note").map((r) => (r.id === "launch-at-login" ? { ...r, label: LAUNCH_LABEL } : r));
+ await expectRows(page.locator('[data-setting-row^="launch-at-login"]'), shown, `launch at login, ${JSON.stringify(loginItem)}`);
+ await expect(page.locator('[data-setting-row="launch-at-login"] [data-row-description]'), `launch at login, ${JSON.stringify(loginItem)}`).toHaveText(LAUNCH_HELP);
}
return states.length;
}
@@ -202,7 +201,7 @@ async function checkStorage(page: Page, checkpoints: ParityCheckpoint[]): Promis
await page.evaluate(([i, s]) => window.__cuaParity!.settings.showStorage(i, s), [input, state] as const);
const drawn = page.locator('[data-settings-section="storage"]');
const step = `Storage (${input.os}, ${input.storage?.backend ?? "no daemon"}, ${state.request?.kind ?? "idle"})`;
- await expectRows(drawn.locator("[data-setting-row]"), section.rows, step);
+ await expectRows(drawn.locator("[data-setting-row]"), section.rows, step, plainStorage);
await expect(drawn.locator("[data-section-button]"), step).toHaveCount(section.button ? 1 : 0);
if (section.button) await expect(drawn.locator("[data-section-button]"), step).toHaveText(section.button);
}
@@ -211,26 +210,31 @@ async function checkStorage(page: Page, checkpoints: ParityCheckpoint[]): Promis
/* ---- Experiments ------------------------------------------------------------ */
+/** Advanced keeps Labs: Cua Volume and, on the Mac-native app, the previous window. Sharing and Your cloud have no switch. */
+const LABS: Record<string, { label?: string; note: string }> = {
+ "experiment:cua_volume": { note: "Memory and files your agents share across every Space." },
+ "experiment:classic_ui": { label: "Use the previous Spaces window", note: "Mac-native app only." },
+};
+
async function checkExperiments(page: Page, checkpoints: ParityCheckpoint[]): Promise<number> {
let checked = 0;
for (const { experiments, page: tabPage } of of(checkpoints, "experiments-tab")) {
await page.evaluate((x) => window.__cuaParity!.settings.showExperiments(x), experiments);
- const rows = tabPage.sections.flatMap((s) => s.rows);
- const toggles = rows.filter((r) => r.kind === "toggle");
- const step = `Experiments tab, ${JSON.stringify(experiments)}`;
- const drawn = page.locator('[data-setting-row][data-kind="toggle"]');
- await expectRows(drawn, toggles, step);
- const notes = await texts(drawn.locator("[data-row-description]"));
- expect(notes, step).toEqual(toggles.map((t) => rows.find((r) => r.id === `${t.id}-note`)?.label ?? ""));
+ const toggles = tabPage.sections.flatMap((s) => s.rows).filter((r) => r.kind === "toggle" && r.id in LABS);
+ const step = `Advanced, Labs, ${JSON.stringify(experiments)}`;
+ const drawn = page.locator('[data-settings-tab="advanced"] [data-setting-row^="experiment:"]');
+ await expectRows(drawn, toggles.map((t) => ({ ...t, label: LABS[t.id]!.label ?? t.label })), step);
+ expect(await texts(drawn.locator("[data-row-description]")), step).toEqual(toggles.map((t) => LABS[t.id]!.note));
checked++;
}
- // Then General: Storage after it only with Cua Volume, and the launch-at-login line.
- await tab(page, "General");
+ // Then the Volume page: Storage after it only with Cua Volume, and General's launch-at-login line.
+ await navigate(page, "/volume");
for (const { experiments, sections } of of(checkpoints, "with-storage")) {
await page.evaluate((x) => window.__cuaParity!.settings.showExperiments(x), experiments);
await expect(page.locator('[data-settings-section="storage"]'), `Storage with ${JSON.stringify(experiments)}`).toHaveCount(sections.includes("storage") ? 1 : 0);
checked++;
}
+ await navigate(page, "/settings/general");
return checked + (await checkLoginItem(page, checkpoints));
}
diff --git a/apps/cua-spaces-web/e2e/settings-tab-layout.spec.ts b/apps/cua-spaces-web/e2e/settings-tab-layout.spec.ts
index d15bc34e58..7e03e35622 100644
--- a/apps/cua-spaces-web/e2e/settings-tab-layout.spec.ts
+++ b/apps/cua-spaces-web/e2e/settings-tab-layout.spec.ts
@@ -2,8 +2,8 @@
// Copyright (c) 2026 Cua AI, Inc.
/**
- * Settings tabs keep their place: General is long (the page scrolls), the
- * others are short (it doesn't). The page's scrollbar must not take width
+ * Settings tabs keep their place: some are long (Connected apps: the page
+ * scrolls), the others are short (it doesn't). The page's scrollbar must not take width
* from the column on one tab and not the other, or the tab bar and content
* jump sideways when you switch.
*/
@@ -11,16 +11,17 @@
import { expect, test } from "./host";
const TABS = [
- ["General", "/settings"],
- ["Agents", "/settings/agents"],
- ["Devices", "/settings/devices"],
- ["Experiments", "/settings/experiments"],
+ ["Account", "/settings"],
+ ["General", "/settings/general"],
+ ["Connected apps", "/settings/connected-apps"],
+ ["Trusted devices", "/settings/devices"],
+ ["Advanced", "/settings/advanced"],
["About", "/settings/about"],
] as const;
-// A short window, so General scrolls; a Settings tab bar and heading to measure.
+// A window that fits the short tabs but not Connected apps; a Settings tab bar and heading to measure.
test.use({
- viewport: { width: 1100, height: 520 },
+ viewport: { width: 1100, height: 900 },
// Headless Chromium hides scrollbars by default; a Mac window with a mouse
// (or "always show scrollbars") shows them, and they take width.
launchOptions: { ignoreDefaultArgs: ["--hide-scrollbars"] },
@@ -28,14 +29,16 @@ test.use({
test("Settings: the heading, tab bar and content keep their left edge across tabs", async ({ page }) => {
await page.goto("/settings?bridge=demo&parity");
- const nav = page.getByRole("navigation", { name: "Settings" });
+ // The window's own size is the host's (the Electron window ignores the viewport): fix the page's height here.
+ await page.addStyleTag({ content: "html, body, #root { height: 760px !important; max-height: 760px !important; overflow: hidden !important; }" });
+ const nav = page.getByRole("tablist", { name: "Settings" });
await nav.waitFor();
type Edges = { heading: number; nav: number; content: number; scrolls: boolean };
const edges: Record<string, Edges> = {};
for (const [label] of TABS) {
- await nav.getByRole("link", { name: label, exact: true }).click();
- await expect(nav.getByRole("link", { name: label, exact: true })).toHaveAttribute("data-status", "active");
+ await nav.getByRole("tab", { name: label, exact: true }).click();
+ await expect(nav.getByRole("tab", { name: label, exact: true })).toHaveAttribute("aria-selected", "true");
await page.waitForTimeout(150);
edges[label] = await page.evaluate(() => {
const nav = document.querySelector('nav[aria-label="Settings"]')!;
@@ -55,11 +58,11 @@ test("Settings: the heading, tab bar and content keep their left edge across tab
expect(scrolling).toContain(true);
expect(scrolling).toContain(false);
- const base = edges.General!;
+ const base = edges.Account!;
for (const [label] of TABS) {
const e = edges[label]!;
expect({ heading: e.heading, nav: e.nav }, label).toEqual({ heading: base.heading, nav: base.nav });
- // A tab with nothing to show yet (Experiments, none on) has no content to measure.
+ // A tab with nothing to show yet has no content to measure.
if (e.content >= 0) expect(e.content, label).toBe(base.content);
}
});
diff --git a/apps/cua-spaces-web/src/__tests__/about-updates.test.tsx b/apps/cua-spaces-web/src/__tests__/about-updates.test.tsx
index 8e98a4ff63..bc925c72e5 100644
--- a/apps/cua-spaces-web/src/__tests__/about-updates.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/about-updates.test.tsx
@@ -54,11 +54,11 @@ describe.skipIf(!wasmBuilt)("Settings, About", () => {
expect(q("[data-about-updates]")!.hasAttribute("data-about-unavailable")).toBe(true);
expect(q("[data-about-last-check]")!.textContent).toBe("Updates aren’t available in this build");
expect((q("[data-about-check]") as HTMLButtonElement).disabled).toBe(true);
- expect(q("[data-about-check]")!.textContent).toBe("Check Now");
+ expect(q("[data-about-check]")!.textContent).toBe("Check now");
expect(q("[data-about-auto-check]")!.hasAttribute("data-disabled")).toBe(true);
- expect(q("[data-about-auto-install]")!.hasAttribute("data-disabled")).toBe(true);
- expect(document.body.textContent).toContain("Check for and download updates automatically");
- expect(document.body.textContent).toContain("Update to:");
+ // One switch for checking, downloading and installing; Beta is in Advanced.
+ expect(document.body.textContent).toContain("Keep Cua Spaces up to date");
+ expect(document.body.textContent).not.toContain("Update to:");
});
it("draws them live where the app updates itself", async () => {
@@ -66,12 +66,13 @@ describe.skipIf(!wasmBuilt)("Settings, About", () => {
await waitFor(() => expect(q("[data-about-updates]")).not.toBeNull(), { timeout: 8000 });
expect(q("[data-about-updates]")!.hasAttribute("data-about-unavailable")).toBe(false);
expect((q("[data-about-check]") as HTMLButtonElement).disabled).toBe(false);
- expect(q("[data-about-last-check]")!.textContent).toMatch(/^Last check: /);
+ expect(q("[data-about-last-check]")!.textContent).toMatch(/^Last checked /);
});
it("leaves them out on the SwiftUI host without an updater, as its own About does", async () => {
await mount("webkit", false);
await waitFor(() => expect(q("[data-about-version]")).not.toBeNull(), { timeout: 8000 });
- expect(q("[data-about-updates]")).toBeNull();
+ expect(q("[data-about-check]")).toBeNull();
+ expect(q("[data-about-auto-check]")).toBeNull();
});
});
diff --git a/apps/cua-spaces-web/src/__tests__/cli-settings.test.tsx b/apps/cua-spaces-web/src/__tests__/cli-settings.test.tsx
index ca1f780730..fc8e368f5d 100644
--- a/apps/cua-spaces-web/src/__tests__/cli-settings.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/cli-settings.test.tsx
@@ -14,7 +14,7 @@ stubBrowserApis();
describe.skipIf(!wasmBuilt)("Settings, Terminal", () => {
it("names the file, installs on Install, then says where it is", { timeout: 20_000 }, async () => {
const calls: { op: string; args: unknown }[] = [];
- await mountApp("/settings", {
+ await mountApp("/settings/connected-apps", {
failsCreates: false,
listsGhost: false,
demo: { cli: "missing" },
@@ -36,7 +36,7 @@ describe.skipIf(!wasmBuilt)("Settings, Terminal", () => {
});
it("shows where a Local build's CLI is", { timeout: 20_000 }, async () => {
- await mountApp("/settings", { failsCreates: false, listsGhost: false, demo: { cli: "local" } });
+ await mountApp("/settings/connected-apps", { failsCreates: false, listsGhost: false, demo: { cli: "local" } });
await waitFor(() => expect(document.querySelector('[data-settings-cli="installed"]')?.textContent).toMatch(/~\/\.local\/bin\/cua-local.*cua-local spaces ls/), { timeout: 8000 });
});
});
diff --git a/apps/cua-spaces-web/src/__tests__/electron-parity-lows.test.tsx b/apps/cua-spaces-web/src/__tests__/electron-parity-lows.test.tsx
index 7b0fb2a7b4..a6bda810ef 100644
--- a/apps/cua-spaces-web/src/__tests__/electron-parity-lows.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/electron-parity-lows.test.tsx
@@ -47,7 +47,7 @@ const q = (sel: string) => document.querySelector<HTMLElement>(sel);
describe.skipIf(!wasmBuilt)("Electron parity, the small things", () => {
it("has no Use classic UI switch in Electron (it is only the New UI); the SwiftUI host keeps it", { timeout: 20_000 }, async () => {
await mount("/settings/experiments", "electron");
- await waitFor(() => expect(q("[data-settings-section]")).not.toBeNull(), { timeout: 8000 });
+ await waitFor(() => expect(q("[data-settings-tab=advanced]")).not.toBeNull(), { timeout: 8000 });
expect(q('[data-setting-row="experiment:classic_ui"]')).toBeNull();
expect(document.querySelectorAll("[data-setting-row^='experiment:']").length).toBeGreaterThan(0);
cleanup();
diff --git a/apps/cua-spaces-web/src/__tests__/native-parity.test.tsx b/apps/cua-spaces-web/src/__tests__/native-parity.test.tsx
index 2554581230..8f45b60f82 100644
--- a/apps/cua-spaces-web/src/__tests__/native-parity.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/native-parity.test.tsx
@@ -64,8 +64,10 @@ describe.skipIf(!wasmBuilt)("as the SwiftUI app (real routes, wasm core)", () =>
expect(status.getAttribute("data-this-device-status")).toBe("needs-enrollment");
expect(document.querySelector("[data-this-device-name]")?.textContent).toBe("cua's Mac Studio");
// One Enroll…: the row's. The line under it says what it is for.
- expect(screen.getAllByRole("button", { name: /^Enroll/ })).toHaveLength(1);
- expect(document.querySelector("[data-banner-text]")?.textContent).toMatch(/Enroll this device/);
+ expect(screen.getAllByRole("button", { name: /^Trust this computer/ })).toHaveLength(1);
+ expect(document.querySelector("[data-banner-text]")?.textContent).toMatch(/Trust this computer/);
+ // "Enrolled", "Revoke" and "Re-verify" are the core's words; the page says them plainly.
+ expect(document.body.textContent).not.toMatch(/enroll/i);
// The relay's refusal is what "Needs enrollment" already says.
expect(document.querySelector("[data-devices-read-error]")).toBeNull();
expect(document.body.textContent).not.toContain("permission denied");
@@ -81,36 +83,48 @@ describe.skipIf(!wasmBuilt)("as the SwiftUI app (real routes, wasm core)", () =>
await waitFor(() => expect(document.querySelector("[data-devices-read-error]")?.textContent).toBe("relay: timed out"));
});
- it("General is the core's page: Teams, Welcome, the notch's words and the privacy line with its link", async () => {
- const { router, calls } = await mount("/settings");
- const teams = await waitFor(() => {
- const r = document.querySelector<HTMLElement>('[data-setting-row="teams-manage"]');
- if (!r) throw new Error("no Teams rows");
+ it("Account is the core's page: the plan, the team, and one button for the web account", async () => {
+ const { calls } = await mount("/settings");
+ const manage = await waitFor(() => {
+ const r = document.querySelector<HTMLElement>("[data-manage-account]");
+ if (!r) throw new Error("no Manage button");
return r;
});
- // The real Teams section: no waitlist, and invites and billing are the account app's.
+ // The real Teams section: no waitlist, and invites, roles and billing are the account app's.
expect(document.body.textContent).not.toContain("Coming soon");
expect(document.body.textContent).not.toContain("waitlist");
- expect(within(teams).getByText("Manage team")).toBeTruthy();
- const note = document.querySelector<HTMLElement>('[data-setting-row="telemetry-note"]')!;
- expect(note.textContent).toMatch(/^Which features you use and when something goes wrong\./);
- expect(within(note).getByText("What is collected")).toBeTruthy();
- expect(document.body.textContent).not.toContain("Crash reports and feature counts");
- // Manage team opens the account app in the browser.
- fireEvent.click(within(teams).getByText("Manage team"));
+ expect(manage.textContent).toBe("Manage account on the web");
+ fireEvent.click(manage);
await waitFor(() =>
expect(calls.some(([op, a]) => op === "session.openExternal" && (a as { url: string }).url === "https://app.cua.ai/team")).toBe(true),
);
- // Welcome's Show again starts the first run over (this UI's, off the Mac).
- const welcome = document.querySelector<HTMLElement>('[data-setting-row="welcome"]')!;
- fireEvent.click(within(welcome).getByText("Show again"));
+ });
+
+ it("General keeps the privacy line with its link; Welcome's Show again is in About", async () => {
+ const { router } = await mount("/settings/general");
+ const row = await waitFor(() => {
+ const r = document.querySelector<HTMLElement>('[data-setting-row="telemetry"]');
+ if (!r) throw new Error("no usage data row");
+ return r;
+ });
+ expect(row.textContent).toMatch(/Which features you use and when something goes wrong\./);
+ expect(within(document.querySelector<HTMLElement>("[data-telemetry-link]")!.parentElement!).getByText("What is collected")).toBeTruthy();
+ expect(document.body.textContent).not.toContain("Crash reports and feature counts");
+ await router.navigate({ to: "/settings/about" });
+ const welcome = await waitFor(() => {
+ const w = document.querySelector<HTMLElement>("[data-about-welcome]");
+ if (!w) throw new Error("no welcome button");
+ return w;
+ });
+ // Show starts the first run over (this UI's, off the Mac).
+ fireEvent.click(welcome);
await waitFor(() => expect(router.state.location.pathname).toBe("/onboarding"));
});
- it("the runtime choices never wrap", async () => {
- await mount("/settings");
- await waitFor(() => expect(document.querySelector('[data-setting-row="telemetry"]')).toBeTruthy());
- const toggle = document.querySelector<HTMLElement>('[data-setting-row="telemetry"] button');
+ it("the choices never wrap", async () => {
+ await mount("/settings/general");
+ await waitFor(() => expect(document.querySelector('[aria-label="Appearance"]')).toBeTruthy());
+ const toggle = document.querySelector<HTMLElement>('[aria-label="Appearance"] button');
expect(toggle?.className).toContain("whitespace-nowrap");
});
diff --git a/apps/cua-spaces-web/src/__tests__/settings-advanced.test.tsx b/apps/cua-spaces-web/src/__tests__/settings-advanced.test.tsx
index 83a6e71ed4..c6493a0c06 100644
--- a/apps/cua-spaces-web/src/__tests__/settings-advanced.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/settings-advanced.test.tsx
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: FSL-1.1-MIT
// Copyright (c) 2026 Cua AI, Inc.
-// Remote hours and self-hosting in Settings, on the real routes and the wasm
-// core: the Free plan card says what remote hours are; your own relay (or a
-// direct connection) is only under Advanced, collapsed, and opens host
-// setup's form for it. Setup elsewhere offers Cua's relay alone.
+// Account usage and self-hosting in Settings, on the real routes and the wasm
+// core: the usage card says what the time away from this computer is; your own
+// connection server (or a direct connection) is only under Advanced, and opens
+// host setup's form for it. Setup elsewhere offers Cua's server alone.
import { cleanup, fireEvent, waitFor } from "@testing-library/react";
import { afterEach, describe, expect, it } from "vitest";
@@ -25,42 +25,34 @@ const host: TestHost = {
answer: (op, out) => (op === "relay.usage" ? { ...demoRelayUsage(), liveSessions: 0 } : op === "agents.runs" ? [] : out),
};
-describe.skipIf(!wasmBuilt)("remote hours and self-hosting in Settings (real routes, wasm core)", () => {
- it("says what remote hours are where they first show", async () => {
+describe.skipIf(!wasmBuilt)("account usage and self-hosting in Settings (real routes, wasm core)", () => {
+ it("says what the time away from this computer is, in plain words", async () => {
const { router } = await mountApp("/settings", host);
await router.load();
- const card = await waitFor(() => {
- const el = document.querySelector("[data-plan-card]");
+ const usage = await waitFor(() => {
+ const el = document.querySelector("[data-relay-usage]");
expect(el).toBeTruthy();
return el as HTMLElement;
});
- expect(card.textContent).toContain(
- "Remote hours: time spent using your computers from somewhere else (your laptop, phone or an agent on another computer). Using a computer from itself is free.",
- );
- expect(document.querySelector("[data-relay-usage]")?.textContent).toContain("Remote use");
- expect(document.body.textContent).not.toMatch(/relay hours/i);
+ expect(usage.textContent).toContain("Time away from this computer");
+ expect(usage.textContent).toContain("away from the computer you're using");
+ expect(document.body.textContent).not.toMatch(/relay hours|remote hours/i);
});
- it("keeps your own relay under Advanced, collapsed, for self-hosting teams", async () => {
- const { router } = await mountApp("/settings", host);
+ it("keeps your own connection server under Advanced, for teams that run their own", async () => {
+ const { router } = await mountApp("/settings/advanced", host);
await router.load();
- const section = await waitFor(() => {
- const el = document.querySelector("[data-settings-advanced]");
- expect(el).toBeTruthy();
- return el as HTMLElement;
- });
- expect(section.getAttribute("data-settings-advanced")).toBe("closed");
- expect(document.body.textContent).not.toContain("Your own relay");
- fireEvent.click(section.querySelector("button")!);
const row = await waitFor(() => {
- const el = section.querySelector("[data-self-hosting]");
+ const el = document.querySelector("[data-self-hosting]");
expect(el).toBeTruthy();
return el as HTMLElement;
});
- expect(row.textContent).toContain("For self-hosting teams");
+ expect(row.textContent).toContain("Use your own connection server");
+ expect(row.textContent).toContain("For teams that run their own.");
+ expect(document.body.textContent).not.toMatch(/relay/i);
fireEvent.click(row.querySelector("button")!);
const form = await waitFor(() => {
- const el = section.querySelector("[data-host-form]");
+ const el = document.querySelector("[data-host-form]");
expect(el).toBeTruthy();
return el as HTMLElement;
});
diff --git a/apps/cua-spaces-web/src/__tests__/settings-agents.test.tsx b/apps/cua-spaces-web/src/__tests__/settings-agents.test.tsx
index 1aacd5f470..a384380147 100644
--- a/apps/cua-spaces-web/src/__tests__/settings-agents.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/settings-agents.test.tsx
@@ -51,7 +51,7 @@ describe("configured agents without binary evidence", () => {
describe.skipIf(!wasmBuilt)("Settings, AI agents", () => {
it("lists each detected agent with its status, configures one, removes it, and configures all", { timeout: 20_000 }, async () => {
- await mountApp("/settings", { failsCreates: false, listsGhost: false });
+ await mountApp("/settings/connected-apps", { failsCreates: false, listsGhost: false });
await waitFor(() => expect(row("hermes")).not.toBeNull(), { timeout: 8000 });
const s = section()!;
expect(within(s).getByText("AI agents")).toBeTruthy();
diff --git a/apps/cua-spaces-web/src/__tests__/settings-host-rows.test.tsx b/apps/cua-spaces-web/src/__tests__/settings-host-rows.test.tsx
index 4ebabfc4b7..87417cb48b 100644
--- a/apps/cua-spaces-web/src/__tests__/settings-host-rows.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/settings-host-rows.test.tsx
@@ -7,7 +7,7 @@
// rows are left out.
import { createMemoryHistory, createRouter, RouterProvider } from "@tanstack/react-router";
-import { cleanup, fireEvent, render, waitFor, within } from "@testing-library/react";
+import { cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react";
import { afterEach, describe, expect, it } from "vitest";
import { BridgeProvider, type HostSettings } from "@/bridge";
import type { DataAdapter } from "@/bridge/adapter";
@@ -41,7 +41,7 @@ async function mountSettings(own: HostSettings | null) {
return op === "settings.get" && own ? { ...(out as object), hostSettings: { ...settings } } : out;
}) as DataAdapter["call"],
};
- const router = createRouter({ routeTree, history: createMemoryHistory({ initialEntries: ["/settings"] }) });
+ const router = createRouter({ routeTree, history: createMemoryHistory({ initialEntries: ["/settings/advanced"] }) });
render(
<BridgeProvider adapter={adapter} core={await testCore()} storeOptions={{ tickMs: 5 }}>
<TooltipProvider delay={500}>
@@ -57,36 +57,39 @@ async function mountSettings(own: HostSettings | null) {
const row = (id: string) => document.querySelector<HTMLElement>(`[data-setting-row="${id}"]`);
describe.skipIf(!wasmBuilt)("the host's own settings (real routes, wasm core)", () => {
- it("lays out Runtimes, auto-connect and the Keyvault's auto-wipe, and picks their options", async () => {
+ it("lays out which software runs Spaces and auto-connect in Advanced, in plain words, and picks their options", async () => {
const { chosen } = await mountSettings({ lumeSource: "system", linuxSource: "auto", autoConnect: true, keyvaultAutoWipe: false });
- const runtimes = await waitFor(() => {
- const s = document.querySelector<HTMLElement>('[data-settings-section="runtimes"]');
- if (!s) throw new Error("no Runtimes");
- return s;
+ const macos = await waitFor(() => {
+ const r = row("macos-runtime");
+ if (!r) throw new Error("no runtime row");
+ return r;
});
- expect(within(runtimes).getByText("Runtimes")).toBeTruthy();
- const macos = row("macos-runtime")!;
- expect(within(macos).getByText("macOS VMs")).toBeTruthy();
- // The note under it is the core's.
- expect(macos.textContent).toMatch(/Built-in is Cua’s signed Lume/);
- expect(within(row("linux-runtime")!).getByText("Linux")).toBeTruthy();
- expect(within(row("auto-connect")!).getByText("Connect to the desktop automatically")).toBeTruthy();
- expect(within(row("keyvault-auto-wipe")!).getByText("Wipe access from Spaces automatically")).toBeTruthy();
- // A host that doesn't report the site icons setting gets no switch for it.
- expect(row("keyvault-site-icons")).toBeNull();
+ expect(within(macos).getByText("Mac computers")).toBeTruthy();
+ expect(macos.textContent).toContain("Already installed");
+ expect(document.body.textContent).toContain("Which software runs Spaces on this Mac");
+ expect(document.body.textContent).not.toMatch(/Lume|gVisor|Runtimes/);
+ expect(within(row("linux-runtime")!).getByText("Linux computers")).toBeTruthy();
+ expect(within(row("auto-connect")!).getByText("Open a Space\u2019s screen right away")).toBeTruthy();
+ // The Keyvault's switches live on the Keyvault page now.
+ expect(row("keyvault-auto-wipe")).toBeNull();
- fireEvent.click(within(macos).getByText("Built-in"));
- await waitFor(() => expect(chosen).toEqual([["macos-runtime", "builtin"]]));
fireEvent.click(within(row("auto-connect")!).getByRole("switch"));
await waitFor(() => expect(chosen).toContainEqual(["auto-connect", "off"]));
- fireEvent.click(within(row("keyvault-auto-wipe")!).getByRole("switch"));
- await waitFor(() => expect(chosen).toContainEqual(["keyvault-auto-wipe", "on"]));
+ const trigger = within(macos).getByRole("combobox");
+ trigger.focus();
+ fireEvent.keyDown(trigger, { key: "ArrowDown" });
+ const option = await screen.findByRole("option", { name: "Cua\u2019s own" });
+ fireEvent.pointerMove(option, { pointerType: "mouse" });
+ fireEvent.mouseMove(option);
+ fireEvent.keyDown(option, { key: "Enter" });
+ fireEvent.keyUp(option, { key: "Enter" });
+ await waitFor(() => expect(chosen).toContainEqual(["macos-runtime", "builtin"]));
});
it("leaves the rows out on a host without them", async () => {
await mountSettings(null);
await waitFor(() => expect(document.querySelector("[data-setting-row]")).toBeTruthy());
- expect(document.querySelector('[data-settings-section="runtimes"]')).toBeNull();
+ expect(row("macos-runtime")).toBeNull();
expect(row("auto-connect")).toBeNull();
expect(row("keyvault-auto-wipe")).toBeNull();
});
diff --git a/apps/cua-spaces-web/src/__tests__/settings-tabs.test.tsx b/apps/cua-spaces-web/src/__tests__/settings-tabs.test.tsx
new file mode 100644
index 0000000000..3d52769472
--- /dev/null
+++ b/apps/cua-spaces-web/src/__tests__/settings-tabs.test.tsx
@@ -0,0 +1,117 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+// Settings' six tabs on the real routes and the wasm core: Account, General,
+// Connected apps, Trusted devices, Advanced, About. The old addresses
+// (Agents, Experiments) still land on the right tab, and what moved is where
+// the audit put it.
+
+import { act, cleanup, fireEvent, waitFor } from "@testing-library/react";
+import { afterEach, describe, expect, it } from "vitest";
+
+import { useUiStore } from "@/stores/ui";
+import { wasmBuilt } from "@/bridge/__tests__/testCore";
+import { mountApp, stubBrowserApis, type TestHost } from "./app-harness";
+
+afterEach(() => {
+ cleanup();
+ localStorage.clear();
+});
+stubBrowserApis();
+
+const host: TestHost = { failsCreates: false, listsGhost: false };
+const tab = (id: string) => document.querySelector<HTMLElement>(`[data-settings-tab="${id}"]`);
+const labels = () => [...document.querySelectorAll<HTMLElement>('nav[aria-label="Settings"] a')].map((a) => a.textContent);
+
+describe.skipIf(!wasmBuilt)("Settings tabs (real routes, wasm core)", () => {
+ it("has Account, General, Connected apps, Trusted devices, Advanced and About, in that order", async () => {
+ await mountApp("/settings", host);
+ await waitFor(() => expect(tab("account")).not.toBeNull());
+ expect(labels()).toEqual(["Account", "General", "Connected apps", "Trusted devices", "Advanced", "About"]);
+ });
+
+ it.each([
+ ["/settings", "Account"],
+ ["/settings/general", "General"],
+ ["/settings/connected-apps", "Connected apps"],
+ ["/settings/devices", "Trusted devices"],
+ ["/settings/advanced", "Advanced"],
+ ["/settings/about", "About"],
+ ])("marks only the tab for %s as selected (%s)", async (path, label) => {
+ await mountApp(path, host);
+ const tabs = () => [...document.querySelectorAll<HTMLElement>('[role="tablist"][aria-label="Settings"] [role="tab"]')];
+ await waitFor(() => expect(tabs().filter((t) => t.getAttribute("aria-selected") === "true").map((t) => t.textContent)).toEqual([label]));
+ expect(tabs().filter((t) => t.getAttribute("aria-selected") === "false")).toHaveLength(5);
+ });
+
+ it.each([
+ ["/settings/agents", "/settings/connected-apps", "connected-apps"],
+ ["/settings/experiments", "/settings/advanced", "advanced"],
+ ])("sends the old %s to %s", async (from, to, id) => {
+ const { router } = await mountApp(from, host);
+ await waitFor(() => expect(router.state.location.pathname).toBe(to));
+ await waitFor(() => expect(tab(id)).not.toBeNull());
+ });
+
+ it("keeps General to the everyday settings: no Keyboard shortcuts, Shared links, Storage or Runtimes", async () => {
+ await mountApp("/settings/general", host);
+ await waitFor(() => expect(tab("general")).not.toBeNull());
+ await waitFor(() => expect(document.querySelector('[data-setting-row="telemetry"]')).not.toBeNull());
+ const text = tab("general")!.textContent!;
+ expect(text).toContain("Start Cua Spaces when you sign in");
+ expect(text).toContain("Appearance");
+ expect(text).not.toMatch(/Keyboard shortcuts|Shared links|Storage|Runtimes|Keyvault|AI agents|Welcome/);
+ });
+
+ it("puts Connected apps where Agents was, with the account keys and Terminal", async () => {
+ await mountApp("/settings/connected-apps", host);
+ await waitFor(() => expect(document.querySelector("[data-agent-keys]")).not.toBeNull(), { timeout: 8000 });
+ const text = tab("connected-apps")!.textContent!;
+ expect(text).toContain("Account keys");
+ expect(text).toContain("Add a key for another AI company");
+ expect(text).not.toMatch(/provider key/i);
+ });
+
+ it("moves Early releases here from About, and drops the Sharing and Your cloud switches", async () => {
+ await mountApp("/settings/advanced", host);
+ await waitFor(() => expect(tab("advanced")).not.toBeNull());
+ await waitFor(() => expect(tab("advanced")!.textContent).toContain("Get early releases (Beta)"));
+ const text = tab("advanced")!.textContent!;
+ expect(text).toContain("Cua Volume");
+ expect(text).not.toMatch(/Your cloud|Sharing|Experiments/);
+ expect(document.querySelector('[data-setting-row="experiment:sharing"]')).toBeNull();
+ expect(document.querySelector('[data-setting-row="experiment:your_cloud"]')).toBeNull();
+ });
+
+ it("puts Storage on the Volume page, not in Settings", async () => {
+ await mountApp("/settings/advanced", host);
+ await waitFor(() => expect(tab("advanced")).not.toBeNull());
+ expect(document.querySelector('[data-settings-section="storage"]')).toBeNull();
+ cleanup();
+ await mountApp("/volume", host);
+ await waitFor(() => expect(document.querySelector('[data-settings-section="storage"]')).not.toBeNull(), { timeout: 8000 });
+ });
+
+ it("About has the welcome and the update switch, and no Beta picker", async () => {
+ await mountApp("/settings/about", host);
+ await waitFor(() => expect(document.querySelector("[data-about-welcome]")).not.toBeNull());
+ expect(document.body.textContent).toContain("Show the welcome again");
+ expect(document.body.textContent).not.toContain("Update to:");
+ });
+});
+
+describe.skipIf(!wasmBuilt)("Cmd+K finds Settings tabs", () => {
+ it("opens Connected apps from the palette", async () => {
+ const { router } = await mountApp("/spaces", host);
+ await waitFor(() => expect(document.querySelector("nav")).not.toBeNull());
+ act(() => useUiStore.getState().setPaletteOpen(true));
+ const input = await waitFor(() => {
+ const el = document.querySelector<HTMLInputElement>("[data-command-palette] input");
+ expect(el).not.toBeNull();
+ return el!;
+ });
+ fireEvent.change(input, { target: { value: "connected apps" } });
+ fireEvent.keyDown(input, { key: "Enter" });
+ await waitFor(() => expect(router.state.location.pathname).toBe("/settings/connected-apps"));
+ });
+});
diff --git a/apps/cua-spaces-web/src/__tests__/shell-parity.test.tsx b/apps/cua-spaces-web/src/__tests__/shell-parity.test.tsx
index 225d34d5b2..d39fd80c7b 100644
--- a/apps/cua-spaces-web/src/__tests__/shell-parity.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/shell-parity.test.tsx
@@ -94,14 +94,17 @@ describe.skipIf(!wasmBuilt)("the shell as the SwiftUI main window (real routes,
await waitFor(() => expect(calls.some(([op, a]) => op === "spaces.setPower" && (a as { on: boolean }).on === false)).toBe(true));
});
- it("lays out every Keyvault row the host reports, and changes its switches", async () => {
- const { calls } = await mount("/settings", { macHost: true });
- const section = await found<HTMLElement>('[data-settings-section="keyvault"]');
- const row = (id: string) => section.querySelector<HTMLElement>(`[data-setting-row="${id}"]`);
+ it("lays out every Keyvault option the host reports, on the Keyvault page, and changes its switches", async () => {
+ const { calls } = await mount("/keyvault", { macHost: true });
+ fireEvent.click(await found<HTMLElement>("[data-keyvault-options]"));
+ const dialog = await found<HTMLElement>("[data-keyvault-options-dialog]");
+ const row = (id: string) => dialog.querySelector<HTMLElement>(`[data-setting-row="${id}"]`);
await waitFor(() => expect(row("keyvault-unlock-prompt")).toBeTruthy());
expect(row("keyvault-auto-wipe")).toBeTruthy();
expect(row("keyvault-site-icons")).toBeTruthy();
expect(row("keyvault-protection:Unlock")?.textContent).toContain("Mac login");
+ // Plain words, not the core's.
+ expect(within(row("keyvault-auto-wipe")!).getByText("Remove saved sign-ins from Spaces after an hour")).toBeTruthy();
fireEvent.click(within(row("keyvault-unlock-prompt")!).getByRole("switch"));
await waitFor(() => expect(calls).toContainEqual(["settings.choose", { row: "keyvault-unlock-prompt", option: "off" }]));
diff --git a/apps/cua-spaces-web/src/__tests__/upsell.test.tsx b/apps/cua-spaces-web/src/__tests__/upsell.test.tsx
index c0108fbfeb..b4c0214c58 100644
--- a/apps/cua-spaces-web/src/__tests__/upsell.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/upsell.test.tsx
@@ -57,7 +57,7 @@ function host(usage: RelayUsage, opened: string[] = [], tracked: unknown[] = [],
const features = (tracked: unknown[]) => tracked.map((s) => (s as { feature?: string }).feature).filter(Boolean);
describe.skipIf(!wasmBuilt)("in-app Pro and Teams prompts (real routes, wasm core)", () => {
- it("Settings always shows the plan card: Free offers Pro and a team, each to its checkout", async () => {
+ it("Account on Free says what Free gives and has an Upgrade button to Pro's checkout", async () => {
const opened: string[] = [];
const tracked: unknown[] = [];
const { router } = await mountApp("/settings", host(idle({ liveSessions: 1 }), opened, tracked));
@@ -68,11 +68,14 @@ describe.skipIf(!wasmBuilt)("in-app Pro and Teams prompts (real routes, wasm cor
return el as HTMLElement;
});
expect(card.getAttribute("data-plan-card")).toBe("free");
- expect(card.textContent).toContain("Free plan");
- expect(card.textContent).toContain("2 live sessions and 20 remote hours a month");
- fireEvent.click(card.querySelector("[data-plan-primary]")!);
- fireEvent.click(card.querySelector("[data-plan-secondary]")!);
- await waitFor(() => expect(opened).toEqual(["https://app.cua.ai/buy/pro?from=app_plan_card", "https://app.cua.ai/buy/teams?from=app_plan_card"]));
+ expect(card.textContent).toBe("Free: 2 computers at once and 20 hours a month away from the computer you're using.");
+ // "Free plan" shows once, in the plan row.
+ const tab = document.querySelector<HTMLElement>('[data-settings-tab="account"]')!;
+ expect(tab.textContent).not.toContain("Free plan");
+ // One Upgrade; the old "use Free plan · Upgrade at the bottom left" helper is gone.
+ expect(tab.textContent).not.toContain("Upgrade at the bottom");
+ fireEvent.click(document.querySelector("[data-plan-primary]")!);
+ await waitFor(() => expect(opened).toEqual(["https://app.cua.ai/buy/pro?from=app_plan_card"]));
await waitFor(() => expect(features(tracked)).toContain("upsell_plan_card_click"));
});
@@ -89,6 +92,8 @@ describe.skipIf(!wasmBuilt)("in-app Pro and Teams prompts (real routes, wasm cor
expect(sessions.getAttribute("aria-valuemax")).toBe("5");
expect(sessions.hasAttribute("data-full")).toBe(true);
const hours = document.querySelector('[data-usage-meter="Remote hours"]')!;
+ expect(document.body.textContent).toContain("Computers in use right now");
+ expect(document.body.textContent).toContain("Time away from this computer");
expect(hours.getAttribute("aria-valuenow")).toBe("12");
expect(hours.hasAttribute("data-full")).toBe(false);
const notice = await waitFor(() => {
@@ -101,7 +106,7 @@ describe.skipIf(!wasmBuilt)("in-app Pro and Teams prompts (real routes, wasm cor
await waitFor(() => expect(opened).toEqual(["https://app.cua.ai/buy/teams?from=app_meter"]));
});
- it("Settings shows Pro's plan card with Manage plan and Teams", async () => {
+ it("Account on Pro has no Upgrade button, only the web account", async () => {
const { router } = await mountApp("/settings", host(idle({ plan: "pro", liveSessionsLimit: 5, hoursLimit: 200 })));
await router.load();
const card = await waitFor(() => {
@@ -109,9 +114,9 @@ describe.skipIf(!wasmBuilt)("in-app Pro and Teams prompts (real routes, wasm cor
expect(el).toBeTruthy();
return el as HTMLElement;
});
- expect(card.textContent).toContain("Pro plan");
- expect(card.querySelector("[data-plan-primary]")?.textContent).toBe("Manage plan");
- expect(card.querySelector("[data-plan-secondary]")?.textContent).toBe("See Teams");
+ expect(card.textContent).toBe("Pro: 5 computers at once and 200 hours a month away from the computer you're using.");
+ expect(document.querySelector("[data-plan-primary]")).toBeNull();
+ expect(document.querySelector("[data-manage-account]")?.textContent).toBe("Manage account on the web");
});
it("the account name carries the plan; on Free it opens Pro's checkout", async () => {
diff --git a/apps/cua-spaces-web/src/bridge/__tests__/agent-keys-fresh.test.tsx b/apps/cua-spaces-web/src/bridge/__tests__/agent-keys-fresh.test.tsx
index f1f377b719..66fd3ce949 100644
--- a/apps/cua-spaces-web/src/bridge/__tests__/agent-keys-fresh.test.tsx
+++ b/apps/cua-spaces-web/src/bridge/__tests__/agent-keys-fresh.test.tsx
@@ -9,7 +9,7 @@ import { createDemoAdapter } from "../adapters/demo";
import { AgentKeysStore, type FocusTarget } from "../agent-keys";
import { BridgeProvider } from "../index";
import type { HostEvent, OpArgs, OpName } from "../protocol";
-import { Route } from "../../routes/settings/agents";
+import { AccountKeysSection } from "../../components/settings/account-keys";
import { testCore, wasmBuilt } from "./testCore";
afterEach(cleanup);
@@ -54,7 +54,7 @@ function fakeTarget() {
return { target, doc, fire: (t: string) => [...(on[t] ?? [])].forEach((l) => l()), count: () => Object.values(on).reduce((n, s) => n + s.size, 0) };
}
-describe("Settings → Agents keeps its list fresh", () => {
+describe("Settings, Connected apps keeps its list fresh", () => {
it("reads when watching starts, on focus, on a visible document and on agents.changed", async () => {
const h = loggedDemo();
const store = new AgentKeysStore(h.adapter);
@@ -134,8 +134,8 @@ describe("Settings → Agents keeps its list fresh", () => {
});
});
-describe.skipIf(!wasmBuilt)("the Settings → Agents page", () => {
- const Page = Route.options.component as unknown as () => React.JSX.Element;
+describe.skipIf(!wasmBuilt)("the Settings, Connected apps account keys", () => {
+ const Page = AccountKeysSection;
const status = (provider: string) => document.querySelector(`[data-agent-key-provider="${provider}"] [data-agent-key-status]`)?.textContent;
const click = (provider: string, what: "action" | "remove") => {
const b = document.querySelector(`[data-agent-key-provider="${provider}"] [data-agent-key-${what}]`);
diff --git a/apps/cua-spaces-web/src/bridge/__tests__/agent-keys-hosts.test.tsx b/apps/cua-spaces-web/src/bridge/__tests__/agent-keys-hosts.test.tsx
index 4133eb8789..529b1bbe82 100644
--- a/apps/cua-spaces-web/src/bridge/__tests__/agent-keys-hosts.test.tsx
+++ b/apps/cua-spaces-web/src/bridge/__tests__/agent-keys-hosts.test.tsx
@@ -7,12 +7,13 @@ import { afterEach, describe, expect, it } from "vitest";
import { createDemoAdapter } from "../adapters/demo";
import { agentKeyForm, agentKeysView } from "../agent-keys";
import { BridgeProvider } from "../index";
-import { Route } from "../../routes/settings/agents";
+import { AccountKeysSection } from "../../components/settings/account-keys";
+import { plainKeysIntro } from "../../lib/settings-copy";
import { testCore, wasmBuilt } from "./testCore";
afterEach(cleanup);
-/** What Settings → Agents says about where a saved key stays, per system. */
+/** What Settings, Connected apps says about where a saved key stays, per system. */
const WORDS = {
macos: {
intro: "Agents in your Spaces need a provider key to run. Keys stay on this Mac in the Keychain, and each one is only given to the agents that use it.",
@@ -29,7 +30,7 @@ const WORDS = {
},
} as const;
-describe.skipIf(!wasmBuilt)("Settings → Agents says where keys stay in the system's words", () => {
+describe.skipIf(!wasmBuilt)("Settings, Connected apps says where keys stay in the system's words", () => {
it("has the core say it for each system, and the Mac's words by default", async () => {
const core = await testCore();
const input = { keys: [] };
@@ -52,7 +53,7 @@ describe.skipIf(!wasmBuilt)("Settings → Agents says where keys stay in the sys
it("draws the words of the shell's system (Electron reports its platform)", async () => {
const host = window as unknown as { cuaDesktop?: { platform: string } };
- const Page = Route.options.component as unknown as () => React.JSX.Element;
+ const Page = AccountKeysSection;
await (Page as unknown as { preload?: () => Promise<unknown> }).preload?.();
const core = await testCore();
try {
@@ -69,7 +70,7 @@ describe.skipIf(!wasmBuilt)("Settings → Agents says where keys stay in the sys
</BridgeProvider>,
);
});
- await waitFor(() => expect(document.querySelector("[data-agent-keys-intro]")?.textContent).toBe(WORDS[os].intro));
+ await waitFor(() => expect(document.querySelector("[data-agent-keys-intro]")?.textContent).toBe(plainKeysIntro(WORDS[os].intro)));
fireEvent.click(document.querySelector('[data-agent-key-provider="anthropic"] [data-agent-key-action]')!);
await waitFor(() => expect(document.querySelector("[data-agent-key-value-help]")?.textContent).toBe(WORDS[os].help));
view.unmount();
diff --git a/apps/cua-spaces-web/src/components/getting-started.tsx b/apps/cua-spaces-web/src/components/getting-started.tsx
index 30f453e7c9..aea2730019 100644
--- a/apps/cua-spaces-web/src/components/getting-started.tsx
+++ b/apps/cua-spaces-web/src/components/getting-started.tsx
@@ -94,8 +94,7 @@ function useChecklistGo(): (step: ChecklistStep) => void {
const { space, offered } = spaceFor(spaces, offers(id));
if (space) return void open(space).catch(toastError(`Couldn't open ${what}`));
if (!offered && id === "share") {
- toast("Sharing is off", { description: "Turn it on in Settings, Experiments." });
- return void navigate({ to: "/settings/experiments" });
+ return void toast("Sharing isn't available yet", { description: "It is not switched on for this account." });
}
toast("Start a Space first", { description: `${what} works on a running Space.` });
};
diff --git a/apps/cua-spaces-web/src/components/keyvault/keyvault-page.tsx b/apps/cua-spaces-web/src/components/keyvault/keyvault-page.tsx
index 4731e14a87..56de3ca7fc 100644
--- a/apps/cua-spaces-web/src/components/keyvault/keyvault-page.tsx
+++ b/apps/cua-spaces-web/src/components/keyvault/keyvault-page.tsx
@@ -14,6 +14,7 @@ import { toastError } from "@/components/ui/toast";
import { hostOs, keyvaultUnlockWay } from "@/lib/host-labels";
import { ApprovalDialog } from "./approval-dialog";
+import { KeyvaultOptions } from "./options-dialog";
import { CategoryPane } from "./category-pane";
import { VaultList } from "./vault-list";
@@ -113,11 +114,14 @@ export function KeyvaultPage({ initialView = "all", focus = null }: { initialVie
title="Keyvault"
description="Saved logins your agents can use. Each use asks you first unless you allow it."
actions={
- locked ? (
- <Button variant="outline" onClick={unlockVault}>
- <LockIcon /> Unlock
- </Button>
- ) : null
+ <>
+ <KeyvaultOptions />
+ {locked ? (
+ <Button variant="outline" onClick={unlockVault}>
+ <LockIcon /> Unlock
+ </Button>
+ ) : null}
+ </>
}
/>
{locked ? (
diff --git a/apps/cua-spaces-web/src/components/keyvault/options-dialog.tsx b/apps/cua-spaces-web/src/components/keyvault/options-dialog.tsx
new file mode 100644
index 0000000000..2dc5c4f7e4
--- /dev/null
+++ b/apps/cua-spaces-web/src/components/keyvault/options-dialog.tsx
@@ -0,0 +1,61 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+import { useState } from "react";
+
+import { useSettings, type SettingsRow } from "@/bridge";
+import { CoreSettingsRow } from "@/components/settings/core-section";
+import { Button } from "@/components/ui/button";
+import { Dialog, DialogPopup, DialogTitle } from "@/components/ui/dialog";
+import { toastError } from "@/components/ui/toast";
+import { keyvaultRows } from "@/lib/keyvault";
+
+/** The Keyvault's options in plain words (they used to be in Settings, General). */
+const COPY: Record<string, { label: string; help?: string }> = {
+ "keyvault-auto-wipe": { label: "Remove saved sign-ins from Spaces after an hour", help: "When off, sign-ins stay in a Space until you remove them." },
+ "keyvault-unlock-prompt": { label: "Show the reminder before an agent uses a saved sign-in", help: "Unlocking a login always asks for Touch ID first." },
+ "keyvault-site-icons": { label: "Show site logos", help: "Asks Google for each logo and sends only the site address." },
+};
+
+/**
+ * Keyvault, Options: the switches that were in Settings, General. A Mac
+ * setting: the dialog's button shows only where the core reports them.
+ */
+export function KeyvaultOptions() {
+ const [open, setOpen] = useState(false);
+ const { data: settings, chooseSetting } = useSettings();
+ const section = settings?.page?.sections.find((s) => s.id === "keyvault");
+ if (!section) return null;
+ const all = keyvaultRows(section.rows, settings?.hostSettings);
+ const rows = all.filter((r) => r.id in COPY);
+ const facts = all.filter((r) => r.id.startsWith("keyvault-protection:"));
+ if (rows.length === 0) return null;
+ const choose = (row: SettingsRow, option: string) => void chooseSetting(row.id, option).catch(toastError("Couldn't change the setting"));
+ return (
+ <>
+ <Button variant="outline" onClick={() => setOpen(true)} data-keyvault-options="">
+ Options
+ </Button>
+ <Dialog open={open} onOpenChange={setOpen}>
+ <DialogPopup data-keyvault-options-dialog="">
+ <div className="px-5 pt-5 pb-3">
+ <DialogTitle className="text-[15px] font-semibold">Keyvault options</DialogTitle>
+ </div>
+ <div className="divide-y border-y">
+ {rows.map((r) => (
+ <CoreSettingsRow key={r.id} row={{ ...r, label: COPY[r.id]!.label }} description={COPY[r.id]!.help} onChoose={choose} />
+ ))}
+ {facts.map((r) => (
+ <CoreSettingsRow key={r.id} row={r} />
+ ))}
+ </div>
+ <div className="flex justify-end px-5 py-3">
+ <Button variant="outline" onClick={() => setOpen(false)}>
+ Done
+ </Button>
+ </div>
+ </DialogPopup>
+ </Dialog>
+ </>
+ );
+}
diff --git a/apps/cua-spaces-web/src/components/settings-group.tsx b/apps/cua-spaces-web/src/components/settings-group.tsx
index df2aa5c3a2..2774fb79cf 100644
--- a/apps/cua-spaces-web/src/components/settings-group.tsx
+++ b/apps/cua-spaces-web/src/components/settings-group.tsx
@@ -5,14 +5,14 @@ import type { ReactNode } from "react";
export function SettingsGroup({ title, children }: { title: string; children: ReactNode }) {
return (
- <section className="mb-7">
+ <section className="mb-8">
<h2 className="mb-2 px-1 text-xs font-semibold text-muted-foreground">{title}</h2>
<div className="divide-y overflow-hidden rounded-xl border bg-card shadow-xs">{children}</div>
</section>
);
}
-export function SettingsRow({ label, description, control, htmlFor }: { label: string; description?: ReactNode; control: ReactNode; htmlFor?: string }) {
+export function SettingsRow({ label, description, control, htmlFor }: { label: ReactNode; description?: ReactNode; control: ReactNode; htmlFor?: string }) {
return (
<div className="flex min-h-12 items-center justify-between gap-6 px-4 py-2.5">
<div className="min-w-0">
diff --git a/apps/cua-spaces-web/src/components/settings/account-keys.tsx b/apps/cua-spaces-web/src/components/settings/account-keys.tsx
new file mode 100644
index 0000000000..97eb5c048a
--- /dev/null
+++ b/apps/cua-spaces-web/src/components/settings/account-keys.tsx
@@ -0,0 +1,127 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+import { TriangleAlertIcon } from "lucide-react";
+
+import { useAgentKeys, type AgentKeyRowView } from "@/bridge";
+import { KeySheet } from "@/components/agents/key-sheet";
+import { ConfirmDialog } from "@/components/ui/alert-dialog";
+import { Button } from "@/components/ui/button";
+import { toastError } from "@/components/ui/toast";
+import { addedText } from "@/lib/agent-keys";
+import { KEYS_ADD_OTHER_BUTTON, KEYS_ADD_OTHER_LABEL, KEYS_OTHER_HELP, KEYS_TITLE, plainKeysIntro } from "@/lib/settings-copy";
+
+/**
+ * Settings, Connected apps, Account keys: the provider keys agents in your Spaces get. Anthropic
+ * and OpenAI always have a row, other keys follow by variable name; Add or
+ * Replace opens a sheet with a secure field (the key is never shown again),
+ * Remove asks first. Every word is the app core's `agent_keys` view.
+ */
+export function AccountKeysSection() {
+ // The keys also change outside the app (`cua agent keys`): read them again when this page shows
+ // and whenever the window gets focus.
+ const keys = useAgentKeys({ watch: true });
+ const { view } = keys;
+ if (keys.unsupported) return <p className="px-1 text-[13px] text-muted-foreground">Agent keys are not available in this app yet.</p>;
+ if (keys.isLoading) return <p className="px-1 text-[13px] text-muted-foreground" data-agent-keys-loading>Loading agent keys…</p>;
+ if (!view) return <p className="px-1 text-[13px] text-muted-foreground">Agent keys need the app core, which isn't loaded.</p>;
+ const confirm = keys.removing ? keys.removeConfirmOf(keys.removing) : null;
+
+ return (
+ <div data-agent-keys>
+ {view.notice ? (
+ <div data-agent-keys-notice className="mb-4 flex items-start gap-2.5 rounded-xl border border-warning/30 bg-warning/5 px-4 py-2.5 text-[13px]">
+ <TriangleAlertIcon className="mt-0.5 size-4 shrink-0 text-warning" />
+ <span className="min-w-0 flex-1">{view.notice}</span>
+ {keys.error ? (
+ <Button size="sm" variant="outline" onClick={() => void keys.refresh()}>
+ Try again
+ </Button>
+ ) : null}
+ </div>
+ ) : null}
+
+ <section className="mb-8">
+ <h2 className="mb-2 px-1 text-xs font-semibold text-muted-foreground" data-agent-keys-title>
+ {KEYS_TITLE}
+ </h2>
+ <div className="divide-y overflow-hidden rounded-xl border bg-card shadow-xs">
+ {view.rows.map((r) => (
+ <KeyRow key={`${r.provider}:${r.env}`} row={r} addedLabel={view.addedLabel} canEdit={view.canEdit} onEdit={() => keys.openSheet(r.provider, r.provider === "other" ? r.env : null)} onRemove={() => keys.askRemove(r.env)} />
+ ))}
+ <div className="flex min-h-12 items-center justify-between gap-6 px-4 py-2.5">
+ <div className="min-w-0">
+ <div className="text-[13px]">{KEYS_ADD_OTHER_LABEL}</div>
+ <p className="mt-0.5 text-xs text-muted-foreground" data-agent-key-other-help>
+ {KEYS_OTHER_HELP}
+ </p>
+ </div>
+ <Button size="sm" variant="outline" disabled={!view.canEdit} onClick={() => keys.openSheet("other")} data-agent-key-add-other>
+ {KEYS_ADD_OTHER_BUTTON}
+ </Button>
+ </div>
+ </div>
+ <p className="mt-3 px-1 text-xs text-muted-foreground" data-agent-keys-intro>
+ {plainKeysIntro(view.intro)}
+ </p>
+ </section>
+
+ {keys.sheet ? <KeySheet key={`${keys.sheet.provider}:${keys.sheet.env ?? ""}`} keys={keys} provider={keys.sheet.provider} env={keys.sheet.env} /> : null}
+ <ConfirmDialog
+ open={confirm !== null}
+ onOpenChange={(o) => !o && keys.askRemove(null)}
+ title={confirm?.title ?? ""}
+ description={confirm?.message ?? ""}
+ confirmLabel={confirm?.confirmLabel ?? "Remove"}
+ cancelLabel={confirm?.cancelLabel}
+ destructive
+ onConfirm={() => {
+ const env = keys.removing;
+ if (env) void keys.remove(env).catch(toastError("Couldn't remove the key"));
+ }}
+ />
+ </div>
+ );
+}
+
+function KeyRow({ row: r, addedLabel, canEdit, onEdit, onRemove }: { row: AgentKeyRowView; addedLabel: string; canEdit: boolean; onEdit: () => void; onRemove: () => void }) {
+ return (
+ <div data-agent-key-row={r.env} data-agent-key-provider={r.provider} data-set={String(r.set)} className="flex min-h-12 items-center gap-3 px-4 py-2.5">
+ <div className="min-w-0 flex-1">
+ <div className="flex items-baseline gap-2">
+ <span className="truncate text-[13px]" data-agent-key-title>
+ {r.title}
+ </span>
+ {r.title !== r.env ? (
+ <span className="truncate font-mono text-[11px] text-muted-foreground" data-agent-key-env>
+ {r.env}
+ </span>
+ ) : null}
+ </div>
+ <div className="truncate text-xs text-muted-foreground" data-agent-key-detail>
+ {r.detail}
+ </div>
+ </div>
+ <div className="flex shrink-0 flex-col items-end">
+ <span className={r.set ? "font-mono text-[12px]" : "text-[13px] text-muted-foreground"} data-agent-key-status>
+ {r.status}
+ </span>
+ {r.addedMs !== null ? (
+ <span className="text-[11px] text-muted-foreground" data-agent-key-added>
+ {addedText(addedLabel, r.addedMs)}
+ </span>
+ ) : null}
+ </div>
+ <div className="flex shrink-0 items-center gap-1.5">
+ <Button size="sm" variant="outline" disabled={!canEdit} onClick={onEdit} data-agent-key-action>
+ {r.actionLabel}
+ </Button>
+ {r.removeLabel ? (
+ <Button size="sm" variant="ghost" disabled={!canEdit} onClick={onRemove} data-agent-key-remove>
+ {r.removeLabel}
+ </Button>
+ ) : null}
+ </div>
+ </div>
+ );
+}
diff --git a/apps/cua-spaces-web/src/components/settings/account-tab.tsx b/apps/cua-spaces-web/src/components/settings/account-tab.tsx
new file mode 100644
index 0000000000..65200b8cae
--- /dev/null
+++ b/apps/cua-spaces-web/src/components/settings/account-tab.tsx
@@ -0,0 +1,175 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+import {
+ useRelayUsage,
+ useRelayUsageView,
+ useSession,
+ useSettings,
+ useTrackPlanClick,
+ type RelayUsage,
+ type SettingsRow as CoreRow,
+ type SettingsSection,
+} from "@/bridge";
+import { SettingsGroup, SettingsRow } from "@/components/settings-group";
+import { CoreSettingsRow } from "@/components/settings/core-section";
+import { Button } from "@/components/ui/button";
+import { toastError } from "@/components/ui/toast";
+
+const fail = toastError;
+
+/** "Free plan" as "Free", for a row that already says Plan. */
+const planName = (label: string) => label.replace(/ plan$/i, "");
+
+/** 6.5, 20 and 6 hours: one decimal at most, none when whole. */
+const hours = (n: number) => String(Math.round(n * 10) / 10);
+
+/** The team the core names ("Acme Robotics", "Owner · Pro plan"), as "Acme Robotics · Owner". */
+function teamLine(teams: SettingsSection | undefined): string | null {
+ const head = teams?.rows.find((r) => /^team:[^:]+$/.test(r.id));
+ if (!head) return null;
+ const role = head.value?.split(" · ")[0];
+ return role ? `${head.label} · ${role}` : head.label;
+}
+
+/** One bar of the usage meter: `used` of `limit` (no bar without a limit). */
+function UsageBar({ id, label, text, used, limit }: { id: string; label: string; text: string; used: number; limit: number | null }) {
+ if (!limit || limit <= 0) return null;
+ const share = Math.min(1, used / limit);
+ return (
+ <div className="px-4 py-3" data-usage-line={id}>
+ <div className="mb-2 flex items-baseline justify-between gap-4 text-[13px]">
+ <span>{label}</span>
+ <span className="text-muted-foreground">{text}</span>
+ </div>
+ <div
+ role="meter"
+ aria-label={label}
+ aria-valuemin={0}
+ aria-valuemax={limit}
+ aria-valuenow={Math.min(used, limit)}
+ data-usage-meter={id}
+ data-full={used >= limit ? "" : undefined}
+ className="h-1.5 w-full overflow-hidden rounded-full bg-muted"
+ >
+ <div className={used >= limit ? "h-full bg-destructive" : "h-full bg-brand-strong"} style={{ width: `${Math.round(share * 100)}%` }} />
+ </div>
+ </div>
+ );
+}
+
+/** What the plan gives, in one line, from the limits the relay reports. */
+function allowanceLine(plan: string, usage: RelayUsage): string | null {
+ const { liveSessionsLimit: computers, hoursLimit: away } = usage;
+ if (!computers || !away) return null;
+ return `${plan}: ${computers} computers at once and ${hours(away)} hours a month away from the computer you're using.`;
+}
+
+/**
+ * Settings, Account: who you are, your plan, what you used this month, and
+ * the web account for teams, invites and billing (one button). Free accounts
+ * also get Upgrade here. Every plan word comes from the relay's plan card.
+ */
+export function AccountTab() {
+ const { data: settings, isLoading } = useSettings();
+ const { data: session, signIn, signOut, cancelSignIn, openExternal } = useSession();
+ const view = useRelayUsageView();
+ const usage = useRelayUsage();
+ const trackClick = useTrackPlanClick();
+ if (isLoading && !settings) return null;
+
+ const page = settings?.page;
+ const account = page?.sections.find((s) => s.id === "account");
+ const teams = teamLine(page?.sections.find((s) => s.id === "teams"));
+ const manageUrl = page?.sections.find((s) => s.id === "teams")?.rows.find((r) => r.id === "teams-manage")?.linkUrl ?? `${settings?.accountUrl ?? "https://app.cua.ai"}/team`;
+ const card = view?.planCard;
+ const upgrade = card?.plan === "free" ? card.primary : null;
+ const open = (url: string) => void openExternal(url).catch(fail("Couldn't open the page"));
+
+ const press = (row: CoreRow) => {
+ switch (row.id) {
+ case "account":
+ return void signOut().catch(fail("Couldn't sign out"));
+ case "sign-in":
+ return void signIn().catch(fail("Couldn't start sign-in"));
+ case "sign-in-code":
+ return cancelSignIn();
+ }
+ };
+
+ return (
+ <div data-settings-tab="account">
+ <SettingsGroup title="You">
+ {account ? (
+ account.rows.map((r) => <CoreSettingsRow key={r.id} row={r} onPress={press} />)
+ ) : (
+ <SettingsRow
+ label={session?.signedIn ? (session.identity ?? "Signed in") : "Not signed in"}
+ control={
+ session?.signedIn ? (
+ <Button size="sm" variant="outline" onClick={() => void signOut().catch(fail("Couldn't sign out"))}>
+ Sign out
+ </Button>
+ ) : (
+ <Button size="sm" variant="outline" disabled={!session} onClick={() => void signIn().catch(fail("Couldn't start sign-in"))}>
+ Sign in
+ </Button>
+ )
+ }
+ />
+ )}
+ {view ? <SettingsRow label="Plan" control={<span className="text-[13px] text-muted-foreground">{planName(view.plan || card?.label || "")}</span>} /> : null}
+ {teams ? <SettingsRow label="Team" control={<span className="text-[13px] text-muted-foreground">{teams}</span>} /> : null}
+ </SettingsGroup>
+
+ {usage && (usage.liveSessionsLimit || usage.hoursLimit) ? (
+ <SettingsGroup title="This month">
+ <div data-relay-usage="">
+ <UsageBar
+ id="Remote hours"
+ label="Time away from this computer"
+ text={`${hours(usage.hoursUsed)} of ${usage.hoursLimit ?? 0} hours`}
+ used={usage.hoursUsed}
+ limit={usage.hoursLimit}
+ />
+ <UsageBar
+ id="Live sessions"
+ label="Computers in use right now"
+ text={`${usage.liveSessions} of ${usage.liveSessionsLimit ?? 0}`}
+ used={usage.liveSessions}
+ limit={usage.liveSessionsLimit}
+ />
+ {card ? (
+ <p data-plan-card={card.plan} className="px-4 pb-3 text-xs text-muted-foreground">
+ {allowanceLine(planName(card.label), usage)}
+ </p>
+ ) : null}
+ </div>
+ </SettingsGroup>
+ ) : card ? (
+ <p data-plan-card={card.plan} className="mb-8 px-1 text-xs text-muted-foreground">
+ {card.label}
+ </p>
+ ) : null}
+
+ <div className="flex flex-col gap-3">
+ {upgrade ? (
+ <Button
+ className="h-12 w-full text-[13px]"
+ data-plan-primary=""
+ onClick={() => {
+ trackClick("plan_card");
+ open(upgrade.url);
+ }}
+ >
+ Upgrade
+ </Button>
+ ) : null}
+ <Button variant={upgrade ? "outline" : "default"} className="h-12 w-full text-[13px]" data-manage-account="" onClick={() => open(manageUrl)}>
+ Manage account on the web
+ </Button>
+ </div>
+ <p className="mt-3 px-1 text-xs text-muted-foreground">Teams, invites, billing and plans open on app.cua.ai.</p>
+ </div>
+ );
+}
diff --git a/apps/cua-spaces-web/src/components/settings/advanced-section.tsx b/apps/cua-spaces-web/src/components/settings/advanced-section.tsx
deleted file mode 100644
index 957d41a20f..0000000000
--- a/apps/cua-spaces-web/src/components/settings/advanced-section.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-// SPDX-License-Identifier: FSL-1.1-MIT
-// Copyright (c) 2026 Cua AI, Inc.
-
-import { ChevronDownIcon, ChevronRightIcon } from "lucide-react";
-import { useState } from "react";
-
-import { useMachines, useSession, useThisMachine } from "@/bridge";
-import { HostSetupForm } from "@/components/this-machine";
-import { Button } from "@/components/ui/button";
-
-/** The host form's profile for your own relay or Direct (`host::SELF_HOSTED_PROFILE`). */
-const SELF_HOSTED = "self-hosted";
-
-/**
- * Settings → Advanced, collapsed: the only place that offers your own relay
- * or a direct connection. Setup, first run and This machine offer Cua's
- * relay alone. The form is host setup's own, with Advanced open.
- */
-export function AdvancedSection() {
- const [open, setOpen] = useState(false);
- const { data: session } = useSession();
- const { data: machines } = useMachines();
- const host = useThisMachine(session?.identity ?? null);
- const form = host.formView?.advancedOpen ? host.formView : null;
-
- return (
- <section className="mb-7" data-settings-advanced={open ? "open" : "closed"}>
- <button
- type="button"
- aria-expanded={open}
- onClick={() => setOpen(!open)}
- className="mb-2 flex cursor-default items-center gap-1 px-1 text-xs font-semibold text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground"
- >
- {open ? <ChevronDownIcon className="size-3.5" /> : <ChevronRightIcon className="size-3.5" />}
- Advanced
- </button>
- {open ? (
- form ? (
- <HostSetupForm
- view={form}
- host={host}
- failure={host.setupError}
- progress={machines?.find((m) => m.current)?.hostProgress}
- onRetry={() => void host.retrySetUp()}
- />
- ) : (
- <div className="overflow-hidden rounded-xl border bg-card shadow-xs">
- <div className="flex min-h-12 items-center justify-between gap-6 px-4 py-2.5" data-self-hosting="">
- <div className="min-w-0">
- <div className="text-[13px]">Your own relay</div>
- <p className="mt-0.5 text-xs text-muted-foreground">For self-hosting teams. Connect this computer through a relay you run, or directly.</p>
- </div>
- <Button size="sm" variant="outline" disabled={host.busy} onClick={() => host.openForm(SELF_HOSTED)}>
- Set up…
- </Button>
- </div>
- </div>
- )
- ) : null}
- </section>
- );
-}
diff --git a/apps/cua-spaces-web/src/components/settings/advanced-tab.tsx b/apps/cua-spaces-web/src/components/settings/advanced-tab.tsx
new file mode 100644
index 0000000000..7be24bd62d
--- /dev/null
+++ b/apps/cua-spaces-web/src/components/settings/advanced-tab.tsx
@@ -0,0 +1,151 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+import { useAbout, useBridge, useExperiments, useMachines, useSession, useSettings, useThisMachine, type SettingsOption, type SettingsRow as CoreRow } from "@/bridge";
+import { aboutView } from "@/bridge/settings-derive";
+import { SettingsGroup } from "@/components/settings-group";
+import { CoreSettingsRow } from "@/components/settings/core-section";
+import { HostSetupForm } from "@/components/this-machine";
+import { Button } from "@/components/ui/button";
+import { toastError } from "@/components/ui/toast";
+
+/** The host form's profile for your own connection server or Direct (`host::SELF_HOSTED_PROFILE`). */
+const SELF_HOSTED = "self-hosted";
+
+const BETA_HELP = "New features sooner, with rough edges. Back on Stable, this version stays until a newer stable release.";
+
+/** Experiments that stay as Labs. "Your cloud" and "Sharing" have no switch any more: the plan decides on the server. */
+const LABS = new Set(["experiment:cua_volume", "experiment:classic_ui"]);
+
+/** The software choices in plain words (the core says Built-in and System). */
+const RUNTIME_LABEL: Record<string, string> = { "macos-runtime": "Mac computers", "linux-runtime": "Linux computers" };
+const RUNTIME_OPTION: Record<string, string> = { auto: "Automatic", builtin: "Cua’s own", system: "Already installed" };
+
+const runtimeRow = (row: CoreRow): CoreRow => ({
+ ...row,
+ label: RUNTIME_LABEL[row.id] ?? row.label,
+ options: row.options.map((o: SettingsOption) => ({ ...o, label: RUNTIME_OPTION[o.id] ?? o.label })),
+});
+
+/**
+ * Settings, Advanced: early releases, Labs, which software runs Spaces on
+ * this Mac, and your own connection server. For options most people never
+ * touch; each says what it does in a line.
+ */
+export function AdvancedTab() {
+ const { data: settings, chooseSetting } = useSettings();
+ const page = settings?.page;
+ const general = page?.sections.find((s) => s.id === "general");
+ const runtimes = page?.sections.find((s) => s.id === "runtimes");
+ const autoConnect = general?.rows.find((r) => r.id === "auto-connect");
+ const overflow = general?.rows.find((r) => r.id === "placement-overflow");
+ const choose = (row: CoreRow, option: string) => void chooseSetting(row.id, option).catch(toastError(`Couldn't change ${row.label}`));
+
+ return (
+ <div data-settings-tab="advanced">
+ <EarlyReleases />
+ <Labs />
+ {runtimes || autoConnect || overflow ? (
+ <SettingsGroup title="Which software runs Spaces on this Mac">
+ {runtimes?.rows.filter((r) => r.kind === "choice").map((r) => <CoreSettingsRow key={r.id} row={runtimeRow(r)} asSelect onChoose={choose} />)}
+ {autoConnect ? <CoreSettingsRow row={{ ...autoConnect, label: "Open a Space’s screen right away" }} onChoose={choose} /> : null}
+ {overflow ? (
+ <CoreSettingsRow
+ row={{ ...overflow, label: "Use my own cloud when this Mac is busy" }}
+ description="New Spaces go to your linked cloud when this Mac is full."
+ onChoose={choose}
+ />
+ ) : null}
+ </SettingsGroup>
+ ) : null}
+ <OwnConnection />
+ </div>
+ );
+}
+
+/** "Get early releases (Beta)": the update channel, moved here from About. */
+function EarlyReleases() {
+ const { data, setAbout } = useAbout();
+ const { mode, core } = useBridge();
+ const view = data?.view;
+ if (!view || !data) return null;
+ // A build with no update feed (a local build) keeps the row, greyed out.
+ const unavailable = !view.updates && mode === "electron" ? (aboutView(core, { ...data.input, updater: true })?.updates ?? null) : null;
+ const updates = view.updates ?? unavailable;
+ if (!updates) return null;
+ const beta = updates.channels.find((c) => c.id === "beta")?.active ?? false;
+ const row: CoreRow = {
+ id: "update-channel",
+ kind: "toggle",
+ label: "Get early releases (Beta)",
+ value: null,
+ button: null,
+ options: [
+ { id: "on", label: "On", active: beta },
+ { id: "off", label: "Off", active: !beta },
+ ],
+ enabled: data.canChange && !unavailable,
+ help: null,
+ linkLabel: null,
+ linkUrl: null,
+ placeholder: null,
+ };
+ return (
+ <SettingsGroup title="Updates">
+ <CoreSettingsRow
+ row={row}
+ description={BETA_HELP}
+ onChoose={(_, option) => void setAbout({ channel: option === "on" ? "beta" : "stable" }).catch(toastError("Couldn't change the update channel"))}
+ />
+ </SettingsGroup>
+ );
+}
+
+/** Cua Volume and, on the Mac-native app, the previous window. Off hides; nothing set up is undone. */
+function Labs() {
+ const { data, chooseExperiment } = useExperiments();
+ const { mode } = useBridge();
+ const rows = (data?.page?.sections.flatMap((s) => s.rows) ?? []).filter((r) => LABS.has(r.id) && !(mode === "electron" && r.id === "experiment:classic_ui"));
+ if (rows.length === 0) return null;
+ const note: Record<string, string> = {
+ "experiment:cua_volume": "Memory and files your agents share across every Space.",
+ "experiment:classic_ui": "Mac-native app only.",
+ };
+ return (
+ <SettingsGroup title="Labs">
+ {rows.map((r) => (
+ <CoreSettingsRow
+ key={r.id}
+ row={r.id === "experiment:classic_ui" ? { ...r, label: "Use the previous Spaces window" } : r}
+ description={note[r.id]}
+ onChoose={(row, option) => void chooseExperiment(row.id, option).catch(toastError("Couldn't change the setting"))}
+ />
+ ))}
+ </SettingsGroup>
+ );
+}
+
+/** For teams that run their own connection server (the core's "relay"), or connect directly: host setup's form, with its advanced part open. */
+function OwnConnection() {
+ const { data: session } = useSession();
+ const { data: machines } = useMachines();
+ const host = useThisMachine(session?.identity ?? null);
+ const form = host.formView?.advancedOpen ? host.formView : null;
+ return (
+ <SettingsGroup title="Connection">
+ {form ? (
+ <HostSetupForm view={form} host={host} failure={host.setupError} progress={machines?.find((m) => m.current)?.hostProgress} onRetry={() => void host.retrySetUp()} />
+ ) : (
+ <div className="flex min-h-12 items-center justify-between gap-6 px-4 py-2.5" data-self-hosting="">
+ <div className="min-w-0">
+ <div className="text-[13px]">Use your own connection server</div>
+ <p className="mt-0.5 text-xs text-muted-foreground">For teams that run their own.</p>
+ </div>
+ <Button size="sm" variant="outline" disabled={host.busy} onClick={() => host.openForm(SELF_HOSTED)}>
+ Set up…
+ </Button>
+ </div>
+ )}
+ </SettingsGroup>
+ );
+}
diff --git a/apps/cua-spaces-web/src/components/settings/agents-section.tsx b/apps/cua-spaces-web/src/components/settings/agents-section.tsx
index 6b29935a14..1f825a0226 100644
--- a/apps/cua-spaces-web/src/components/settings/agents-section.tsx
+++ b/apps/cua-spaces-web/src/components/settings/agents-section.tsx
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: FSL-1.1-MIT
// Copyright (c) 2026 Cua AI, Inc.
-import { useEffect } from "react";
-
import { useSettings, type SettingsSection } from "@/bridge";
import { CoreSettingsSection } from "@/components/settings/core-section";
import { toastError } from "@/components/ui/toast";
@@ -17,12 +15,7 @@ import { toastError } from "@/components/ui/toast";
* they run.
*/
export function AgentsSettingsSection({ section }: { section: SettingsSection }) {
- const { loadAgentRows, configureAllAgents, pressAgentRow } = useSettings();
-
- useEffect(() => {
- void loadAgentRows().catch(() => {});
- // eslint-disable-next-line react-hooks/exhaustive-deps -- once per showing
- }, []);
+ const { configureAllAgents, pressAgentRow } = useSettings();
return (
<CoreSettingsSection
diff --git a/apps/cua-spaces-web/src/components/settings/cli-section.tsx b/apps/cua-spaces-web/src/components/settings/cli-section.tsx
index f29bf0f840..c544477577 100644
--- a/apps/cua-spaces-web/src/components/settings/cli-section.tsx
+++ b/apps/cua-spaces-web/src/components/settings/cli-section.tsx
@@ -31,7 +31,7 @@ export function CliSettingsSection() {
<SettingsGroup title="Terminal">
<div data-settings-cli={view.installed ? "installed" : "missing"}>
<SettingsRow
- label="Cua in Terminal"
+ label="Use Cua from Terminal"
description={
<>
{view.status}
diff --git a/apps/cua-spaces-web/src/components/settings/coding-apps-section.tsx b/apps/cua-spaces-web/src/components/settings/coding-apps-section.tsx
new file mode 100644
index 0000000000..be50e4bf2c
--- /dev/null
+++ b/apps/cua-spaces-web/src/components/settings/coding-apps-section.tsx
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+import { lazy, Suspense } from "react";
+
+import { useSettings } from "@/bridge";
+import { SettingsGroup } from "@/components/settings-group";
+import { AgentsSettingsSection } from "@/components/settings/agents-section";
+
+// Its miniature and setup load with the card.
+const DriverSettingsCard = lazy(() => import("@/components/volume/driver-card").then((m) => ({ default: m.DriverSettingsCard })));
+
+/**
+ * Settings, Connected apps, "Coding apps": the coding apps on this computer
+ * and whether Cua is set up in each one.
+ */
+export function CodingAppsSection() {
+ const section = useSettings().data?.page?.sections.find((s) => s.id === "agents");
+ return (
+ <>
+ {section ? <AgentsSettingsSection section={section} /> : null}
+ <SettingsGroup title="Background computer use">
+ <Suspense fallback={<div className="h-48" />}>
+ <DriverSettingsCard />
+ </Suspense>
+ </SettingsGroup>
+ </>
+ );
+}
diff --git a/apps/cua-spaces-web/src/components/settings/core-section.tsx b/apps/cua-spaces-web/src/components/settings/core-section.tsx
index c1ca892779..8f5e9443e3 100644
--- a/apps/cua-spaces-web/src/components/settings/core-section.tsx
+++ b/apps/cua-spaces-web/src/components/settings/core-section.tsx
@@ -43,7 +43,7 @@ export function CoreSettingsSection({
}
}
return (
- <section className="mb-7" data-settings-section={section.id}>
+ <section className="mb-8" data-settings-section={section.id}>
<div className="mb-2 flex min-h-6 items-center justify-between gap-2 px-1">
<h2 className="text-xs font-semibold text-muted-foreground">{title ?? section.title}</h2>
{section.button ? (
@@ -66,7 +66,14 @@ export function CoreSettingsSection({
const optionOf = (row: SettingsRow) => row.options.find((o) => o.active)?.id ?? "";
/** One core row. Every row carries `data-setting-row` (its id) for tests and the parity harness. */
-export function CoreSettingsRow({ row, description, onPress, onChoose, onEdit }: CoreRowHandlers & { row: SettingsRow; description?: string }) {
+export function CoreSettingsRow({
+ row,
+ description,
+ asSelect,
+ onPress,
+ onChoose,
+ onEdit,
+}: CoreRowHandlers & { row: SettingsRow; description?: string; /** Draw a choice as a drop-down, however few options it has. */ asSelect?: boolean }) {
const { openExternal } = useSession();
const attrs = { "data-setting-row": row.id, "data-kind": row.kind, "data-enabled": String(row.enabled) };
const id = `setting-${row.id.replace(/[^a-z0-9-]/gi, "-")}`;
@@ -86,7 +93,7 @@ export function CoreSettingsRow({ row, description, onPress, onChoose, onEdit }:
return (
<Line {...attrs} title={row.help ?? undefined}>
<Label label={row.label} description={description} />
- {options.length > 3 ? (
+ {asSelect || options.length > 3 ? (
<Select aria-label={row.label} value={optionOf(row)} options={options} disabled={!row.enabled} onValueChange={(v) => onChoose?.(row, v)} />
) : (
<Segmented aria-label={row.label} value={optionOf(row)} options={options} disabled={!row.enabled} onValueChange={(v) => onChoose?.(row, v)} />
diff --git a/apps/cua-spaces-web/src/components/settings/general-tab.tsx b/apps/cua-spaces-web/src/components/settings/general-tab.tsx
new file mode 100644
index 0000000000..3d2dff4109
--- /dev/null
+++ b/apps/cua-spaces-web/src/components/settings/general-tab.tsx
@@ -0,0 +1,173 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+import { MonitorIcon, MoonIcon, SunIcon } from "lucide-react";
+import { useEffect, useState } from "react";
+
+import { useLoginItem, useSession, useSettings, type GlobalShortcut, type SettingsRow as CoreRow } from "@/bridge";
+import { SettingsGroup, SettingsRow } from "@/components/settings-group";
+import { CoreSettingsRow } from "@/components/settings/core-section";
+import { Button } from "@/components/ui/button";
+import { Segmented } from "@/components/ui/segmented";
+import { Switch } from "@/components/ui/switch";
+import { toastError } from "@/components/ui/toast";
+import { globalShortcutLine, showsMacShellSettings } from "@/lib/host-labels";
+import { LAUNCH_HELP, LAUNCH_LABEL } from "@/lib/settings-copy";
+import { acceleratorOf } from "@/lib/shortcut-keys";
+import { useTheme, type ThemePreference } from "@/lib/theme";
+
+const fail = toastError;
+
+const APPEARANCE: { value: ThemePreference; label: React.ReactNode }[] = [
+ { value: "system", label: <><MonitorIcon className="size-3.5" /> System</> },
+ { value: "light", label: <><SunIcon className="size-3.5" /> Light</> },
+ { value: "dark", label: <><MoonIcon className="size-3.5" /> Dark</> },
+];
+
+const TELEMETRY_HELP = "Which features you use and when something goes wrong. Never your files, what you type or your screen.";
+
+/** The core's notch row in plain words: "Show Cua in", Notch and menu bar or Menu bar only. */
+export const showCuaIn = (row: CoreRow): CoreRow => ({
+ ...row,
+ label: "Show Cua in",
+ options: row.options.map((o) => ({ ...o, label: o.id === "hide" ? "Menu bar only" : "Notch and menu bar" })),
+});
+
+/**
+ * Settings, General: the few things a person sets every day. Start at login,
+ * where Cua lives (Mac), appearance, the shortcut (Mac) and usage data.
+ * Everything else moved: Advanced, Connected apps, Trusted devices, the Volume
+ * and Keyvault pages.
+ */
+export function GeneralTab() {
+ const { data: settings, updateSetting, chooseSetting } = useSettings();
+ const { preference, setPreference } = useTheme();
+ const mac = showsMacShellSettings();
+ const page = settings?.page;
+ const general = page?.sections.find((s) => s.id === "general");
+ const telemetry = page?.sections.find((s) => s.id === "privacy");
+ const notch = general?.rows.find((r) => r.id === "notch");
+ const telemetryRow = telemetry?.rows.find((r) => r.id === "telemetry");
+ const dataLink = telemetry?.rows.find((r) => r.id === "telemetry-note");
+ const values = settings?.values;
+ const { openExternal } = useSession();
+
+ return (
+ <div data-settings-tab="general">
+ <SettingsGroup title="Everyday">
+ <LaunchAtLogin />
+ {mac && notch ? (
+ <CoreSettingsRow
+ row={showCuaIn(notch)}
+ description="Pick where to find Cua Spaces. Mac only."
+ onChoose={(_, option) => void updateSetting("menuBar", option === "hide").catch(fail("Couldn't change where Cua shows"))}
+ />
+ ) : mac && values ? (
+ <SettingsRow
+ label="Show Cua in"
+ description="Pick where to find Cua Spaces. Mac only."
+ control={
+ <Segmented
+ aria-label="Show Cua in"
+ value={values.menuBar ? "hide" : "show"}
+ options={[
+ { value: "show", label: "Notch and menu bar" },
+ { value: "hide", label: "Menu bar only" },
+ ]}
+ onValueChange={(v) => void updateSetting("menuBar", v === "hide").catch(fail("Couldn't change where Cua shows"))}
+ />
+ }
+ />
+ ) : null}
+ <SettingsRow label="Appearance" control={<Segmented aria-label="Appearance" value={preference} options={APPEARANCE} onValueChange={setPreference} />} />
+ <ShortcutRow shortcut={settings?.globalShortcut} onChange={(accelerator) => chooseSetting("global-shortcut", accelerator)} />
+ {telemetryRow ? (
+ <CoreSettingsRow
+ row={{ ...telemetryRow, kind: "toggle" }}
+ description={TELEMETRY_HELP}
+ onChoose={(_, option) => void updateSetting("telemetry", option === "on").catch(fail("Couldn't change usage data"))}
+ />
+ ) : values ? (
+ <SettingsRow
+ label="Share usage data to help improve Cua"
+ description={TELEMETRY_HELP}
+ htmlFor="telemetry"
+ control={<Switch id="telemetry" checked={values.telemetry} onCheckedChange={(on) => void updateSetting("telemetry", on).catch(fail("Couldn't change usage data"))} />}
+ />
+ ) : null}
+ </SettingsGroup>
+ {dataLink?.linkLabel && dataLink.linkUrl ? (
+ <button
+ type="button"
+ data-telemetry-link=""
+ className="-mt-4 px-1 text-[13px] text-brand-strong outline-none hover:underline focus-visible:underline"
+ onClick={() => void openExternal(dataLink.linkUrl!).catch(fail("Couldn't open the page"))}
+ >
+ {dataLink.linkLabel}
+ </button>
+ ) : null}
+ </div>
+ );
+}
+
+/** Launch at login as the app core lays it out; the switch shows what the system reports, never what was asked. */
+function LaunchAtLogin() {
+ const { data, setLaunchAtLogin, openLoginItems } = useLoginItem();
+ if (!data?.rows) return null;
+ return data.rows
+ .filter((row) => row.id !== "launch-at-login-note")
+ .map((row) =>
+ row.id === "launch-at-login" ? (
+ <CoreSettingsRow
+ key={row.id}
+ row={{ ...row, label: LAUNCH_LABEL }}
+ description={LAUNCH_HELP}
+ onChoose={(_, option) => void setLaunchAtLogin(option === "on")}
+ />
+ ) : (
+ <CoreSettingsRow key={row.id} row={row} onPress={() => void openLoginItems().catch(fail("Couldn't open Login Items"))} />
+ ),
+ );
+}
+
+/**
+ * The key that brings Cua Spaces forward from any app (the Mac hosts register
+ * one). Change waits for the next keys pressed (Esc cancels); the host says
+ * whether the system gave them, and a taken shortcut shows as the old line.
+ */
+function ShortcutRow({ shortcut, onChange }: { shortcut: GlobalShortcut | null | undefined; onChange: (accelerator: string) => Promise<void> }) {
+ const [recording, setRecording] = useState(false);
+ useEffect(() => {
+ if (!recording) return;
+ const onKey = (e: KeyboardEvent) => {
+ e.preventDefault();
+ e.stopPropagation();
+ if (e.key === "Escape") return setRecording(false);
+ const accelerator = acceleratorOf(e);
+ if (!accelerator) return;
+ setRecording(false);
+ void onChange(accelerator).catch(fail("Couldn't change the shortcut"));
+ };
+ window.addEventListener("keydown", onKey, true);
+ return () => window.removeEventListener("keydown", onKey, true);
+ }, [recording, onChange]);
+ if (!shortcut) return null;
+ return (
+ <div data-global-shortcut={shortcut.registered ? "registered" : "taken"}>
+ <SettingsRow
+ label="Open Cua Spaces from any app"
+ description={recording ? "Press the keys you want. Esc cancels." : shortcut.registered ? "Press this to bring Cua Spaces to the front." : globalShortcutLine(shortcut)}
+ control={
+ <div className="flex items-center gap-2">
+ <span className="text-[13px] text-muted-foreground" data-shortcut-label="">
+ {recording ? "…" : shortcut.label}
+ </span>
+ <Button variant="outline" size="sm" data-shortcut-change="" onClick={() => setRecording((r) => !r)}>
+ {recording ? "Cancel" : "Change"}
+ </Button>
+ </div>
+ }
+ />
+ </div>
+ );
+}
diff --git a/apps/cua-spaces-web/src/components/settings/screen-permissions-section.tsx b/apps/cua-spaces-web/src/components/settings/screen-permissions-section.tsx
index 43fdc669c3..fe9f40b47f 100644
--- a/apps/cua-spaces-web/src/components/settings/screen-permissions-section.tsx
+++ b/apps/cua-spaces-web/src/components/settings/screen-permissions-section.tsx
@@ -9,7 +9,7 @@ import { Button } from "@/components/ui/button";
import { toastError } from "@/components/ui/toast";
/**
- * Settings, Permissions: the first run's "Share this Mac's screen" rows
+ * Settings, Trusted devices, "Let others use this computer": the first run's "Share this Mac's screen" rows
* (Screen Recording, Accessibility), for whoever chose "Not now" there.
* Only on a Mac that is set up and shares its screen. Allow opens the app's
* guide to the System Settings pane; a check shows once it is granted.
@@ -18,12 +18,13 @@ export function ScreenPermissionsSection() {
const perms = useScreenPermissions();
if (!perms) return null;
const { view } = perms;
+ const place = view.rows.map((r) => /^See (.+)\u2019?'?s screen$/.exec(r.title)?.[1]).find(Boolean) ?? "this computer";
return (
- <SettingsGroup title="Permissions">
+ <SettingsGroup title="Let others use this computer">
{view.rows.map((r) => (
<SettingsRow
key={r.id}
- label={r.title}
+ label={r.id === "accessibility" ? `Let others click and type on ${place}` : r.title.replace(/^See /, "Let others see ")}
description={r.note}
control={
r.state === "ok" ? (
diff --git a/apps/cua-spaces-web/src/components/settings/storage-section.tsx b/apps/cua-spaces-web/src/components/settings/storage-section.tsx
new file mode 100644
index 0000000000..08cbeaca76
--- /dev/null
+++ b/apps/cua-spaces-web/src/components/settings/storage-section.tsx
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+import { useExperiments, useStorageSettings, type SettingsRow, type SettingsSection } from "@/bridge";
+import { CoreSettingsSection } from "@/components/settings/core-section";
+import { plainStorage as plain } from "@/lib/settings-copy";
+
+const plainRow = (row: SettingsRow): SettingsRow => ({
+ ...row,
+ label: plain(row.label),
+ value: row.value ? plain(row.value) : row.value,
+ options: row.options.map((o) => ({ ...o, label: plain(o.label) })),
+});
+
+/**
+ * The Volume page's Storage: where Cua Volume keeps its files, the Finder
+ * volume and the cache. It used to sit in Settings, General; where the files
+ * live is a Volume setting, so it is on the Volume page now. Every row is
+ * the app core's (`drive_settings::storage_section`), in plain words.
+ */
+export function StorageSection() {
+ const { data: experiments } = useExperiments();
+ // Only with the Cua Volume experiment on (`settings.withStorage`); off, nothing it set up is touched.
+ if (!experiments?.experiments.cuaVolume) return null;
+ return <StorageSectionBody />;
+}
+
+function StorageSectionBody() {
+ const { data, press, choose, edit, save } = useStorageSettings();
+ if (!data?.section) return null;
+ const section: SettingsSection = { ...data.section, rows: data.section.rows.map(plainRow) };
+ return (
+ <CoreSettingsSection
+ section={section}
+ onHeaderButton={save}
+ onPress={(r) => press(r.id)}
+ onChoose={(r, option) => choose(r.id, option)}
+ onEdit={(r, value) => edit(r.id, value)}
+ />
+ );
+}
diff --git a/apps/cua-spaces-web/src/components/shell/command-palette.tsx b/apps/cua-spaces-web/src/components/shell/command-palette.tsx
index 41b24bae6a..09362f779b 100644
--- a/apps/cua-spaces-web/src/components/shell/command-palette.tsx
+++ b/apps/cua-spaces-web/src/components/shell/command-palette.tsx
@@ -14,6 +14,7 @@ import {
PanelLeftIcon,
PlusIcon,
SearchIcon,
+ SettingsIcon,
SparklesIcon,
SunIcon,
type LucideIcon,
@@ -28,6 +29,7 @@ import { toast, toastError } from "@/components/ui/toast";
import { filterCommands, type PaletteCommand } from "@/lib/commands";
import { machineName, osLabel, paletteKeywords, realSpaces, spaceState } from "@/lib/spaces";
import { bindingFor } from "@/lib/keybindings";
+import { SETTINGS_TABS } from "@/lib/settings-tabs";
import { useTheme } from "@/lib/theme";
import { cn } from "@/lib/utils";
import { useNewSpace } from "@/hooks/use-new-space";
@@ -135,6 +137,15 @@ function PaletteBody({ onClose }: { onClose: () => void }) {
icon: icon(n.icon),
run: () => void navigate({ to: n.to }),
})),
+ // Each Settings tab, so Cmd+K finds "Connected apps" or "Trusted devices" by name.
+ ...SETTINGS_TABS.filter((t) => t.to !== "/settings").map((t) => ({
+ id: `settings:${t.to}`,
+ group: "Go to",
+ label: `Settings: ${t.label}`,
+ keywords: "preferences options",
+ icon: icon(SettingsIcon),
+ run: () => void navigate({ to: t.to }),
+ })),
{ id: "nav:onboarding", group: "Go to", label: "Onboarding", keywords: "welcome setup", icon: icon(SparklesIcon), run: () => void navigate({ to: "/onboarding" }) },
{
id: "nav:checklist",
diff --git a/apps/cua-spaces-web/src/lib/agent-keys.ts b/apps/cua-spaces-web/src/lib/agent-keys.ts
index 2ee947640b..6a7a9823cd 100644
--- a/apps/cua-spaces-web/src/lib/agent-keys.ts
+++ b/apps/cua-spaces-web/src/lib/agent-keys.ts
@@ -5,6 +5,6 @@
export const addedText = (label: string, ms: number, locale?: string, timeZone?: string) =>
`${label} ${new Date(ms).toLocaleDateString(locale ?? "en-US", { month: "short", day: "numeric", year: "numeric", timeZone })}`;
-/** Whether an agent's error is a missing provider key, which Settings → Agents fixes. */
+/** Whether an agent's error is a missing provider key, which Settings, Connected apps fixes. */
export const needsAgentKey = (error: string | null | undefined): boolean =>
- Boolean(error && /Settings → Agents|Authentication required|has no credential/i.test(error));
+ Boolean(error && /Settings → Agents|Settings → Connected apps|Authentication required|has no credential/i.test(error));
diff --git a/apps/cua-spaces-web/src/lib/settings-copy.test.ts b/apps/cua-spaces-web/src/lib/settings-copy.test.ts
new file mode 100644
index 0000000000..b2990084df
--- /dev/null
+++ b/apps/cua-spaces-web/src/lib/settings-copy.test.ts
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+import { describe, expect, it } from "vitest";
+
+import { plainDevice, plainDeviceSentence, plainKeysIntro } from "./settings-copy";
+
+describe("plainDevice", () => {
+ it.each([
+ ["Enroll…", "Trust this computer"],
+ ["Enrolled until Nov 18, 2026", "Trusted until Nov 18, 2026"],
+ ["Re-verification due", "Needs a quick check"],
+ ["macOS · Enrolled · re-verify in 24 days", "macOS · Trusted · check again in 24 days"],
+ ["Revoke…", "Remove"],
+ ["This Device", "This computer"],
+ ["Your Devices", "Your computers"],
+ ["Recent Access", "Recent activity"],
+ ["New Computers", "Computers waiting for you"],
+ ["Rename", "Rename"],
+ ])("%s as %s", (from, to) => expect(plainDevice(from)).toBe(to));
+});
+
+describe("plainDeviceSentence", () => {
+ it("rewrites a banner and a dialog", () => {
+ expect(plainDeviceSentence("Enroll this device to reach your computers.")).toBe("Trust this computer to reach your computers.");
+ expect(plainDeviceSentence("This device will no longer list or reach your computers until you enroll it again.")).toBe(
+ "This computer will no longer list or reach your computers until you trust it again.",
+ );
+ expect(plainDeviceSentence("An unenrolled device opened mac-mini")).toBe("An untrusted device opened mac-mini");
+ });
+});
+
+describe("plainKeysIntro", () => {
+ it("says account key, and keeps the system's words about where keys stay", () => {
+ const core = "Agents in your Spaces need a provider key to run. Keys stay on this PC in Windows Credential Manager, and each one is only given to the agents that use it.";
+ expect(plainKeysIntro(core)).toBe(
+ "Agents in your Spaces need an account key from their AI company to run. Keys stay on this PC in Windows Credential Manager, and each one is only given to the agents that use it.",
+ );
+ });
+});
diff --git a/apps/cua-spaces-web/src/lib/settings-copy.ts b/apps/cua-spaces-web/src/lib/settings-copy.ts
new file mode 100644
index 0000000000..a33cc13233
--- /dev/null
+++ b/apps/cua-spaces-web/src/lib/settings-copy.ts
@@ -0,0 +1,77 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+/**
+ * Plain words for Settings. The app core still sends the old labels
+ * (`enrolled`, `revoke`, `re-verify`); the Settings pages show these instead,
+ * so a high-schooler can read them. One list, one place to change a word.
+ */
+
+const DEVICE_WORDS: readonly [RegExp, string][] = [
+ [/^Enroll…?$/, "Trust this computer"],
+ [/^Enroll This Mac…?$/, "Trust this computer"],
+ [/^Re-verify This Mac…?$/, "Trust this computer"],
+ [/^Enrolled until\b/, "Trusted until"],
+ [/^Enrolled$/, "Trusted"],
+ [/^Needs enrollment\b/, "Not trusted yet"],
+ [/^Re-verification due$/, "Needs a quick check"],
+ [/^Revoked$/, "Removed"],
+ [/\bre-verify in\b/, "check again in"],
+ [/\bRe-verification due\b/, "Needs a quick check"],
+ [/\bEnrolled\b/, "Trusted"],
+ [/^Revoke…?$/, "Remove"],
+ [/^Revoke$/, "Remove"],
+ [/^This Device$/, "This computer"],
+ [/^Your Devices$/, "Your computers"],
+ [/^Recent Access$/, "Recent activity"],
+ [/^No access yet$/, "No activity yet"],
+ [/^New Computers$/, "Computers waiting for you"],
+];
+
+/** One Devices label or detail line in plain words; anything it does not know stays as it is. */
+export function plainDevice(text: string): string {
+ return DEVICE_WORDS.reduce((out, [from, to]) => out.replace(from, to), text);
+}
+
+const SENTENCE_WORDS: readonly [RegExp, string][] = [
+ [/\bunenrolled\b/g, "untrusted"],
+ [/\bEnroll\b/g, "Trust"],
+ [/\benroll\b/g, "trust"],
+ [/\benrolled\b/g, "trusted"],
+ [/\bEnrolled\b/g, "Trusted"],
+ [/\bRe-verification is due\b/g, "It needs a quick check"],
+ [/\bRe-verify\b/g, "Check"],
+ [/\bre-verify\b/g, "check"],
+ [/\bRevoke\b/g, "Remove"],
+ [/\brevoke\b/g, "remove"],
+ [/\brevoked\b/g, "removed"],
+ [/\bThis Device\b/g, "This computer"],
+ [/\bThis device\b/g, "This computer"],
+ [/\bthis device\b/g, "this computer"],
+];
+
+/** A whole sentence (a banner, a dialog, an activity line) in plain words. */
+export function plainDeviceSentence(text: string): string {
+ return SENTENCE_WORDS.reduce((out, [from, to]) => out.replace(from, to), plainDevice(text));
+}
+
+/** The keys page's line under the list, with "provider key" as "account key from their AI company". */
+export function plainKeysIntro(intro: string): string {
+ return intro.replace("need a provider key to run.", "need an account key from their AI company to run.");
+}
+
+/** Settings, Connected apps, Account keys. */
+export const KEYS_TITLE = "Account keys";
+export const KEYS_ADD_OTHER_LABEL = "Add a key for another AI company";
+export const KEYS_ADD_OTHER_BUTTON = "Add key";
+export const KEYS_OTHER_HELP = "Use the name its app expects, like GEMINI_API_KEY.";
+
+/** Launch at login, General. */
+export const LAUNCH_LABEL = "Start Cua Spaces when you sign in";
+export const LAUNCH_HELP = "Keeps your computers reachable after a restart.";
+
+/** The core's "Last check: 2 minutes ago" as "Last checked 2 minutes ago" (About). */
+export const lastChecked = (line: string) => line.replace(/^Last check:\s*/, "Last checked ");
+
+/** "S3-compatible" is jargon: your own storage (S3). */
+export const plainStorage = (text: string) => text.replace(/S3-compatible( bucket| storage)?/gi, "Your own storage (S3)");
diff --git a/apps/cua-spaces-web/src/lib/settings-tabs.ts b/apps/cua-spaces-web/src/lib/settings-tabs.ts
new file mode 100644
index 0000000000..8ac1ef33ac
--- /dev/null
+++ b/apps/cua-spaces-web/src/lib/settings-tabs.ts
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+/** Settings' tabs, in order. Account is the page at `/settings`. */
+export const SETTINGS_TABS = [
+ { to: "/settings", label: "Account", exact: true },
+ { to: "/settings/general", label: "General", exact: false },
+ { to: "/settings/connected-apps", label: "Connected apps", exact: false },
+ { to: "/settings/devices", label: "Trusted devices", exact: false },
+ { to: "/settings/advanced", label: "Advanced", exact: false },
+ { to: "/settings/about", label: "About", exact: false },
+] as const;
diff --git a/apps/cua-spaces-web/src/lib/shortcut-keys.test.ts b/apps/cua-spaces-web/src/lib/shortcut-keys.test.ts
new file mode 100644
index 0000000000..399825e839
--- /dev/null
+++ b/apps/cua-spaces-web/src/lib/shortcut-keys.test.ts
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+import { describe, expect, it } from "vitest";
+
+import { acceleratorOf, type KeyPress } from "./shortcut-keys";
+
+const press = (over: Partial<KeyPress>): KeyPress => ({ key: "", code: "", metaKey: false, ctrlKey: false, altKey: false, shiftKey: false, ...over });
+
+describe("acceleratorOf", () => {
+ it("builds the default shortcut", () => {
+ expect(acceleratorOf(press({ key: " ", code: "Space", metaKey: true, shiftKey: true }))).toBe("Shift+Command+Space");
+ });
+ it("names letters and digits by their key, not the typed character", () => {
+ expect(acceleratorOf(press({ key: "å", code: "KeyA", altKey: true }))).toBe("Alt+A");
+ expect(acceleratorOf(press({ key: "1", code: "Digit1", ctrlKey: true }))).toBe("Control+1");
+ });
+ it("needs Command, Control or Option: Shift alone does not make a shortcut", () => {
+ expect(acceleratorOf(press({ key: "A", code: "KeyA", shiftKey: true }))).toBeNull();
+ expect(acceleratorOf(press({ key: "a", code: "KeyA" }))).toBeNull();
+ });
+ it("waits while only a modifier is down", () => {
+ expect(acceleratorOf(press({ key: "Meta", code: "MetaLeft", metaKey: true }))).toBeNull();
+ });
+});
diff --git a/apps/cua-spaces-web/src/lib/shortcut-keys.ts b/apps/cua-spaces-web/src/lib/shortcut-keys.ts
new file mode 100644
index 0000000000..92807682d9
--- /dev/null
+++ b/apps/cua-spaces-web/src/lib/shortcut-keys.ts
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+/**
+ * Turns the keys a person presses into the shortcut the Mac app registers
+ * (an Electron accelerator such as `Command+Shift+Space`). A shortcut needs
+ * at least one of Command, Control or Option, so a bare letter never grabs
+ * the keyboard from every app.
+ */
+
+export type KeyPress = Pick<KeyboardEvent, "key" | "code" | "metaKey" | "ctrlKey" | "altKey" | "shiftKey">;
+
+const NAMED: Record<string, string> = {
+ Space: "Space",
+ Enter: "Return",
+ Tab: "Tab",
+ Backspace: "Backspace",
+ ArrowUp: "Up",
+ ArrowDown: "Down",
+ ArrowLeft: "Left",
+ ArrowRight: "Right",
+};
+
+const MODIFIER_KEYS = new Set(["Meta", "Control", "Alt", "Shift"]);
+
+/** The key's name for an accelerator, or null for a modifier alone or a key we don't take. */
+function keyName(e: KeyPress): string | null {
+ if (MODIFIER_KEYS.has(e.key)) return null;
+ const named = NAMED[e.code];
+ if (named) return named;
+ if (/^Key[A-Z]$/.test(e.code)) return e.code.slice(3);
+ if (/^Digit\d$/.test(e.code)) return e.code.slice(5);
+ if (/^F([1-9]|1\d|2[0-4])$/.test(e.code)) return e.code;
+ return null;
+}
+
+/** The accelerator for a key press, or null while it is not a complete shortcut yet. */
+export function acceleratorOf(e: KeyPress): string | null {
+ const key = keyName(e);
+ if (!key || !(e.metaKey || e.ctrlKey || e.altKey)) return null;
+ const parts = [e.ctrlKey && "Control", e.altKey && "Alt", e.shiftKey && "Shift", e.metaKey && "Command", key];
+ return parts.filter(Boolean).join("+");
+}
diff --git a/apps/cua-spaces-web/src/routeTree.gen.ts b/apps/cua-spaces-web/src/routeTree.gen.ts
index 8f5d7bb382..7dcc3c4583 100644
--- a/apps/cua-spaces-web/src/routeTree.gen.ts
+++ b/apps/cua-spaces-web/src/routeTree.gen.ts
@@ -21,9 +21,12 @@ import { Route as NotificationsIndexRouteImport } from './routes/notifications/i
import { Route as OnboardingIndexRouteImport } from './routes/onboarding/index'
import { Route as SettingsIndexRouteImport } from './routes/settings/index'
import { Route as SettingsAboutRouteImport } from './routes/settings/about'
+import { Route as SettingsAdvancedRouteImport } from './routes/settings/advanced'
import { Route as SettingsAgentsRouteImport } from './routes/settings/agents'
+import { Route as SettingsConnectedAppsRouteImport } from './routes/settings/connected-apps'
import { Route as SettingsDevicesRouteImport } from './routes/settings/devices'
import { Route as SettingsExperimentsRouteImport } from './routes/settings/experiments'
+import { Route as SettingsGeneralRouteImport } from './routes/settings/general'
import { Route as SpacesIndexRouteImport } from './routes/spaces/index'
import { Route as SpacesSpaceIdRouteImport } from './routes/spaces/$spaceId'
import { Route as VolumeIndexRouteImport } from './routes/volume/index'
@@ -73,11 +76,21 @@ const SettingsAboutRoute = SettingsAboutRouteImport.update({
path: '/about',
getParentRoute: () => SettingsRouteRoute,
} as any)
+const SettingsAdvancedRoute = SettingsAdvancedRouteImport.update({
+ id: '/advanced',
+ path: '/advanced',
+ getParentRoute: () => SettingsRouteRoute,
+} as any)
const SettingsAgentsRoute = SettingsAgentsRouteImport.update({
id: '/agents',
path: '/agents',
getParentRoute: () => SettingsRouteRoute,
} as any)
+const SettingsConnectedAppsRoute = SettingsConnectedAppsRouteImport.update({
+ id: '/connected-apps',
+ path: '/connected-apps',
+ getParentRoute: () => SettingsRouteRoute,
+} as any)
const SettingsDevicesRoute = SettingsDevicesRouteImport.update({
id: '/devices',
path: '/devices',
@@ -88,6 +101,11 @@ const SettingsExperimentsRoute = SettingsExperimentsRouteImport.update({
path: '/experiments',
getParentRoute: () => SettingsRouteRoute,
} as any)
+const SettingsGeneralRoute = SettingsGeneralRouteImport.update({
+ id: '/general',
+ path: '/general',
+ getParentRoute: () => SettingsRouteRoute,
+} as any)
const SpacesIndexRoute = SpacesIndexRouteImport.update({
id: '/spaces/',
path: '/spaces/',
@@ -108,9 +126,12 @@ export interface FileRoutesByFullPath {
'/': typeof IndexRoute
'/settings': typeof SettingsRouteRouteWithChildren
'/settings/about': typeof SettingsAboutRoute
+ '/settings/advanced': typeof SettingsAdvancedRoute
'/settings/agents': typeof SettingsAgentsRoute
+ '/settings/connected-apps': typeof SettingsConnectedAppsRoute
'/settings/devices': typeof SettingsDevicesRoute
'/settings/experiments': typeof SettingsExperimentsRoute
+ '/settings/general': typeof SettingsGeneralRoute
'/spaces/$spaceId': typeof SpacesSpaceIdRoute
'/agents/': typeof AgentsIndexRoute
'/keyvault/': typeof KeyvaultIndexRoute
@@ -124,9 +145,12 @@ export interface FileRoutesByFullPath {
export interface FileRoutesByTo {
'/': typeof IndexRoute
'/settings/about': typeof SettingsAboutRoute
+ '/settings/advanced': typeof SettingsAdvancedRoute
'/settings/agents': typeof SettingsAgentsRoute
+ '/settings/connected-apps': typeof SettingsConnectedAppsRoute
'/settings/devices': typeof SettingsDevicesRoute
'/settings/experiments': typeof SettingsExperimentsRoute
+ '/settings/general': typeof SettingsGeneralRoute
'/spaces/$spaceId': typeof SpacesSpaceIdRoute
'/agents': typeof AgentsIndexRoute
'/keyvault': typeof KeyvaultIndexRoute
@@ -142,9 +166,12 @@ export interface FileRoutesById {
'/': typeof IndexRoute
'/settings': typeof SettingsRouteRouteWithChildren
'/settings/about': typeof SettingsAboutRoute
+ '/settings/advanced': typeof SettingsAdvancedRoute
'/settings/agents': typeof SettingsAgentsRoute
+ '/settings/connected-apps': typeof SettingsConnectedAppsRoute
'/settings/devices': typeof SettingsDevicesRoute
'/settings/experiments': typeof SettingsExperimentsRoute
+ '/settings/general': typeof SettingsGeneralRoute
'/spaces/$spaceId': typeof SpacesSpaceIdRoute
'/agents/': typeof AgentsIndexRoute
'/keyvault/': typeof KeyvaultIndexRoute
@@ -161,9 +188,12 @@ export interface FileRouteTypes {
| '/'
| '/settings'
| '/settings/about'
+ | '/settings/advanced'
| '/settings/agents'
+ | '/settings/connected-apps'
| '/settings/devices'
| '/settings/experiments'
+ | '/settings/general'
| '/spaces/$spaceId'
| '/agents/'
| '/keyvault/'
@@ -177,9 +207,12 @@ export interface FileRouteTypes {
to:
| '/'
| '/settings/about'
+ | '/settings/advanced'
| '/settings/agents'
+ | '/settings/connected-apps'
| '/settings/devices'
| '/settings/experiments'
+ | '/settings/general'
| '/spaces/$spaceId'
| '/agents'
| '/keyvault'
@@ -194,9 +227,12 @@ export interface FileRouteTypes {
| '/'
| '/settings'
| '/settings/about'
+ | '/settings/advanced'
| '/settings/agents'
+ | '/settings/connected-apps'
| '/settings/devices'
| '/settings/experiments'
+ | '/settings/general'
| '/spaces/$spaceId'
| '/agents/'
| '/keyvault/'
@@ -286,6 +322,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof SettingsAboutRouteImport
parentRoute: typeof SettingsRouteRoute
}
+ '/settings/advanced': {
+ id: '/settings/advanced'
+ path: '/advanced'
+ fullPath: '/settings/advanced'
+ preLoaderRoute: typeof SettingsAdvancedRouteImport
+ parentRoute: typeof SettingsRouteRoute
+ }
'/settings/agents': {
id: '/settings/agents'
path: '/agents'
@@ -293,6 +336,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof SettingsAgentsRouteImport
parentRoute: typeof SettingsRouteRoute
}
+ '/settings/connected-apps': {
+ id: '/settings/connected-apps'
+ path: '/connected-apps'
+ fullPath: '/settings/connected-apps'
+ preLoaderRoute: typeof SettingsConnectedAppsRouteImport
+ parentRoute: typeof SettingsRouteRoute
+ }
'/settings/devices': {
id: '/settings/devices'
path: '/devices'
@@ -307,6 +357,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof SettingsExperimentsRouteImport
parentRoute: typeof SettingsRouteRoute
}
+ '/settings/general': {
+ id: '/settings/general'
+ path: '/general'
+ fullPath: '/settings/general'
+ preLoaderRoute: typeof SettingsGeneralRouteImport
+ parentRoute: typeof SettingsRouteRoute
+ }
'/spaces/': {
id: '/spaces/'
path: '/spaces'
@@ -333,17 +390,23 @@ declare module '@tanstack/react-router' {
interface SettingsRouteRouteChildren {
SettingsAboutRoute: typeof SettingsAboutRoute
+ SettingsAdvancedRoute: typeof SettingsAdvancedRoute
SettingsAgentsRoute: typeof SettingsAgentsRoute
+ SettingsConnectedAppsRoute: typeof SettingsConnectedAppsRoute
SettingsDevicesRoute: typeof SettingsDevicesRoute
SettingsExperimentsRoute: typeof SettingsExperimentsRoute
+ SettingsGeneralRoute: typeof SettingsGeneralRoute
SettingsIndexRoute: typeof SettingsIndexRoute
}
const SettingsRouteRouteChildren: SettingsRouteRouteChildren = {
SettingsAboutRoute: SettingsAboutRoute,
+ SettingsAdvancedRoute: SettingsAdvancedRoute,
SettingsAgentsRoute: SettingsAgentsRoute,
+ SettingsConnectedAppsRoute: SettingsConnectedAppsRoute,
SettingsDevicesRoute: SettingsDevicesRoute,
SettingsExperimentsRoute: SettingsExperimentsRoute,
+ SettingsGeneralRoute: SettingsGeneralRoute,
SettingsIndexRoute: SettingsIndexRoute,
}
diff --git a/apps/cua-spaces-web/src/routes/settings/about.tsx b/apps/cua-spaces-web/src/routes/settings/about.tsx
index df49525157..9a13c4a9d6 100644
--- a/apps/cua-spaces-web/src/routes/settings/about.tsx
+++ b/apps/cua-spaces-web/src/routes/settings/about.tsx
@@ -1,36 +1,38 @@
// SPDX-License-Identifier: FSL-1.1-MIT
// Copyright (c) 2026 Cua AI, Inc.
-import { createFileRoute } from "@tanstack/react-router";
-import { InfoIcon } from "lucide-react";
+import { createFileRoute, useNavigate } from "@tanstack/react-router";
+import { ChevronRightIcon } from "lucide-react";
import { useState } from "react";
-import { useAbout, useBridge, useSession, type AboutLink, type AboutUpdates, type UpdateChannel } from "@/bridge";
+import { useAbout, useBridge, useSession, useSettings, type AboutLink, type AboutUpdates } from "@/bridge";
+import { writeSavedOnboarding } from "@/bridge/onboarding";
import { aboutView } from "@/bridge/settings-derive";
-import { CuaLogo } from "@/components/cua-logo";
+import { SettingsGroup, SettingsRow } from "@/components/settings-group";
import { NoticesDialog } from "@/components/settings/notices-dialog";
import { Button } from "@/components/ui/button";
-import { Checkbox } from "@/components/ui/checkbox";
-import { Select } from "@/components/ui/select";
-import { toastError } from "@/components/ui/toast";
-import { Tooltip } from "@/components/ui/tooltip";
+import { Switch } from "@/components/ui/switch";
+import { toast, toastError } from "@/components/ui/toast";
+import { lastChecked } from "@/lib/settings-copy";
export const Route = createFileRoute("/settings/about")({ component: AboutPage });
/** What the update controls say in a build that can't update itself. */
-const UPDATES_UNAVAILABLE = "Updates aren\u2019t available in this build";
+const UPDATES_UNAVAILABLE = "Updates aren’t available in this build";
/**
- * Settings, About: the name and version, the links, the copyright, then the
- * update controls where the app updates itself. Everything shown is the
- * app core's `about::view`, as in the SwiftUI app's `AboutSettingsView`.
- * The Electron app keeps the controls in a build with no update feed (a
- * local build), greyed out, and says that this build doesn't update.
+ * Settings, About: the name and version (with Copy version), the links, then
+ * the update controls where the app updates itself, and the welcome again.
+ * Everything shown is the app core's `about::view`; the update channel
+ * (Beta) lives in Advanced. The Electron app keeps the controls in a build
+ * with no update feed (a local build), greyed out, and says so.
*/
function AboutPage() {
const { data, setAbout, checkNow } = useAbout();
const { openExternal } = useSession();
const { mode, core } = useBridge();
+ const navigate = useNavigate();
+ const { chooseSetting } = useSettings();
const [notices, setNotices] = useState(false);
const view = data?.view;
if (!view) return null;
@@ -40,106 +42,88 @@ function AboutPage() {
if (link.url) void openExternal(link.url).catch(toastError(`Couldn't open ${link.label}`));
else setNotices(true);
};
+ const copyVersion = () => {
+ void navigator.clipboard?.writeText(view.versionLine.replace(/^Version /, "")).then(() => toast("Version copied"));
+ };
+ const showWelcome = () => {
+ // The SwiftUI app shows its own welcome window; elsewhere it is this UI's first run, from the start.
+ if (mode === "webkit") return void chooseSetting("welcome", "show").catch(toastError("Couldn't show the welcome"));
+ writeSavedOnboarding(null);
+ void navigate({ to: "/onboarding" });
+ };
+ const updates = view.updates ?? (unavailable ? { ...unavailable, checkEnabled: false, lastCheck: UPDATES_UNAVAILABLE } : null);
return (
- <section className="rounded-xl border bg-card px-8 py-8 shadow-xs" data-about>
- <div className="flex flex-col items-center text-center">
- <CuaLogo className="size-14" />
- <h2 className="mt-4 text-[17px] font-semibold" data-about-title>
- {view.title}
- </h2>
- <p className="mt-1 text-[13px] text-muted-foreground select-text" data-about-version>
- {view.versionLine}
- </p>
- <div className="mt-5 flex flex-col items-center gap-1.5">
- {view.links.map((link) => (
- <button
- key={link.id}
- type="button"
- data-about-link={link.id}
- onClick={() => open(link)}
- className="text-[13px] text-brand-strong outline-none hover:underline focus-visible:underline"
- >
- {link.label}
- </button>
- ))}
- </div>
- <p className="mt-5 text-xs text-muted-foreground" data-about-copyright>
- {view.copyright}
- </p>
- </div>
- {view.updates ? (
- <UpdateControls
- updates={view.updates}
- canChange={data.canChange}
- onChange={(patch) => void setAbout(patch).catch(toastError("Couldn't change the update settings"))}
- onCheck={() => void checkNow().catch(toastError("Couldn't check for updates"))}
+ <div data-about="">
+ <SettingsGroup title="Cua Spaces">
+ <SettingsRow
+ label={<span data-about-title>{view.title}</span>}
+ description={
+ <span className="select-text" data-about-version>
+ {view.versionLine}
+ </span>
+ }
+ control={
+ <Button size="sm" variant="outline" onClick={copyVersion} data-about-copy-version>
+ Copy version
+ </Button>
+ }
/>
- ) : unavailable ? (
- <UpdateControls updates={{ ...unavailable, checkEnabled: false, lastCheck: UPDATES_UNAVAILABLE }} canChange={false} unavailable onChange={() => {}} onCheck={() => {}} />
- ) : null}
+ {view.links.map((link) => (
+ <button
+ key={link.id}
+ type="button"
+ data-about-link={link.id}
+ onClick={() => open(link)}
+ className="flex min-h-12 w-full items-center justify-between gap-6 px-4 py-2.5 text-left text-[13px] outline-none hover:bg-accent/50 focus-visible:bg-accent/50"
+ >
+ <span data-about-link-label="">{link.label}</span>
+ <span className="flex items-center text-xs text-muted-foreground">
+ Open <ChevronRightIcon className="size-3.5" />
+ </span>
+ </button>
+ ))}
+ </SettingsGroup>
+ <p className="-mt-4 mb-8 px-1 text-xs text-muted-foreground" data-about-copyright>
+ {view.copyright}
+ </p>
+
+ <SettingsGroup title="Updates">
+ {updates ? (
+ <div data-about-updates="" className="divide-y" {...(unavailable ? { "data-about-unavailable": "" } : {})}>
+ <UpdateRows
+ updates={updates}
+ canChange={data.canChange && !unavailable}
+ onChange={(on) => void setAbout({ autoCheck: on, autoInstall: on }).catch(toastError("Couldn't change the update settings"))}
+ onCheck={() => void checkNow().catch(toastError("Couldn't check for updates"))}
+ />
+ </div>
+ ) : null}
+ <SettingsRow label="Show the welcome again" control={<Button size="sm" variant="outline" onClick={showWelcome} data-about-welcome="">Show</Button>} />
+ </SettingsGroup>
<NoticesDialog open={notices} onOpenChange={setNotices} />
- </section>
+ </div>
);
}
-function UpdateControls({
- updates: u,
- canChange,
- unavailable = false,
- onChange,
- onCheck,
-}: {
- updates: AboutUpdates;
- canChange: boolean;
- /** This build can't update itself: every control greyed out, and why in place of the last check. */
- unavailable?: boolean;
- onChange: (patch: { autoCheck?: boolean; autoInstall?: boolean; channel?: UpdateChannel }) => void;
- onCheck: () => void;
-}) {
- const channel = (u.channels.find((c) => c.active)?.id ?? "stable") as UpdateChannel;
+/** "Keep Cua Spaces up to date": one switch for checking, downloading and installing when you quit. */
+function UpdateRows({ updates: u, canChange, onChange, onCheck }: { updates: AboutUpdates; canChange: boolean; onChange: (on: boolean) => void; onCheck: () => void }) {
return (
- <div className="mt-7 border-t pt-6" data-about-updates {...(unavailable ? { "data-about-unavailable": "" } : {})}>
- <div className="mx-auto grid w-fit grid-cols-[auto_auto] items-center gap-x-3 gap-y-3">
- <span />
- <label className="flex items-center gap-2 text-[13px]">
- <Checkbox checked={u.autoCheck} disabled={!canChange} onCheckedChange={(on) => onChange({ autoCheck: on })} data-about-auto-check />
- {u.autoCheckLabel}
- </label>
- <span />
- <label className="flex items-center gap-2 text-[13px]">
- <Checkbox
- checked={u.autoInstall}
- disabled={!canChange || !u.autoInstallEnabled}
- onCheckedChange={(on) => onChange({ autoInstall: on })}
- data-about-auto-install
- />
- <span className={u.autoInstallEnabled ? undefined : "text-muted-foreground"}>{u.autoInstallLabel}</span>
- </label>
- <span className="text-right text-[13px]">{u.channelLabel}</span>
- <span className="flex items-center gap-2">
- <Select
- aria-label={u.channelLabel}
- className="min-w-28"
- value={channel}
- disabled={!canChange}
- options={u.channels.map((c) => ({ value: c.id as UpdateChannel, label: c.label }))}
- onValueChange={(v) => onChange({ channel: v })}
- />
- <Tooltip content={<span className="block max-w-64">{u.channelHelp}</span>}>
- <InfoIcon className="size-4 text-muted-foreground" aria-label={u.channelHelp} />
- </Tooltip>
- </span>
- <span />
- <span className="flex items-center gap-3">
+ <>
+ <SettingsRow
+ label="Keep Cua Spaces up to date"
+ description="Updates download in the background and install when you quit."
+ htmlFor="about-auto-update"
+ control={<Switch id="about-auto-update" data-about-auto-check="" checked={u.autoCheck} disabled={!canChange} onCheckedChange={onChange} />}
+ />
+ <SettingsRow
+ label={<span data-about-last-check>{lastChecked(u.lastCheck)}</span>}
+ control={
<Button size="sm" variant="outline" disabled={!u.checkEnabled || !canChange} onClick={onCheck} data-about-check>
- {u.checkLabel}
+ Check now
</Button>
- <span className="text-xs text-muted-foreground" data-about-last-check>
- {u.lastCheck}
- </span>
- </span>
- </div>
- </div>
+ }
+ />
+ </>
);
}
diff --git a/apps/cua-spaces-web/src/routes/settings/advanced.tsx b/apps/cua-spaces-web/src/routes/settings/advanced.tsx
new file mode 100644
index 0000000000..d5d74b4e5c
--- /dev/null
+++ b/apps/cua-spaces-web/src/routes/settings/advanced.tsx
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+import { createFileRoute } from "@tanstack/react-router";
+
+import { AdvancedTab } from "@/components/settings/advanced-tab";
+
+export const Route = createFileRoute("/settings/advanced")({ component: AdvancedTab });
diff --git a/apps/cua-spaces-web/src/routes/settings/agents.tsx b/apps/cua-spaces-web/src/routes/settings/agents.tsx
index 158bbeec31..9e7666082e 100644
--- a/apps/cua-spaces-web/src/routes/settings/agents.tsx
+++ b/apps/cua-spaces-web/src/routes/settings/agents.tsx
@@ -1,127 +1,11 @@
// SPDX-License-Identifier: FSL-1.1-MIT
// Copyright (c) 2026 Cua AI, Inc.
-import { createFileRoute } from "@tanstack/react-router";
-import { KeyRoundIcon, TriangleAlertIcon } from "lucide-react";
-
-import { useAgentKeys, type AgentKeyRowView } from "@/bridge";
-import { KeySheet } from "@/components/agents/key-sheet";
-import { ConfirmDialog } from "@/components/ui/alert-dialog";
-import { Button } from "@/components/ui/button";
-import { toastError } from "@/components/ui/toast";
-import { addedText } from "@/lib/agent-keys";
-
-export const Route = createFileRoute("/settings/agents")({ component: AgentKeysPage });
-
-/**
- * Settings, Agents: the provider keys agents in your Spaces get. Anthropic
- * and OpenAI always have a row, other keys follow by variable name; Add or
- * Replace opens a sheet with a secure field (the key is never shown again),
- * Remove asks first. Every word is the app core's `agent_keys` view.
- */
-function AgentKeysPage() {
- // The keys also change outside the app (`cua agent keys`): read them again when this page shows
- // and whenever the window gets focus.
- const keys = useAgentKeys({ watch: true });
- const { view } = keys;
- if (keys.unsupported) return <p className="px-1 text-[13px] text-muted-foreground">Agent keys are not available in this app yet.</p>;
- if (keys.isLoading) return <p className="px-1 text-[13px] text-muted-foreground" data-agent-keys-loading>Loading agent keys…</p>;
- if (!view) return <p className="px-1 text-[13px] text-muted-foreground">Agent keys need the app core, which isn't loaded.</p>;
- const confirm = keys.removing ? keys.removeConfirmOf(keys.removing) : null;
-
- return (
- <div data-agent-keys>
- <p className="mb-4 px-1 text-[13px] text-muted-foreground" data-agent-keys-intro>
- {view.intro}
- </p>
- {view.notice ? (
- <div data-agent-keys-notice className="mb-5 flex items-start gap-2.5 rounded-xl border border-warning/30 bg-warning/5 px-4 py-2.5 text-[13px]">
- <TriangleAlertIcon className="mt-0.5 size-4 shrink-0 text-warning" />
- <span className="min-w-0 flex-1">{view.notice}</span>
- {keys.error ? (
- <Button size="sm" variant="outline" onClick={() => void keys.refresh()}>
- Try again
- </Button>
- ) : null}
- </div>
- ) : null}
-
- <section className="mb-7">
- <h2 className="mb-2 px-1 text-xs font-semibold text-muted-foreground" data-agent-keys-title>
- {view.title}
- </h2>
- <div className="divide-y overflow-hidden rounded-xl border bg-card shadow-xs">
- {view.rows.map((r) => (
- <KeyRow key={`${r.provider}:${r.env}`} row={r} addedLabel={view.addedLabel} canEdit={view.canEdit} onEdit={() => keys.openSheet(r.provider, r.provider === "other" ? r.env : null)} onRemove={() => keys.askRemove(r.env)} />
- ))}
- </div>
- <div className="mt-3 flex items-start gap-3 px-1">
- <Button size="sm" variant="outline" disabled={!view.canEdit} onClick={() => keys.openSheet("other")} data-agent-key-add-other>
- {view.addOtherLabel}
- </Button>
- <p className="pt-1 text-xs text-muted-foreground" data-agent-key-other-help>
- {view.otherHelp}
- </p>
- </div>
- </section>
-
- {keys.sheet ? <KeySheet key={`${keys.sheet.provider}:${keys.sheet.env ?? ""}`} keys={keys} provider={keys.sheet.provider} env={keys.sheet.env} /> : null}
- <ConfirmDialog
- open={confirm !== null}
- onOpenChange={(o) => !o && keys.askRemove(null)}
- title={confirm?.title ?? ""}
- description={confirm?.message ?? ""}
- confirmLabel={confirm?.confirmLabel ?? "Remove"}
- cancelLabel={confirm?.cancelLabel}
- destructive
- onConfirm={() => {
- const env = keys.removing;
- if (env) void keys.remove(env).catch(toastError("Couldn't remove the key"));
- }}
- />
- </div>
- );
-}
-
-function KeyRow({ row: r, addedLabel, canEdit, onEdit, onRemove }: { row: AgentKeyRowView; addedLabel: string; canEdit: boolean; onEdit: () => void; onRemove: () => void }) {
- return (
- <div data-agent-key-row={r.env} data-agent-key-provider={r.provider} data-set={String(r.set)} className="flex min-h-14 items-center gap-3 px-4 py-2.5">
- <KeyRoundIcon className="size-4 shrink-0 text-muted-foreground" strokeWidth={1.75} />
- <div className="min-w-0 flex-1">
- <div className="flex items-baseline gap-2">
- <span className="truncate text-[13px]" data-agent-key-title>
- {r.title}
- </span>
- {r.title !== r.env ? (
- <span className="truncate font-mono text-[11px] text-muted-foreground" data-agent-key-env>
- {r.env}
- </span>
- ) : null}
- </div>
- <div className="truncate text-xs text-muted-foreground" data-agent-key-detail>
- {r.detail}
- </div>
- </div>
- <div className="flex shrink-0 flex-col items-end">
- <span className={r.set ? "font-mono text-[12px]" : "text-[13px] text-muted-foreground"} data-agent-key-status>
- {r.status}
- </span>
- {r.addedMs !== null ? (
- <span className="text-[11px] text-muted-foreground" data-agent-key-added>
- {addedText(addedLabel, r.addedMs)}
- </span>
- ) : null}
- </div>
- <div className="flex shrink-0 items-center gap-1.5">
- <Button size="sm" variant="outline" disabled={!canEdit} onClick={onEdit} data-agent-key-action>
- {r.actionLabel}
- </Button>
- {r.removeLabel ? (
- <Button size="sm" variant="ghost" disabled={!canEdit} onClick={onRemove} data-agent-key-remove>
- {r.removeLabel}
- </Button>
- ) : null}
- </div>
- </div>
- );
-}
+import { createFileRoute, redirect } from "@tanstack/react-router";
+
+/** Settings, Agents became Connected apps. */
+export const Route = createFileRoute("/settings/agents")({
+ beforeLoad: () => {
+ throw redirect({ to: "/settings/connected-apps", replace: true });
+ },
+});
diff --git a/apps/cua-spaces-web/src/routes/settings/connected-apps.tsx b/apps/cua-spaces-web/src/routes/settings/connected-apps.tsx
new file mode 100644
index 0000000000..f7155d8478
--- /dev/null
+++ b/apps/cua-spaces-web/src/routes/settings/connected-apps.tsx
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+import { createFileRoute } from "@tanstack/react-router";
+import { useEffect } from "react";
+
+import { useAgentKeys, useCliInstall, useSettings } from "@/bridge";
+import { AccountKeysSection } from "@/components/settings/account-keys";
+import { CliSettingsSection } from "@/components/settings/cli-section";
+import { CodingAppsSection } from "@/components/settings/coding-apps-section";
+import { useQuiet } from "@/hooks/use-quiet";
+
+export const Route = createFileRoute("/settings/connected-apps")({ component: ConnectedAppsPage });
+
+/**
+ * Settings, Connected apps (was Agents): the coding apps Cua works with, the account keys they use, and Cua in Terminal.
+ * Its parts come from separate host reads; the page draws once they have answered, not one by one with the page jumping at each (CUA-1951).
+ */
+function ConnectedAppsPage() {
+ const { data, loadAgentRows } = useSettings();
+ // The apps are read here, before the page draws, so their rows are not what arrives late.
+ useEffect(() => {
+ void loadAgentRows().catch(() => {});
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- once per showing
+ }, []);
+ const keys = useAgentKeys({ watch: true });
+ const cli = useCliInstall();
+ const settled = useQuiet(`${data?.page?.sections.length ?? 0}|${data?.cli ? 1 : 0}|${keys.view?.rows.length ?? 0}|${cli.state.plan ? 1 : 0}|${data?.page?.sections.find((s) => s.id === "agents")?.rows.length ?? 0}`);
+ if (!settled) return <div className="h-96" aria-busy="true" />;
+ return (
+ <div data-settings-tab="connected-apps">
+ <CodingAppsSection />
+ <AccountKeysSection />
+ <CliSettingsSection />
+ </div>
+ );
+}
diff --git a/apps/cua-spaces-web/src/routes/settings/devices.tsx b/apps/cua-spaces-web/src/routes/settings/devices.tsx
index e64e077e51..1681605d91 100644
--- a/apps/cua-spaces-web/src/routes/settings/devices.tsx
+++ b/apps/cua-spaces-web/src/routes/settings/devices.tsx
@@ -13,6 +13,8 @@ import { Input } from "@/components/ui/input";
import { Menu } from "@/components/ui/menu";
import { deviceKind, devicesPageState, relativeText, rowDetail, thisDeviceText } from "@/lib/devices";
import { thisComputerLabel } from "@/lib/host-labels";
+import { plainDevice, plainDeviceSentence } from "@/lib/settings-copy";
+import { ScreenPermissionsSection } from "@/components/settings/screen-permissions-section";
import { cn } from "@/lib/utils";
export const Route = createFileRoute("/settings/devices")({ component: DevicesPage });
@@ -21,7 +23,7 @@ export const Route = createFileRoute("/settings/devices")({ component: DevicesPa
const SIGNED_OUT = "Sign in to Cua to see the devices that can reach your computers.";
/**
- * Settings, Devices: this device's enrollment, new machines to confirm, the
+ * Settings, Trusted devices: this computer's trust, new machines to confirm, the
* account's devices (Approve, Deny, Rename, Revoke) and Recent Access, then
* the enroll and approval sheets. Everything shown is the app core's
* `devices::devices_view`, as in the SwiftUI app's `DevicesSettingsView`.
@@ -50,8 +52,8 @@ function DevicesPage() {
const labels = v.labels;
return (
- <div data-devices>
- <Group title={labels.thisDevice}>
+ <div data-devices data-settings-tab="devices">
+ <Group title={plainDevice(labels.thisDevice)}>
<div className="flex min-h-12 items-center justify-between gap-4 px-4 py-2.5">
<div className="flex min-w-0 items-center gap-2.5">
<LaptopIcon className="size-4 shrink-0 text-muted-foreground" strokeWidth={1.75} />
@@ -62,11 +64,11 @@ function DevicesPage() {
</div>
<div className="flex shrink-0 items-center gap-2">
<span data-this-device-status={v.thisDevice.kind} className={cn("text-[13px]", v.thisDevice.kind === "enrolled" ? "text-muted-foreground" : "text-warning")}>
- {thisDeviceText(v.thisDevice)}
+ {plainDevice(thisDeviceText(v.thisDevice))}
</span>
{v.thisDevice.actionLabel ? (
<Button size="sm" variant="outline" onClick={devices.startEnroll} data-this-device-enroll>
- {v.thisDevice.actionLabel}
+ {plainDevice(v.thisDevice.actionLabel)}
</Button>
) : null}
</div>
@@ -75,13 +77,13 @@ function DevicesPage() {
// What it means, under the row (its one Enroll… is the row's), as
// the SwiftUI app's Devices settings have it.
<p data-devices-banner={v.banner.tone} className="px-4 py-2.5 text-xs text-muted-foreground">
- <span data-banner-text>{v.banner.text}</span>
+ <span data-banner-text>{plainDeviceSentence(v.banner.text)}</span>
</p>
) : null}
</Group>
{v.unconfirmedMachines.length > 0 ? (
- <Group title={labels.newMachines}>
+ <Group title={plainDevice(labels.newMachines)}>
{v.unconfirmedMachines.map((m) => (
<div key={m.id} data-unconfirmed-machine={m.id} className="flex min-h-11 items-center gap-2.5 px-4 py-2">
<CircleHelpIcon className="size-4 shrink-0 text-warning" />
@@ -95,7 +97,7 @@ function DevicesPage() {
) : null}
{v.rows.length > 0 ? (
- <Group title={labels.devices}>
+ <Group title={plainDevice(labels.devices)}>
{v.rows.map((r) => (
<DeviceLine
key={r.id}
@@ -112,8 +114,8 @@ function DevicesPage() {
</Group>
) : null}
- <Group title={labels.recent} data-recent>
- {v.recent.length === 0 ? <div className="px-4 py-3 text-[13px] text-muted-foreground">{labels.recentEmpty}</div> : null}
+ <Group title={plainDevice(labels.recent)} data-recent>
+ {v.recent.length === 0 ? <div className="px-4 py-3 text-[13px] text-muted-foreground">{plainDevice(labels.recentEmpty)}</div> : null}
{v.recent.map((a, i) => (
<div key={`${a.ts}-${i}`} data-recent-row className="flex min-h-10 items-center justify-between gap-4 px-4 py-2">
<span className="flex min-w-0 items-center gap-2 text-[13px]">
@@ -123,7 +125,7 @@ function DevicesPage() {
</span>
) : null}
<span className="truncate" data-recent-text>
- {a.text}
+ {plainDeviceSentence(a.text)}
</span>
</span>
<span className="shrink-0 text-xs text-muted-foreground">{relativeText(a.ts, data.now)}</span>
@@ -135,29 +137,31 @@ function DevicesPage() {
{data.input.readError && v.thisDevice.kind === "enrolled" ? (
// The relay refused to list them (this device is not enrolled):
// its words, under the page, as the SwiftUI app shows them.
- <p data-devices-read-error className="-mt-4 mb-7 px-1 text-xs break-words text-destructive">
+ <p data-devices-read-error className="-mt-4 mb-8 px-1 text-xs break-words text-destructive">
{data.input.readError}
</p>
) : null}
{data.actionError ? <p className="-mt-4 px-1 text-xs text-destructive">{data.actionError}</p> : null}
+ <ScreenPermissionsSection />
+
<EnrollSheet />
<ApproveSheet />
<RenameDialog row={renaming} labels={labels} onClose={() => setRenaming(null)} onRename={(name) => renaming && void devices.rename(renaming.id, name)} />
<ConfirmDialog
open={revoking?.revokeConfirm != null}
onOpenChange={(o) => !o && setRevoking(null)}
- title={revoking?.revokeConfirm?.title ?? ""}
- description={revoking?.revokeConfirm?.message ?? ""}
- confirmLabel={revoking?.revokeConfirm?.confirmLabel ?? labels.revoke}
+ title={plainDeviceSentence(revoking?.revokeConfirm?.title ?? "")}
+ description={plainDeviceSentence(revoking?.revokeConfirm?.message ?? "")}
+ confirmLabel={plainDevice(revoking?.revokeConfirm?.confirmLabel ?? labels.revoke)}
destructive
onConfirm={() => revoking && void devices.revoke(revoking.id)}
/>
<ConfirmDialog
open={confirming !== null}
onOpenChange={(o) => !o && setConfirming(null)}
- title={confirming?.confirm.title ?? ""}
- description={confirming?.confirm.message ?? ""}
+ title={plainDeviceSentence(confirming?.confirm.title ?? "")}
+ description={plainDeviceSentence(confirming?.confirm.message ?? "")}
confirmLabel={confirming?.confirm.confirmLabel ?? labels.confirmMachine}
onConfirm={() => confirming && void devices.confirmMachine(confirming.id)}
/>
@@ -188,7 +192,7 @@ function Retry({ children, onRetry, ...rest }: { children: React.ReactNode; onRe
function Group({ title, children, ...rest }: { title: string; children: React.ReactNode } & Record<`data-${string}`, unknown>) {
return (
- <section className="mb-7" {...rest}>
+ <section className="mb-8" {...rest}>
<h2 className="mb-2 px-1 text-xs font-semibold text-muted-foreground">{title}</h2>
<div className="divide-y overflow-hidden rounded-xl border bg-card shadow-xs">{children}</div>
</section>
@@ -219,7 +223,7 @@ function DeviceLine({
const Icon = ICONS[deviceKind(r.platform)];
const menu = [
...(r.actions.includes("rename") ? [{ label: labels.rename, onSelect: onRename }] : []),
- ...(r.actions.includes("revoke") ? [{ label: labels.revoke, onSelect: onRevoke, destructive: true }] : []),
+ ...(r.actions.includes("revoke") ? [{ label: plainDevice(labels.revoke), onSelect: onRevoke, destructive: true }] : []),
];
return (
<div data-device-row={r.id} className="flex min-h-14 items-center gap-3 px-4 py-2.5">
@@ -229,7 +233,7 @@ function DeviceLine({
{r.title}
</div>
<div className="truncate text-xs text-muted-foreground" data-device-detail>
- {rowDetail(r, labels, now)}
+ {plainDevice(rowDetail(r, labels, now))}
</div>
</div>
{r.actions.includes("approve") ? (
@@ -267,9 +271,9 @@ function EnrollSheet() {
<>
<div className="px-5 pt-5 pb-4">
<DialogTitle className="text-[15px] font-semibold" data-enroll-title>
- {v.title}
+ {plainDeviceSentence(v.title)}
</DialogTitle>
- <p className="mt-1.5 text-[13px] text-muted-foreground">{v.lede}</p>
+ <p className="mt-1.5 text-[13px] text-muted-foreground">{plainDeviceSentence(v.lede)}</p>
{v.options.length > 0 ? (
<div className="mt-4 flex flex-col gap-2">
{v.options.map((o) => (
@@ -282,8 +286,8 @@ function EnrollSheet() {
>
{o.method === "sign-in" ? <UserRoundIcon className="size-5 text-muted-foreground" /> : <HashIcon className="size-5 text-muted-foreground" />}
<span className="min-w-0">
- <span className="block text-[13px] font-medium">{o.title}</span>
- <span className="block text-xs text-muted-foreground">{o.detail}</span>
+ <span className="block text-[13px] font-medium">{plainDeviceSentence(o.title)}</span>
+ <span className="block text-xs text-muted-foreground">{plainDeviceSentence(o.detail)}</span>
</span>
</button>
))}
@@ -340,10 +344,10 @@ function ApproveSheet() {
>
<div className="px-5 pt-5 pb-4">
<DialogTitle className="text-[15px] font-semibold" data-approve-title>
- {v.title}
+ {plainDeviceSentence(v.title)}
</DialogTitle>
<p className="mt-1.5 text-[13px] text-muted-foreground" data-approve-message>
- {v.message}
+ {plainDeviceSentence(v.message)}
</p>
{v.needsCode ? (
<Input
diff --git a/apps/cua-spaces-web/src/routes/settings/experiments.tsx b/apps/cua-spaces-web/src/routes/settings/experiments.tsx
index f72d87c99d..5787d2ac0c 100644
--- a/apps/cua-spaces-web/src/routes/settings/experiments.tsx
+++ b/apps/cua-spaces-web/src/routes/settings/experiments.tsx
@@ -1,34 +1,11 @@
// SPDX-License-Identifier: FSL-1.1-MIT
// Copyright (c) 2026 Cua AI, Inc.
-import { createFileRoute } from "@tanstack/react-router";
-
-import { useBridge, useExperiments } from "@/bridge";
-import { CoreSettingsSection } from "@/components/settings/core-section";
-import { toastError } from "@/components/ui/toast";
-
-export const Route = createFileRoute("/settings/experiments")({ component: ExperimentsPage });
-
-/** "Use classic UI" switches the SwiftUI app between its native window and this UI: the Electron app is only this UI, so it has no such switch. */
-const WEB_UI_ROWS = new Set(["experiment:classic_ui", "experiment:classic_ui-note", "experiment:web_ui", "experiment:web_ui-note"]);
-
-/**
- * Settings, Experiments: one switch per experiment with its one line
- * (`experiments::page`), and "Use classic UI" on the Mac. Off only hides an experiment's
- * entry points; nothing set up is undone.
- */
-function ExperimentsPage() {
- const { data, unsupported, isLoading, chooseExperiment } = useExperiments();
- const { mode } = useBridge();
- if (unsupported) return <p className="px-1 text-[13px] text-muted-foreground">Experiments are not available in this app yet.</p>;
- if (isLoading || !data?.page) return null;
- const shown = (id: string) => mode !== "electron" || !WEB_UI_ROWS.has(id);
- return data.page.sections.map((section) => (
- <CoreSettingsSection
- key={section.id}
- section={{ ...section, rows: section.rows.filter((r) => shown(r.id)) }}
- foldNotes
- onChoose={(row, option) => void chooseExperiment(row.id, option).catch(toastError("Couldn't change the experiment"))}
- />
- ));
-}
+import { createFileRoute, redirect } from "@tanstack/react-router";
+
+/** Settings, Experiments folded into Advanced. */
+export const Route = createFileRoute("/settings/experiments")({
+ beforeLoad: () => {
+ throw redirect({ to: "/settings/advanced", replace: true });
+ },
+});
diff --git a/apps/cua-spaces-web/src/routes/settings/general.tsx b/apps/cua-spaces-web/src/routes/settings/general.tsx
new file mode 100644
index 0000000000..1d2214dc4d
--- /dev/null
+++ b/apps/cua-spaces-web/src/routes/settings/general.tsx
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+import { createFileRoute } from "@tanstack/react-router";
+
+import { GeneralTab } from "@/components/settings/general-tab";
+
+export const Route = createFileRoute("/settings/general")({ component: GeneralTab });
diff --git a/apps/cua-spaces-web/src/routes/settings/index.tsx b/apps/cua-spaces-web/src/routes/settings/index.tsx
index 71b7da91d8..68ac9f60b0 100644
--- a/apps/cua-spaces-web/src/routes/settings/index.tsx
+++ b/apps/cua-spaces-web/src/routes/settings/index.tsx
@@ -1,412 +1,8 @@
// SPDX-License-Identifier: FSL-1.1-MIT
// Copyright (c) 2026 Cua AI, Inc.
-import { createFileRoute, useNavigate } from "@tanstack/react-router";
-import { MonitorIcon, MoonIcon, SunIcon } from "lucide-react";
+import { createFileRoute } from "@tanstack/react-router";
-import {
- useBridge,
- useExperiments,
- useLoginItem,
- useMachines,
- useRelayUsage,
- useRelayUsageView,
- useTrackPlanClick,
- useSession,
- useSettings,
- useStorageSettings,
- type SettingsPage as CorePage,
- type SettingsRow as CoreRow,
- type SettingsSection as CoreSection,
- type GlobalShortcut,
-} from "@/bridge";
-import { writeSavedOnboarding } from "@/bridge/onboarding";
-import { SettingsGroup, SettingsRow } from "@/components/settings-group";
-import { AdvancedSection } from "@/components/settings/advanced-section";
-import { AgentsSettingsSection } from "@/components/settings/agents-section";
-import { CliSettingsSection } from "@/components/settings/cli-section";
-import { ScreenPermissionsSection } from "@/components/settings/screen-permissions-section";
-import { SharedLinks } from "@/components/links/shared-links";
-import { CoreSettingsRow, CoreSettingsSection } from "@/components/settings/core-section";
-import { Button } from "@/components/ui/button";
-import { Shortcut } from "@/components/ui/kbd";
-import { Segmented } from "@/components/ui/segmented";
-import { Select } from "@/components/ui/select";
-import { Switch } from "@/components/ui/switch";
-import { lazy, Suspense } from "react";
-import { toastError } from "@/components/ui/toast";
-import { globalShortcutLine, showsMacShellSettings, thisComputerLabel } from "@/lib/host-labels";
-import { keyvaultRows } from "@/lib/keyvault";
-import { DEFAULT_KEYBINDINGS, type KeybindingCommand } from "@/lib/keybindings";
-import { useTheme, type ThemePreference } from "@/lib/theme";
+import { AccountTab } from "@/components/settings/account-tab";
-export const Route = createFileRoute("/settings/")({ component: SettingsPage });
-
-// Its miniature and setup load with the card.
-const DriverSettingsCard = lazy(() => import("@/components/volume/driver-card").then((m) => ({ default: m.DriverSettingsCard })));
-
-const COMMAND_LABEL: Record<KeybindingCommand, string> = {
- "commandPalette.toggle": "Open command palette",
- "sidebar.toggle": "Show or hide sidebar",
- "nav.spaces": "Go to Spaces",
- "nav.machines": "Go to Computers",
- "nav.agents": "Go to Agents",
- "nav.keyvault": "Go to Keyvault",
- "nav.settings": "Open Settings",
- "theme.cycle": "Cycle appearance",
-};
-
-const APPEARANCE: { value: ThemePreference; label: React.ReactNode }[] = [
- { value: "system", label: <><MonitorIcon className="size-3.5" /> System</> },
- { value: "light", label: <><SunIcon className="size-3.5" /> Light</> },
- { value: "dark", label: <><MoonIcon className="size-3.5" /> Dark</> },
-];
-
-const fail = toastError;
-
-/** Settings, General: the core's page as the SwiftUI app draws it when the
- * core is loaded (Account, Teams, General, Runtimes, Privacy, the
- * Keyvault, AI agents), with this UI's own rows (appearance, keyboard shortcuts);
- * without the core, the same settings drawn by hand. */
-function SettingsPage() {
- const { data: settings, isLoading } = useSettings();
- // Not the hand-drawn fallback while the host's answer is still on its way: it would be replaced by the core's page, and everything would move.
- if (isLoading && !settings) return null;
- return settings?.page ? <CoreGeneralPage page={settings.page} /> : <FallbackSettingsPage />;
-}
-
-function CoreGeneralPage({ page }: { page: CorePage }) {
- const { data: settings, updateSetting, chooseSetting } = useSettings();
- const { signIn, signOut, cancelSignIn, openExternal } = useSession();
- const { mode } = useBridge();
- const navigate = useNavigate();
- const { preference, setPreference } = useTheme();
- const section = (id: string): CoreSection | undefined => page.sections.find((x) => x.id === id);
- const account = section("account");
- const teams = section("teams");
- const general = section("general");
- const runtimes = section("runtimes");
- const privacy = section("privacy");
- const keyvault = section("keyvault");
- const agents = section("agents");
- const keyvaultShown = keyvault && { ...keyvault, rows: keyvaultRows(keyvault.rows, settings?.hostSettings) };
- const mac = showsMacShellSettings();
-
- // What a row's choice changes: the settings every host has by key, the
- // host's own (runtimes, auto-connect, the Keyvault's switches) by row.
- const choose = (row: CoreRow, option: string) => {
- const done = fail(`Couldn't change ${row.label}`);
- switch (row.id) {
- case "notch":
- return void updateSetting("menuBar", option === "hide").catch(done);
- case "telemetry":
- return void updateSetting("telemetry", option === "on").catch(done);
- case "default-location":
- return void updateSetting("defaultLocation", option).catch(done);
- default:
- return void chooseSetting(row.id, option).catch(done);
- }
- };
- // What a row's button does, as the SwiftUI app's `AppModel.press`.
- const press = (row: CoreRow) => {
- switch (row.id) {
- case "account":
- return void signOut().catch(fail("Couldn't sign out"));
- case "sign-in":
- return void signIn().catch(fail("Couldn't start sign-in"));
- case "sign-in-code":
- return cancelSignIn();
- // The account app (app.cua.ai): invites, roles and plans, billing.
- case "teams-manage":
- case "teams-billing":
- case "billing":
- return row.linkUrl ? void openExternal(row.linkUrl) : undefined;
- case "welcome":
- // The SwiftUI app shows its own welcome window; elsewhere it is
- // this UI's first run, from the start.
- if (mode === "webkit") return void chooseSetting("welcome", "show").catch(fail("Couldn't show the welcome"));
- writeSavedOnboarding(null);
- return void navigate({ to: "/onboarding" });
- }
- };
- const rows = (s: CoreSection, skip: (r: CoreRow) => boolean = () => false) =>
- s.rows.filter((r) => !skip(r)).map((r) => <CoreSettingsRow key={r.id} row={r} onChoose={choose} onPress={press} />);
-
- return (
- <>
- {account ? (
- <SettingsGroup title={account.title}>
- {rows(account)}
- <RelayUsageRow />
- </SettingsGroup>
- ) : null}
-
- {teams ? (
- <SettingsGroup title={teams.title}>
- {rows(teams)}
- </SettingsGroup>
- ) : null}
-
- <SettingsGroup title={general?.title ?? "General"}>
- <LaunchAtLoginRows />
- {/* The notch is the macOS app's. */}
- {general ? rows(general, (r) => r.id === "notch" && !mac) : null}
- <SettingsRow label="Appearance" control={<Segmented aria-label="Appearance" value={preference} options={APPEARANCE} onValueChange={setPreference} />} />
- <GlobalShortcutRow shortcut={settings?.globalShortcut} />
- </SettingsGroup>
-
- <ScreenPermissionsSection />
-
- <StorageSection />
-
- {runtimes?.rows.length ? <CoreSettingsSection section={runtimes} foldNotes onChoose={choose} /> : null}
- {privacy ? <CoreSettingsSection section={privacy} onChoose={choose} onPress={press} /> : null}
- {keyvaultShown?.rows.length ? <CoreSettingsSection section={keyvaultShown} foldNotes onChoose={choose} /> : null}
-
- {agents ? <AgentsSettingsSection section={agents} /> : null}
-
- <CliSettingsSection />
-
- {/* The cua-driver skill for every agent (the SwiftUI app offers it in its first run). */}
- <SettingsGroup title="Background computer use">
- <Suspense fallback={<div className="h-48" />}>
- <DriverSettingsCard />
- </Suspense>
- </SettingsGroup>
-
- <SharedLinks />
-
- <SettingsGroup title="Keyboard shortcuts">
- {DEFAULT_KEYBINDINGS.map((b) => (
- <SettingsRow key={b.command} label={COMMAND_LABEL[b.command]} control={<Shortcut spec={b.key} />} />
- ))}
- </SettingsGroup>
-
- <AdvancedSection />
- </>
- );
-}
-
-/** The host's global shortcut (the macOS hosts register one), and whether the system gave it. */
-function GlobalShortcutRow({ shortcut }: { shortcut: GlobalShortcut | null | undefined }) {
- if (!shortcut) return null;
- return (
- <div data-global-shortcut={shortcut.registered ? "registered" : "taken"}>
- <SettingsRow
- label="Global shortcut"
- description={globalShortcutLine(shortcut)}
- control={<span className="text-[13px] text-muted-foreground">{shortcut.label}</span>}
- />
- </div>
- );
-}
-
-/** One bar of the usage meter: `used` of `limit` (no bar without a limit). */
-function UsageMeter({ label, used, limit }: { label: string; used: number; limit: number | null }) {
- if (!limit || limit <= 0) return null;
- const share = Math.min(1, used / limit);
- return (
- <div
- role="meter"
- aria-label={label}
- aria-valuemin={0}
- aria-valuemax={limit}
- aria-valuenow={Math.min(used, limit)}
- data-usage-meter={label}
- data-full={used >= limit ? "" : undefined}
- className="h-1.5 w-full overflow-hidden rounded-full bg-muted"
- >
- <div className={used >= limit ? "h-full bg-destructive" : "h-full bg-brand-strong"} style={{ width: `${Math.round(share * 100)}%` }} />
- </div>
- );
-}
-
-/** The plan and remote use this month (the core's words), where the host reads it. */
-function RelayUsageRow() {
- const view = useRelayUsageView();
- const usage = useRelayUsage();
- const { openExternal } = useSession();
- const trackClick = useTrackPlanClick();
- if (!view) return null;
- const { planCard: card } = view;
- const open = (url: string) => {
- trackClick("plan_card");
- void openExternal(url).catch(() => {});
- };
- return (
- <>
- <div data-relay-usage="">
- <SettingsRow label={view.label} description={view.line} control={<span className="text-[13px] text-muted-foreground">{view.plan}</span>} />
- {usage ? (
- <div className="flex flex-col gap-2 px-4 pb-3">
- <UsageMeter label="Live sessions" used={usage.liveSessions} limit={usage.liveSessionsLimit} />
- <UsageMeter label="Remote hours" used={usage.hoursUsed} limit={usage.hoursLimit} />
- </div>
- ) : null}
- </div>
- <div data-plan-card={card.plan} className="flex items-center gap-3 px-4 py-3">
- <div className="min-w-0 flex-1">
- <div className="text-[13px] font-medium">{card.label}</div>
- <div className="mt-0.5 text-xs text-muted-foreground">{card.detail}</div>
- </div>
- {card.secondary ? (
- <Button size="sm" variant="ghost" data-plan-secondary="" onClick={() => open(card.secondary!.url)}>
- {card.secondary.label}
- </Button>
- ) : null}
- {card.primary ? (
- <Button size="sm" variant={card.plan === "free" ? "default" : "outline"} data-plan-primary="" onClick={() => open(card.primary!.url)}>
- {card.primary.label}
- </Button>
- ) : null}
- </div>
- </>
- );
-}
-
-/** Without the core: the settings every host has, drawn by hand. */
-function FallbackSettingsPage() {
- const { data: settings, updateSetting } = useSettings();
- const { data: machines = [] } = useMachines();
- const { data: session, signIn, signOut } = useSession();
- const { preference, setPreference } = useTheme();
-
- const values = settings?.values;
- const locationOptions = [
- { value: "local", label: thisComputerLabel() },
- ...machines.filter((m) => !m.current).map((m) => ({ value: `host:${m.id}`, label: m.name })),
- ];
- const location = values?.defaultLocation ?? "local";
- if (!locationOptions.some((o) => o.value === location)) locationOptions.push({ value: location, label: location });
- const locationLocked = settings?.defaultLocation?.source === "env";
-
- return (
- <>
- <SettingsGroup title="General">
- <LaunchAtLoginRows />
- <SettingsRow label="Appearance" control={<Segmented aria-label="Appearance" value={preference} options={APPEARANCE} onValueChange={setPreference} />} />
- {showsMacShellSettings() ? (
- <SettingsRow
- label="Show in menu bar"
- description="Open Cua Spaces from the menu bar instead of the notch."
- htmlFor="menuBar"
- control={
- <Switch
- id="menuBar"
- checked={values?.menuBar ?? false}
- disabled={!values}
- onCheckedChange={(on) => void updateSetting("menuBar", on).catch(fail("Couldn't change the menu bar setting"))}
- />
- }
- />
- ) : null}
- <GlobalShortcutRow shortcut={settings?.globalShortcut} />
- </SettingsGroup>
-
- <ScreenPermissionsSection />
-
- <StorageSection />
-
- <SettingsGroup title="Spaces">
- <SettingsRow
- label="New Spaces start on"
- description={locationLocked ? `Set by ${settings?.defaultLocation?.env ?? "the environment"}.` : "You can pick another place when you create one."}
- control={
- <Select
- aria-label="New Spaces start on"
- value={location}
- options={locationOptions}
- onValueChange={(v) => void updateSetting("defaultLocation", v).catch(fail("Couldn't change the default location"))}
- />
- }
- />
- </SettingsGroup>
-
- <SettingsGroup title="AI agents">
- <Suspense fallback={<div className="h-48" />}>
- <DriverSettingsCard />
- </Suspense>
- </SettingsGroup>
-
- <SettingsGroup title="Account">
- <SettingsRow
- label={session?.signedIn ? (session.identity ?? "Signed in") : "Not signed in"}
- description={session?.signIn.kind === "waiting" ? "Finish signing in from your browser." : session?.signIn.kind === "failed" ? session.signIn.message : undefined}
- control={
- session?.signedIn ? (
- <Button variant="outline" size="sm" onClick={() => void signOut().catch(fail("Couldn't sign out"))}>
- Sign out
- </Button>
- ) : (
- <Button variant="outline" size="sm" disabled={!session} onClick={() => void signIn().catch(fail("Couldn't start sign-in"))}>
- Sign in
- </Button>
- )
- }
- />
- <RelayUsageRow />
- </SettingsGroup>
-
- <SettingsGroup title="Privacy">
- <SettingsRow
- label="Share usage data to help improve Cua"
- description="Which features you use and when something goes wrong. Linked to your account through a random ID while you're signed in. Never your files, what you type or your screen."
- htmlFor="telemetry"
- control={
- <Switch
- id="telemetry"
- checked={values?.telemetry ?? false}
- disabled={!values}
- onCheckedChange={(on) => void updateSetting("telemetry", on).catch(fail("Couldn't change telemetry"))}
- />
- }
- />
- </SettingsGroup>
-
- <SettingsGroup title="Keyboard shortcuts">
- {DEFAULT_KEYBINDINGS.map((b) => (
- <SettingsRow key={b.command} label={COMMAND_LABEL[b.command]} control={<Shortcut spec={b.key} />} />
- ))}
- </SettingsGroup>
- </>
- );
-}
-
-/**
- * Launch at login as the app core lays it out (`login_item::rows_with`): the
- * switch shows what the system reports, never what was asked, and the line
- * under it says what turning it off stops, or where to approve it.
- */
-function LaunchAtLoginRows() {
- const { data, setLaunchAtLogin, openLoginItems } = useLoginItem();
- if (!data?.rows) return null;
- return data.rows.map((row) => (
- <CoreSettingsRow
- key={row.id}
- row={row}
- onChoose={(_, option) => void setLaunchAtLogin(option === "on")}
- onPress={() => void openLoginItems().catch(fail("Couldn't open Login Items"))}
- />
- ));
-}
-
-/** Settings, Storage: after General, only with the Cua Volume experiment on (`settings.withStorage`). */
-function StorageSection() {
- const { data: experiments } = useExperiments();
- if (!experiments?.experiments.cuaVolume) return null;
- return <StorageSectionBody />;
-}
-
-function StorageSectionBody() {
- const { data, press, choose, edit, save } = useStorageSettings();
- if (!data?.section) return null;
- return (
- <CoreSettingsSection
- section={data.section}
- onHeaderButton={save}
- onPress={(r) => press(r.id)}
- onChoose={(r, option) => choose(r.id, option)}
- onEdit={(r, value) => edit(r.id, value)}
- />
- );
-}
+export const Route = createFileRoute("/settings/")({ component: AccountTab });
diff --git a/apps/cua-spaces-web/src/routes/settings/route.tsx b/apps/cua-spaces-web/src/routes/settings/route.tsx
index 394ab9f795..2da20aa4ca 100644
--- a/apps/cua-spaces-web/src/routes/settings/route.tsx
+++ b/apps/cua-spaces-web/src/routes/settings/route.tsx
@@ -1,32 +1,35 @@
// SPDX-License-Identifier: FSL-1.1-MIT
// Copyright (c) 2026 Cua AI, Inc.
-import { createFileRoute, Link, Outlet } from "@tanstack/react-router";
+import { createFileRoute, Link, Outlet, useRouterState } from "@tanstack/react-router";
import { Page, PageHeader } from "@/components/page";
+import { SETTINGS_TABS } from "@/lib/settings-tabs";
export const Route = createFileRoute("/settings")({ component: SettingsLayout });
-/** The native Settings window's tabs: General, Agents, Devices, Experiments, About. */
-const TABS = [
- { to: "/settings", label: "General", exact: true },
- { to: "/settings/agents", label: "Agents", exact: false },
- { to: "/settings/devices", label: "Devices", exact: false },
- { to: "/settings/experiments", label: "Experiments", exact: false },
- { to: "/settings/about", label: "About", exact: false },
-] as const;
+/** The tab whose page is showing: Account is exactly `/settings`, the rest also own their sub-paths. */
+function isActiveTab(pathname: string, t: (typeof SETTINGS_TABS)[number]) {
+ const path = pathname.replace(/\/+$/, "") || "/";
+ return t.exact ? path === t.to : path === t.to || path.startsWith(`${t.to}/`);
+}
function SettingsLayout() {
+ const pathname = useRouterState({ select: (s) => s.location.pathname });
return (
- <Page className="max-w-2xl">
+ // 32px under the top bar, 32px between sections, 48px rows (the agreed Settings rhythm).
+ <Page className="max-w-2xl pt-8">
<PageHeader title="Settings" />
- <nav aria-label="Settings" className="mb-6 inline-flex h-8 items-center gap-0.5 rounded-lg bg-muted p-0.5">
- {TABS.map((t) => (
+ <nav aria-label="Settings" role="tablist" className="mb-8 inline-flex h-12 items-center gap-0.5 rounded-xl bg-muted p-1">
+ {SETTINGS_TABS.map((t) => (
<Link
key={t.to}
to={t.to}
+ role="tab"
+ // Link's own active state (data-status) can't tell Account's "/settings" from its siblings under it.
+ aria-selected={isActiveTab(pathname, t)}
activeOptions={{ exact: t.exact }}
- className="inline-flex h-7 items-center rounded-md px-3 text-[13px] font-medium text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/60 data-[status=active]:bg-card data-[status=active]:text-foreground data-[status=active]:shadow-xs dark:data-[status=active]:bg-accent"
+ className="inline-flex h-10 items-center rounded-lg px-3.5 text-[13px] font-medium text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/60 aria-selected:bg-card aria-selected:text-foreground aria-selected:shadow-xs dark:aria-selected:bg-accent"
>
{t.label}
</Link>
diff --git a/apps/cua-spaces-web/src/routes/volume/index.tsx b/apps/cua-spaces-web/src/routes/volume/index.tsx
index ec49342c8a..4bfbd4d8e2 100644
--- a/apps/cua-spaces-web/src/routes/volume/index.tsx
+++ b/apps/cua-spaces-web/src/routes/volume/index.tsx
@@ -7,6 +7,7 @@ import type { ReactNode } from "react";
import { useExperimentFlags, useVolume, useVolumePins, type ConflictView, type DriveAction, type LineView } from "@/bridge";
import { EmptyState, Page, PageHeader } from "@/components/page";
+import { StorageSection } from "@/components/settings/storage-section";
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { volumeUnavailableNote } from "@/lib/volume-notes";
@@ -28,7 +29,7 @@ function VolumePage() {
<Page className="max-w-3xl">
<PageHeader title="Volume" />
<EmptyState icon={<HardDriveIcon />} title="Cua Volume is off">
- It's an experiment for now. Turn it on in Settings, Experiments.
+ It's an experiment for now. Turn it on in Settings, Advanced.
</EmptyState>
</Page>
);
@@ -149,6 +150,8 @@ function VolumeBody() {
{view.error}
</p>
) : null}
+
+ <StorageSection />
</div>
</Page>
);
diff --git a/libs/cua/crates/cua-spaces-app-core/src/settings.rs b/libs/cua/crates/cua-spaces-app-core/src/settings.rs
index b25ccce86f..ff818cd0e2 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/settings.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/settings.rs
@@ -137,9 +137,15 @@ fn migrations_path(path: &Path) -> std::path::PathBuf {
path.with_file_name("settings-migrations.json")
}
-/// Defaults that turned on after releases saved them as off. Each one has a
-/// key in the migration marker.
-const MIGRATIONS: [&str; 2] = ["sharingDefaultOn", "yourCloudDefaultOn"];
+/// Defaults that turned on after releases saved them as off, and switches
+/// that were retired (Settings, Advanced no longer has a Sharing or a Your
+/// cloud switch). Each one has a key in the migration marker.
+const MIGRATIONS: [&str; 4] = [
+ "sharingDefaultOn",
+ "yourCloudDefaultOn",
+ "sharingSwitchRetired",
+ "yourCloudSwitchRetired",
+];
/// Sharing became on by default in 0.9.1 (CUA-1668) and Your cloud later
/// (a linked cloud showed under Run on only after digging into Settings).
@@ -160,8 +166,13 @@ fn migrate_defaults(path: &Path, s: &mut AppSettings) {
if !MIGRATIONS.iter().any(|k| pending(k)) {
return;
}
- let turn_sharing_on = pending(MIGRATIONS[0]) && !s.experiments.sharing;
- let turn_cloud_on = pending(MIGRATIONS[1]) && !s.experiments.your_cloud;
+ // The retired switches: with no switch to turn them back on, a stored
+ // `false` (a choice nobody can make or undo any more) reads as on, once.
+ // The plan decides who can share or use a cloud, on the server.
+ let turn_sharing_on =
+ (pending(MIGRATIONS[0]) || pending(MIGRATIONS[2])) && !s.experiments.sharing;
+ let turn_cloud_on =
+ (pending(MIGRATIONS[1]) || pending(MIGRATIONS[3])) && !s.experiments.your_cloud;
if turn_sharing_on || turn_cloud_on {
s.experiments.sharing |= turn_sharing_on;
s.experiments.your_cloud |= turn_cloud_on;
@@ -1560,7 +1571,7 @@ mod tests {
std::fs::write(&path, r#"{"experiments":{"cuaVolume":true}}"#).unwrap();
std::fs::write(
path.with_file_name("settings-migrations.json"),
- r#"{"sharingDefaultOn":true}"#,
+ r#"{"sharingDefaultOn":true,"sharingSwitchRetired":true}"#,
)
.unwrap();
assert!(load(&path).experiments.your_cloud, "never set reads as on");
@@ -1572,7 +1583,7 @@ mod tests {
std::fs::remove_file(path.with_file_name("settings-migrations.json")).unwrap();
std::fs::write(
path.with_file_name("settings-migrations.json"),
- r#"{"sharingDefaultOn":true}"#,
+ r#"{"sharingDefaultOn":true,"sharingSwitchRetired":true}"#,
)
.unwrap();
let s = load(&path);
@@ -1589,4 +1600,39 @@ mod tests {
assert!(!load(&path).experiments.your_cloud);
let _ = std::fs::remove_dir_all(dir);
}
+
+ #[test]
+ fn the_retired_sharing_and_cloud_switches_turn_a_stored_off_on_once() {
+ // Both default-on migrations already ran; the switches were still
+ // there, and someone turned both off.
+ let (dir, path) = temp_settings("retired");
+ std::fs::write(
+ &path,
+ r#"{"experiments":{"cuaVolume":true,"sharing":false,"yourCloud":false},"menuBar":true}"#,
+ )
+ .unwrap();
+ std::fs::write(
+ path.with_file_name("settings-migrations.json"),
+ r#"{"sharingDefaultOn":true,"yourCloudDefaultOn":true}"#,
+ )
+ .unwrap();
+ let s = load(&path);
+ assert!(s.experiments.sharing && s.experiments.your_cloud);
+ // Everything else the person set is kept.
+ assert!(s.experiments.cua_volume && s.menu_bar);
+ let raw: serde_json::Value =
+ serde_json::from_str(&std::fs::read_to_string(&path).unwrap()).unwrap();
+ assert_eq!(raw["experiments"]["sharing"], true);
+ assert_eq!(raw["menuBar"], true);
+ // It runs once: the markers say so, and a later load changes nothing.
+ let marks: serde_json::Value = serde_json::from_str(
+ &std::fs::read_to_string(path.with_file_name("settings-migrations.json")).unwrap(),
+ )
+ .unwrap();
+ assert_eq!(marks["sharingSwitchRetired"], true);
+ assert_eq!(marks["yourCloudSwitchRetired"], true);
+ let again = load(&path);
+ assert_eq!(again.experiments, s.experiments);
+ let _ = std::fs::remove_dir_all(dir);
+ }
}