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.

New Space: system order, and clearer ways to add a computer (CUA-2929) (#6200)

Francesco Bonaccibb417c44abce
diff --git a/apps/cua-spaces/README.md b/apps/cua-spaces/README.md
index 117d6341fe..59788c3738 100644
--- a/apps/cua-spaces/README.md
+++ b/apps/cua-spaces/README.md
@@ -64,7 +64,7 @@ view at launch in debug builds (release builds ignore the recording hooks).
**New Space** (Cmd+N, the sidebar's +, the notch's New, or the menu bar item)
is a step-by-step sheet:
-1. **System**: Linux, Windows or macOS, the image (a dropdown of the published
+1. **System**: Linux, macOS or Windows, the image (a dropdown of the published
entries of `libs/images/sandbox-images.json`, the same list the docs show),
and where it runs: This Mac, one of your own computers, or your own cloud
account. Cua no longer rents cloud machines. **Advanced** picks the kind (container or virtual
diff --git a/apps/cua-spaces/src/components/desktop/MainWindow.test.tsx b/apps/cua-spaces/src/components/desktop/MainWindow.test.tsx
index 5893f46267..6477e88012 100644
--- a/apps/cua-spaces/src/components/desktop/MainWindow.test.tsx
+++ b/apps/cua-spaces/src/components/desktop/MainWindow.test.tsx
@@ -126,8 +126,8 @@ describe("MainWindow", () => {
setup();
fireEvent.click(await screen.findByRole("button", { name: "New Space" }));
const dialog = await screen.findByRole("dialog", { name: "New Space" });
- expect(within(within(dialog).getByRole("combobox", { name: "Run on" })).getAllByRole("option").map((o) => o.textContent)).toEqual(["This Mac"]);
- expect(within(dialog).queryByRole("button", { name: /Connect a cloud/ })).toBeNull();
+ expect(within(within(dialog).getByRole("combobox", { name: "Run on" })).getAllByRole("option").map((o) => o.textContent)).toEqual(["This Mac", "Add a computer by its address…"]);
+ expect(within(dialog).queryByRole("option", { name: /Add your cloud account/ })).toBeNull();
expect(within(dialog).queryByText(/Cua Cloud/)).toBeNull();
window.localStorage.removeItem("cua.settings.experiments");
});
@@ -138,7 +138,7 @@ describe("MainWindow", () => {
const { createSpace } = setup({}, true, cloud);
fireEvent.click(await screen.findByRole("button", { name: "New Space" }));
const dialog = await screen.findByRole("dialog", { name: "New Space" });
- fireEvent.click(within(dialog).getByRole("button", { name: /Connect a cloud/ }));
+ fireEvent.change(within(dialog).getByRole("combobox", { name: "Run on" }), { target: { value: "add:cloud" } });
const sheet = await screen.findByRole("dialog", { name: "Connect a cloud" });
expect(await within(sheet).findByRole("radio", { name: /AWS/ })).toBeChecked();
fireEvent.click(within(sheet).getByRole("button", { name: "Test" }));
diff --git a/apps/cua-spaces/src/components/desktop/NewSpaceWizard.test.tsx b/apps/cua-spaces/src/components/desktop/NewSpaceWizard.test.tsx
index 1399940cfb..32a5e5c2d4 100644
--- a/apps/cua-spaces/src/components/desktop/NewSpaceWizard.test.tsx
+++ b/apps/cua-spaces/src/components/desktop/NewSpaceWizard.test.tsx
@@ -66,7 +66,7 @@ describe("the image field", () => {
const offeredGroups = new Set(list.groups.filter((g) => !("picker" in g) || g.picker !== false).map((g) => g.id));
const offered = list.images.filter((image) => image.published && offeredGroups.has(image.group));
const pressedOs = () =>
- ["Linux", "Windows", "macOS"].filter(
+ ["Linux", "macOS", "Windows"].filter(
(name) => screen.getByRole("button", { name: new RegExp(`^${name}`) }).getAttribute("aria-pressed") === "true",
);
@@ -192,14 +192,15 @@ describe("New Space wizard", () => {
it("lists This Mac and your machines; your clouds and Connect a cloud unless Your cloud is off", () => {
const onConnectCloud = vi.fn();
renderWizard({ clouds: [AWS], hosts: [MINI, STUDIO], onConnectCloud, experiments: NO_CLOUD });
- expect(entries()).toEqual(["Auto", "This Mac", "Mac mini", "Studio (offline) (disabled)"]);
+ expect(entries()).toEqual(["Auto", "This Mac", "Mac mini", "Studio (offline) (disabled)", "Add a computer by its address…"]);
expect(runOnMenu()).toHaveValue("local");
expect(screen.queryByText(/Cua Cloud/)).toBeNull();
+ expect(screen.queryByText(/Add your cloud account/)).toBeNull();
expect(screen.queryByRole("button", { name: /Connect a cloud/ })).toBeNull();
cleanup();
renderWizard({ clouds: [AWS], hosts: [MINI, STUDIO], onConnectCloud, experiments: YOUR_CLOUD });
- expect(entries()).toEqual(["Auto", "This Mac", "Mac mini", "Studio (offline) (disabled)", "AWS \u00b7 us-west-2"]);
- fireEvent.click(screen.getByRole("button", { name: /Connect a cloud/ }));
+ expect(entries()).toEqual(["Auto", "This Mac", "Mac mini", "Studio (offline) (disabled)", "AWS \u00b7 us-west-2", "Add your cloud account…", "Add a computer by its address…"]);
+ runOn("add:cloud");
expect(onConnectCloud).toHaveBeenCalled();
});
@@ -245,7 +246,7 @@ describe("New Space wizard", () => {
fireEvent.click(screen.getByRole("button", { name: "Back" }));
fireEvent.click(screen.getByRole("button", { name: "Back" }));
fireEvent.click(screen.getByRole("button", { name: "Back" }));
- fireEvent.click(screen.getByRole("button", { name: /Connect by address/ }));
+ runOn("add:address");
expect(screen.queryByLabelText("Cost")).toBeNull();
expect(screen.queryByText(/Free/)).toBeNull();
});
@@ -334,10 +335,15 @@ describe("the Resources step", () => {
expect(screen.queryByText("Linux runtime")).toBeNull();
next();
next();
- expect(screen.getByText(/includes 455 MB one-time Linux runtime download/)).toBeInTheDocument();
+ // The Summary shows one short value; the breakdown is the info icon's tooltip.
+ expect(screen.queryByText(/includes 455 MB one-time Linux runtime download/)).toBeNull();
expect(screen.queryByText("Linux runtime")).toBeNull();
expect(screen.getAllByText("Disk")).toHaveLength(1);
- expect(screen.getByText(/GB initially; grows with use/)).toBeInTheDocument();
+ expect(screen.getByText(/^About \d+(–\d+)? GB/)).toBeInTheDocument();
+ const info = screen.getByRole("button", { name: "Disk details" });
+ expect(info).toHaveAttribute("title", expect.stringContaining("includes 455 MB one-time Linux runtime download"));
+ fireEvent.click(info);
+ expect(screen.getByRole("tooltip")).toHaveTextContent(/includes 455 MB one-time Linux runtime download/);
});
it("blocks Continue in one line when the Space does not fit", () => {
@@ -393,7 +399,7 @@ describe("Connect by address", () => {
it("adds host:port with a token and dismisses on success", async () => {
const onAddByAddress = vi.fn(async () => {});
const { onCancel } = renderWizard({ onAddByAddress });
- fireEvent.click(screen.getByRole("button", { name: "Connect by address…" }));
+ runOn("add:address");
expect(screen.getByRole("button", { name: "Add Space" })).toBeDisabled();
fireEvent.change(screen.getByPlaceholderText("10.0.0.5:3211"), {
target: { value: "127.0.0.1:3211" },
@@ -411,7 +417,7 @@ describe("Connect by address", () => {
throw new Error("cua-spacesd is not available at 127.0.0.1:1");
});
const { onCancel } = renderWizard({ onAddByAddress });
- fireEvent.click(screen.getByRole("button", { name: "Connect by address…" }));
+ runOn("add:address");
fireEvent.change(screen.getByPlaceholderText("10.0.0.5:3211"), {
target: { value: "127.0.0.1:1" },
});
diff --git a/apps/cua-spaces/src/components/desktop/NewSpaceWizard.tsx b/apps/cua-spaces/src/components/desktop/NewSpaceWizard.tsx
index e9ac8e5edd..335045b794 100644
--- a/apps/cua-spaces/src/components/desktop/NewSpaceWizard.tsx
+++ b/apps/cua-spaces/src/components/desktop/NewSpaceWizard.tsx
@@ -213,7 +213,7 @@ interface WizardView {
nameError: string | null;
openWhenReady: boolean;
streamNote: string | null;
- summary: { label: string; value: string }[];
+ summary: { label: string; value: string; help?: string | null }[];
canContinue: boolean;
showBack: boolean;
primaryLabel: string;
@@ -546,7 +546,10 @@ export function NewSpaceWizard({
{v.summary.map((fact) => (
<Fragment key={fact.label}>
<dt>{fact.label}</dt>
- <dd>{fact.label === "Image" ? <code>{fact.value}</code> : fact.value}</dd>
+ <dd>
+ {fact.label === "Image" ? <code>{fact.value}</code> : fact.value}
+ {fact.help && <InfoTip label={fact.label} text={fact.help} />}
+ </dd>
</Fragment>
))}
</dl>
@@ -634,6 +637,37 @@ function label(v: WizardView, id: string): string {
return field(v, id)?.label ?? "";
}
+/** A small info icon: the full text as a tooltip on hover and focus, and shown below on click. */
+function InfoTip({ label, text }: { label: string; text: string }) {
+ const t = useT("spaces");
+ const [open, setOpen] = useState(false);
+ return (
+ <span className="wz-info">
+ <button
+ type="button"
+ className="wz-info-btn"
+ aria-label={t("spaces.wizard.info_details", { label })}
+ aria-expanded={open}
+ title={text}
+ onClick={() => setOpen((o) => !o)}
+ onBlur={() => setOpen(false)}
+ onKeyDown={(e) => e.key === "Escape" && setOpen(false)}
+ >
+ <Sym name="info.circle" size={12} />
+ </button>
+ {open && (
+ <span role="tooltip" className="wz-info-pop">
+ {text}
+ </span>
+ )}
+ </span>
+ );
+}
+
+/** The "Run on" menu's last two entries: they open a flow instead of picking a place. */
+const ADD_CLOUD = "add:cloud";
+const ADD_ADDRESS = "add:address";
+
/** One field of the System step, drawn by its core `id`. */
function SystemField({
field: f,
@@ -646,6 +680,7 @@ function SystemField({
dispatch: (action: WizardAction) => void;
onConnectCloud?: () => void;
}) {
+ const t = useT("spaces");
switch (f.id) {
case "os":
return (
@@ -680,13 +715,25 @@ function SystemField({
aria-label={f.label}
value={v.placementId}
title={chosen?.detail || undefined}
- onChange={(event) => dispatch({ type: "choose-placement", on: event.target.value })}
+ onChange={(event) => {
+ if (event.target.value === ADD_CLOUD) onConnectCloud?.();
+ else if (event.target.value === ADD_ADDRESS) dispatch({ type: "show-address" });
+ else dispatch({ type: "choose-placement", on: event.target.value });
+ }}
>
{v.placements.map((o) => (
<option key={o.id} value={o.id} disabled={!o.enabled} title={o.detail || undefined}>
{o.label}
</option>
))}
+ {onConnectCloud && v.fields.some((x) => x.id === "connect-cloud") && (
+ <option value={ADD_CLOUD} title={t("spaces.wizard.add_cloud_hint")}>
+ {t("spaces.wizard.add_cloud")}
+ </option>
+ )}
+ <option value={ADD_ADDRESS} title={t("spaces.wizard.add_address_hint")}>
+ {t("spaces.wizard.add_address")}
+ </option>
</select>
</label>
{f.error && (
@@ -736,22 +783,10 @@ function SystemField({
</select>
</label>
);
+ // Reached from the "Run on" menu's last two entries, not drawn here.
case "connect-cloud":
- return onConnectCloud ? (
- <div>
- <button type="button" className="dw-btn-link" onClick={onConnectCloud}>
- {f.label}
- </button>
- </div>
- ) : null;
case "connect-by-address":
- return (
- <div>
- <button type="button" className="dw-btn-link" onClick={() => dispatch({ type: "show-address" })}>
- {f.label}
- </button>
- </div>
- );
+ return null;
default:
return null;
}
diff --git a/apps/cua-spaces/src/components/desktop/Sym.tsx b/apps/cua-spaces/src/components/desktop/Sym.tsx
index 4a55d24449..97fb8b602a 100644
--- a/apps/cua-spaces/src/components/desktop/Sym.tsx
+++ b/apps/cua-spaces/src/components/desktop/Sym.tsx
@@ -26,6 +26,7 @@ const PATHS: Record<string, string> = {
cpu: "M7 7h10v10H7zM10 3v4M14 3v4M10 17v4M14 17v4M3 10h4M3 14h4M17 10h4M17 14h4",
memorychip: "M3 8h18v8H3zM7 16v3M11 16v3M15 16v3M7 11h2M11 11h2M15 11h2",
checkmark: "m5 12.5 4.5 4.5L19 7.5",
+ "info.circle": "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 11v5.5M12 7.5v.01",
"exclamationmark.triangle": "M12 4.5 21 19.5H3zM12 10v4.5M12 17v.01",
"doc.on.doc": "M8 8h11v12H8zM5 16V4h11",
xmark: "M6 6l12 12M18 6 6 18",
diff --git a/apps/cua-spaces/src/i18n/locales/en/spaces.json b/apps/cua-spaces/src/i18n/locales/en/spaces.json
index f83946d081..338d78a28f 100644
--- a/apps/cua-spaces/src/i18n/locales/en/spaces.json
+++ b/apps/cua-spaces/src/i18n/locales/en/spaces.json
@@ -39,6 +39,11 @@
"spaces.main.os_tile_label": "{name}, {detail}",
"spaces.detail.preview_alt": "{name} desktop",
"spaces.wizard.connect_by_address": "Connect by address",
+ "spaces.wizard.add_cloud": "Add your cloud account\u2026",
+ "spaces.wizard.add_cloud_hint": "AWS, Google Cloud, Hetzner and others",
+ "spaces.wizard.add_address": "Add a computer by its address\u2026",
+ "spaces.wizard.add_address_hint": "A computer you run yourself",
+ "spaces.wizard.info_details": "{label} details",
"spaces.wizard.label": "New Space",
"spaces.wizard.steps_label": "Steps",
"spaces.wizard.cost_label": "Cost",
diff --git a/apps/cua-spaces/src/styles/app.css b/apps/cua-spaces/src/styles/app.css
index ed74f42fa1..471f8ad4f7 100644
--- a/apps/cua-spaces/src/styles/app.css
+++ b/apps/cua-spaces/src/styles/app.css
@@ -4951,3 +4951,9 @@ li.installer-agent {
.onboarding-todos li[data-done] strong {
opacity: 0.6;
}
+
+/* Summary: a small info icon after a long value; the text shows on hover, focus or click. */
+.wz-info { position: relative; display: inline-block; margin-left: 6px; vertical-align: middle; }
+.wz-info-btn { display: inline-flex; padding: 0; border: 0; background: none; color: inherit; opacity: 0.6; cursor: pointer; }
+.wz-info-btn:hover, .wz-info-btn:focus-visible { opacity: 1; }
+.wz-info-pop { position: absolute; z-index: 5; left: 0; top: 100%; margin-top: 4px; width: max-content; max-width: 280px; padding: 6px 8px; border: 1px solid var(--border, rgba(128, 128, 128, 0.35)); border-radius: 6px; background: var(--surface, Canvas); font-size: 12px; line-height: 1.4; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-microvm.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-microvm.json
index a47cbb47c6..8fb3f08ca5 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-microvm.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-microvm.json
@@ -603,7 +603,7 @@
"Architecture: ARM",
"Runtime: Apple Containerization microVM on this Mac",
"Resources: 2 cores, 4 GB memory",
- "Disk: 2.9–6.9 GB initially; grows with use",
+ "Disk: About 3–7 GB ?2.9–6.9 GB initially; grows with use",
"Name: space-000000002a",
"When ready: Open the desktop"
]
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/placement-picker.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/placement-picker.json
index a81b8beccc..03cf3d6f8e 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/placement-picker.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/placement-picker.json
@@ -44,7 +44,7 @@
"Architecture: ARM",
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
- "Disk: 2.9–6.9 GB initially; grows with use",
+ "Disk: About 3–7 GB",
"Name: space-000000002a",
"When ready: Open the desktop"
],
@@ -96,7 +96,7 @@
"Architecture: ARM",
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
- "Disk: 2.9–6.9 GB initially; grows with use",
+ "Disk: About 3–7 GB",
"Name: space-000000002a",
"When ready: Open the desktop"
],
@@ -148,7 +148,7 @@
"Architecture: ARM",
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
- "Disk: 2.9–6.9 GB initially; grows with use",
+ "Disk: About 3–7 GB",
"Name: space-000000002a",
"When ready: Open the desktop"
],
@@ -457,8 +457,8 @@
"When ready: Open the desktop"
],
"systemsOff": [
- "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off",
- "macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off"
+ "macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off",
+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"
]
}
},
@@ -505,7 +505,7 @@
"Architecture: ARM",
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
- "Disk: 2.9–6.9 GB initially; grows with use",
+ "Disk: About 3–7 GB",
"Name: space-000000002a",
"When ready: Open the desktop"
],
@@ -725,7 +725,7 @@
"Architecture: ARM",
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
- "Disk: 2.9–6.9 GB initially; grows with use",
+ "Disk: About 3–7 GB",
"Name: space-000000002a",
"When ready: Open the desktop"
],
@@ -764,7 +764,7 @@
"Architecture: ARM",
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
- "Disk: 2.9–6.9 GB initially; grows with use",
+ "Disk: About 3–7 GB",
"Name: space-000000002a",
"When ready: Open the desktop"
],
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/your-cloud.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/your-cloud.json
index 1e3d4bb22c..8c6d98fb7f 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/your-cloud.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/your-cloud.json
@@ -39,7 +39,7 @@
"Architecture: ARM",
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
- "Disk: 2.9–6.9 GB initially; grows with use",
+ "Disk: About 3–7 GB",
"Name: space-000000002a",
"When ready: Open the desktop"
],
@@ -86,7 +86,7 @@
"Architecture: ARM",
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
- "Disk: 2.9–6.9 GB initially; grows with use",
+ "Disk: About 3–7 GB",
"Name: space-000000002a",
"When ready: Open the desktop"
],
@@ -729,8 +729,8 @@
"When ready: Open the desktop"
],
"systemsOff": [
- "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off",
- "macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off"
+ "macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off",
+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"
]
}
},
@@ -771,8 +771,8 @@
"When ready: Open the desktop"
],
"systemsOff": [
- "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off",
- "macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off"
+ "macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off",
+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"
]
}
},
@@ -816,8 +816,8 @@
"When ready: Open the desktop"
],
"systemsOff": [
- "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off",
- "macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off"
+ "macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off",
+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"
]
}
},
@@ -858,8 +858,8 @@
"When ready: Open the desktop"
],
"systemsOff": [
- "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off",
- "macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off"
+ "macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off",
+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"
]
}
},
@@ -904,8 +904,8 @@
"When ready: Open the desktop"
],
"systemsOff": [
- "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off",
- "macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off"
+ "macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off",
+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"
]
}
},
@@ -950,8 +950,8 @@
"When ready: Open the desktop"
],
"systemsOff": [
- "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off",
- "macos | macOS | Modal does not run this image. Ask your agent to deploy the macOS Tahoe 26 image on Modal and add it with cua spaces add. | off"
+ "macos | macOS | Modal does not run this image. Ask your agent to deploy the macOS Tahoe 26 image on Modal and add it with cua spaces add. | off",
+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"
]
}
},
@@ -991,7 +991,7 @@
"Architecture: ARM",
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
- "Disk: 2.9–6.9 GB initially; grows with use",
+ "Disk: About 3–7 GB",
"Name: space-000000002a",
"When ready: Open the desktop"
],
diff --git a/libs/cua/crates/cua-spaces-app-core/src/wizard.rs b/libs/cua/crates/cua-spaces-app-core/src/wizard.rs
index 28c023b45a..7e06590b0b 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/wizard.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/wizard.rs
@@ -3317,6 +3317,9 @@ struct DiskView {
note: Option<String>,
/// The chosen size is not the image's.
resized: bool,
+ /// A container Space's Disk as one short line ("About 4\u{2013}8 GB"),
+ /// from the same range as the full row.
+ disk_short: Option<String>,
}
fn disk_view(state: &WizardState, image: &SandboxImage, env: &WizardEnv, os: SpaceOs) -> DiskView {
@@ -3365,10 +3368,17 @@ fn disk_view(state: &WizardState, image: &SandboxImage, env: &WizardEnv, os: Spa
size_text(runtime_download)
)
});
+ let mut disk_short = None;
if let Some(s) = size {
if bounds.is_none() {
let footprint = if image.local == Some(LocalEngine::Container) {
let (low, high) = container_footprint(s, runtime_download);
+ let (a, b) = (low.div_ceil(GIB), high.div_ceil(GIB));
+ disk_short = Some(if a == b {
+ format!("About {a} GB")
+ } else {
+ format!("About {a}\u{2013}{b} GB")
+ });
format!("{} initially; grows with use", size_range_text(low, high))
} else {
size_text(s.disk)
@@ -3431,6 +3441,7 @@ fn disk_view(state: &WizardState, image: &SandboxImage, env: &WizardEnv, os: Spa
arch,
note,
resized,
+ disk_short,
}
}
@@ -3680,8 +3691,8 @@ pub fn view_on(state: &WizardState, env: &WizardEnv, os: SpaceOs) -> WizardView
let host_os = os;
let os_tiles = [
(SpaceOs::Linux, "Linux", "Ubuntu desktop with cua-spacesd"),
- (SpaceOs::Windows, "Windows", "Windows Server VM"),
(SpaceOs::Macos, "macOS", "Apple silicon VM through Lume"),
+ (SpaceOs::Windows, "Windows", "Windows Server VM"),
]
.into_iter()
.map(|(os, title, detail)| {
@@ -3941,9 +3952,14 @@ pub fn view_on(state: &WizardState, env: &WizardEnv, os: SpaceOs) -> WizardView
.filter(|_| local && image.local == Some(LocalEngine::Container))
.map(|f| Fact {
label: f.label.clone(),
- value: f.value.clone(),
+ // One short line; the full breakdown is the tooltip.
+ value: disk.disk_short.clone().unwrap_or_else(|| f.value.clone()),
copy: None,
- help: f.help.clone(),
+ help: disk
+ .disk_short
+ .as_ref()
+ .map(|_| f.value.clone())
+ .or_else(|| f.help.clone()),
warning: None,
}),
);
@@ -4973,26 +4989,30 @@ mod tests {
&& f.value
.contains("includes 455 MB one-time Linux runtime download")
}));
- assert!(v.summary.iter().any(|f| {
- f.label == "Disk"
- && f.value
- .contains("includes 455 MB one-time Linux runtime download")
- }));
- assert!(v.summary.iter().any(|f| {
- f.label == "Disk"
- && f.value.starts_with(
- size_text(p.unpacked + (455 << 20))
- .trim_end_matches(" GB")
- .trim_end_matches(" MB"),
- )
- }));
- e.storage.as_mut().unwrap().linux_runtime_download_bytes = 0;
+ // The Summary shows one short line; the full breakdown is its tooltip.
+ let disk = v.summary.iter().find(|f| f.label == "Disk").unwrap();
+ let (low, high) = container_footprint(&p, 455 << 20);
+ assert_eq!(
+ disk.value,
+ format!(
+ "About {}\u{2013}{} GB",
+ low.div_ceil(GIB),
+ high.div_ceil(GIB)
+ )
+ );
assert!(
- !view(&s, &e)
- .summary
- .iter()
- .any(|f| f.value.contains("one-time Linux runtime download"))
+ disk.help
+ .as_deref()
+ .unwrap()
+ .contains("includes 455 MB one-time Linux runtime download")
);
+ e.storage.as_mut().unwrap().linux_runtime_download_bytes = 0;
+ assert!(!view(&s, &e).summary.iter().any(|f| {
+ f.value.contains("one-time Linux runtime download")
+ || f.help
+ .as_deref()
+ .is_some_and(|h| h.contains("one-time Linux runtime download"))
+ }));
let mac = on("ghcr.io/trycua/macos:15", &e);
e.storage.as_mut().unwrap().linux_runtime_download_bytes = 455 << 20;
assert!(