Skip to content
Python

Sandbox page: links open the browser, real CLI logos, tools off by default

Rohit C Prasad7f4844ca7c17
diff --git a/coworker/sandbox/toolchains.py b/coworker/sandbox/toolchains.py
index a5b434b9..4b17d8e3 100644
--- a/coworker/sandbox/toolchains.py
+++ b/coworker/sandbox/toolchains.py
@@ -3,8 +3,9 @@ macOS section 11 step 4).
A sandbox hides the home folder, and with it the tools people install per user: Node
versions under `.nvm`, Python versions under `.pyenv`, Cargo, Scoop. Without these the
-agent has no `node`. So a fixed list of tool folders is readable, never writable, and the
-user can switch each off or add one, machine-level, in Settings ▸ Sandbox
+agent has no `node`. So a fixed list of tool folders may be made readable, never writable:
+all off until the user switches one on (UX-053 v6), and the user can add one, machine-level,
+in Settings ▸ Sandbox
(`[[sandbox_toolchains]]` in the machine's config.toml; a project cannot change it).
Per platform. The Mac list is what the Seatbelt profile always granted; the Windows list
@@ -50,9 +51,9 @@ _WINDOWS: list[tuple[str, str, str]] = [
def defaults(platform: str = sys.platform) -> list[dict[str, Any]]:
- """The shipped list for a platform, every entry switched on."""
+ """The shipped list for a platform, every entry switched off."""
rows = _WINDOWS if platform == "win32" else _MAC if platform == "darwin" else []
- return [{"name": n, "title": t, "path": p, "enabled": True} for n, t, p in rows]
+ return [{"name": n, "title": t, "path": p, "enabled": False} for n, t, p in rows]
def entries(configured: Optional[Sequence[dict[str, Any]]], platform: str = sys.platform) -> list[dict[str, Any]]:
@@ -96,10 +97,12 @@ def granted(
def for_display(configured: Optional[Sequence[dict[str, Any]]], *, home: Optional[str] = None, platform: str = sys.platform) -> list[dict[str, Any]]:
- """The entries with `exists` (on this machine) and `shipped` (in the default list)."""
+ """The entries with `exists` (on this machine) and `shipped` (in the default list). A
+ shipped folder this machine does not have is left out: there is nothing to show."""
home = os.path.realpath(home or os.path.expanduser("~"))
shipped = {e["name"] for e in defaults(platform)}
- return [
+ rows = [
{**e, "exists": bool(e.get("path")) and os.path.exists(_real(str(e["path"]), home)), "shipped": e["name"] in shipped}
for e in entries(configured, platform)
]
+ return [r for r in rows if r["exists"] or not r["shipped"]]
diff --git a/docs/macos-sandbox.md b/docs/macos-sandbox.md
index ecdc9d04..342e9498 100644
--- a/docs/macos-sandbox.md
+++ b/docs/macos-sandbox.md
@@ -50,11 +50,11 @@ Read only:
- the session's read-only folders;
- the system: `/usr`, `/bin`, `/System`, `/Library`, `/opt`, `/Applications`, `/private/etc`;
- OpenWorker's managed tools folder, the tool runner and its Python;
-- under your home folder, only the developer toolchains on the list in Settings ▸
- Sandbox — shipped: `.nvm`, `.volta`, `.bun`, `.deno`, `.pyenv`, `.rbenv`, `.asdf`,
- `.sdkman`, `.cargo`, `.rustup`, `.local/bin`, `.local/share/uv`, `.local/share/mise`,
- `.local/pipx`, `go`; each with a switch, and you can add a folder — plus git's settings
- (`.gitconfig`, `.config/git`).
+- under your home folder, only the developer toolchains you switch on in Settings ▸
+ Sandbox — offered when your Mac has them: `.nvm`, `.volta`, `.bun`, `.deno`, `.pyenv`,
+ `.rbenv`, `.asdf`, `.sdkman`, `.cargo`, `.rustup`, `.local/bin`, `.local/share/uv`,
+ `.local/share/mise`, `.local/pipx`, `go`; all off until you switch one on, and you can
+ add a folder — plus git's settings (`.gitconfig`, `.config/git`).
Network: `localhost` on the proxy's port, nothing else. `curl`, `git`, `pip` and `npm`
follow the proxy variables; a program that ignores them has no network at all.
diff --git a/docs/windows-sandbox.md b/docs/windows-sandbox.md
index 7c1de12c..88b8c61d 100644
--- a/docs/windows-sandbox.md
+++ b/docs/windows-sandbox.md
@@ -170,8 +170,8 @@ Read only, from your profile, so the agent can run your tools:
- developer tools installed per user, from a list you control in Settings ▸ Sandbox:
nvm for Windows and npm's global folder (`AppData\Roaming`), pyenv-win, per-user
- Python installs, Scoop, Cargo, rustup, Go, pipx and uv. Each has a switch; you can add
- a folder. The session also inherits your `PATH`, so those tools resolve. Nothing under
+ Python installs, Scoop, Cargo, rustup, Go, pipx and uv. The page lists only the ones
+ this PC has, all off until you switch one on; you can add a folder. The session also inherits your `PATH`, so those tools resolve. Nothing under
them is writable.
Not readable:
diff --git a/surfaces/gui/src-tauri/Cargo.lock b/surfaces/gui/src-tauri/Cargo.lock
index e1d34864..d0d4ed72 100644
--- a/surfaces/gui/src-tauri/Cargo.lock
+++ b/surfaces/gui/src-tauri/Cargo.lock
@@ -1936,6 +1936,25 @@ version = "2.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2"
+[[package]]
+name = "is-docker"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3"
+dependencies = [
+ "once_cell",
+]
+
+[[package]]
+name = "is-wsl"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5"
+dependencies = [
+ "is-docker",
+ "once_cell",
+]
+
[[package]]
name = "itertools"
version = "0.13.0"
@@ -2664,6 +2683,17 @@ version = "1.21.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
+[[package]]
+name = "open"
+version = "5.4.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa576c76302b7b808eecc68061e67336c47833ef9d22caa74dda10fa9675eebc"
+dependencies = [
+ "dunce",
+ "is-wsl",
+ "libc",
+]
+
[[package]]
name = "openssl-probe"
version = "0.2.1"
@@ -2681,6 +2711,7 @@ dependencies = [
"tauri-build",
"tauri-plugin-autostart",
"tauri-plugin-dialog",
+ "tauri-plugin-opener",
"tauri-plugin-single-instance",
"tauri-plugin-updater",
"uuid",
@@ -4075,6 +4106,28 @@ dependencies = [
"url",
]
+[[package]]
+name = "tauri-plugin-opener"
+version = "2.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "60d60366174b745b4ef5824b8bbc1c457fd08f0ce101ff643c0a49181a9f4e91"
+dependencies = [
+ "dunce",
+ "glob",
+ "objc2-app-kit",
+ "objc2-foundation",
+ "open",
+ "schemars 0.8.22",
+ "serde",
+ "serde_json",
+ "tauri",
+ "tauri-plugin",
+ "thiserror 2.0.18",
+ "url",
+ "windows 0.61.3",
+ "zbus",
+]
+
[[package]]
name = "tauri-plugin-single-instance"
version = "2.4.2"
diff --git a/surfaces/gui/src-tauri/Cargo.toml b/surfaces/gui/src-tauri/Cargo.toml
index e8e721ab..67bd0668 100644
--- a/surfaces/gui/src-tauri/Cargo.toml
+++ b/surfaces/gui/src-tauri/Cargo.toml
@@ -18,6 +18,8 @@ tauri-plugin-dialog = "2"
tauri-plugin-autostart = "2"
tauri-plugin-single-instance = "2"
tauri-plugin-updater = "2"
+# Opens web links in the default browser (openExternal in src/tauri.ts).
+tauri-plugin-opener = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
uuid = { version = "1", features = ["v4"] }
diff --git a/surfaces/gui/src-tauri/capabilities/default.json b/surfaces/gui/src-tauri/capabilities/default.json
index b2548af6..b2b7041d 100644
--- a/surfaces/gui/src-tauri/capabilities/default.json
+++ b/surfaces/gui/src-tauri/capabilities/default.json
@@ -10,6 +10,7 @@
"core:window:allow-set-focus",
"core:window:allow-unminimize",
"dialog:default",
+ "opener:default",
"autostart:default"
]
}
diff --git a/surfaces/gui/src-tauri/src/lib.rs b/surfaces/gui/src-tauri/src/lib.rs
index d96c3c6f..5579a9f8 100644
--- a/surfaces/gui/src-tauri/src/lib.rs
+++ b/surfaces/gui/src-tauri/src/lib.rs
@@ -717,6 +717,7 @@ pub fn run() {
show_main(app);
}))
.plugin(tauri_plugin_dialog::init())
+ .plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_updater::Builder::new().build())
.plugin(tauri_plugin_autostart::init(
tauri_plugin_autostart::MacosLauncher::LaunchAgent,
diff --git a/surfaces/gui/src/components/SandboxSection.tsx b/surfaces/gui/src/components/SandboxSection.tsx
index 0b7c0d83..4e1c8eb6 100644
--- a/surfaces/gui/src/components/SandboxSection.tsx
+++ b/surfaces/gui/src/components/SandboxSection.tsx
@@ -29,7 +29,8 @@ import {
type SandboxSetupState,
type SandboxToolchainEntry,
} from "../api";
-import { chooseFolder } from "../tauri";
+import { siDocker, siGithub, siGooglecloud, siKubernetes, siNpm, siTerraform } from "simple-icons";
+import { chooseFolder, openExternal } from "../tauri";
import { Toggle } from "./Toggle";
import { PanelHead } from "./IntegrationsView";
@@ -119,27 +120,40 @@ function Modal({ children, testid, wide }: { children: React.ReactNode; testid:
);
}
-// The small square before an entry: the tool's own mark for a known CLI, else a file or folder.
+// The small square before an entry: the tool's own mark in its brand colour (simple-icons,
+// CC0), a key for SSH keys, else a folder.
+// AWS's mark was removed from simple-icons after v9; its path is vendored from v9 (CC0), as
+// connectors/registry.tsx does for Slack.
+const AWS_PATH =
+ "M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.263-.168.311a.51.51 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.175 0 .359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167zM21.698 16.207c-2.626 1.94-6.442 2.969-9.722 2.969-4.598 0-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351 3.384 1.963 7.559 3.153 11.877 3.153 2.914 0 6.114-.607 9.06-1.852.439-.2.814.287.383.607zM22.792 14.961c-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36 1.5-1.053 3.967-.75 4.254-.399.287.36-.08 2.826-1.485 4.007-.215.184-.423.088-.327-.151.32-.79 1.03-2.57.695-2.994z";
const BADGES: Record<string, [string, string]> = {
- gh: ["gh", "bg-[#24292f] text-white"],
- aws: ["aws", "bg-[#232f3e] text-[#ff9900]"],
- "aws-credentials": ["aws", "bg-[#232f3e] text-[#ff9900]"],
- kube: ["K8s", "bg-[#326ce5] text-white"],
- npm: ["npm", "bg-[#cb3837] text-white"],
- docker: ["dkr", "bg-[#1d63ed] text-white"],
- gcloud: ["G", "bg-white text-[#4285f4] border border-lineStrong"],
- terraform: ["tf", "bg-[#7b42bc] text-white"],
+ gh: [siGithub.path, `#${siGithub.hex}`],
+ aws: [AWS_PATH, "#FF9900"],
+ "aws-credentials": [AWS_PATH, "#FF9900"],
+ kube: [siKubernetes.path, `#${siKubernetes.hex}`],
+ npm: [siNpm.path, `#${siNpm.hex}`],
+ docker: [siDocker.path, `#${siDocker.hex}`],
+ gcloud: [siGooglecloud.path, `#${siGooglecloud.hex}`],
+ terraform: [siTerraform.path, `#${siTerraform.hex}`],
};
function Badge({ name }: { name: string }) {
const known = BADGES[name];
- if (known) {
- return <span className={"w-[26px] h-[26px] rounded-[7px] inline-flex items-center justify-center text-[9.5px] font-bold shrink-0 " + known[1]}>{known[0]}</span>;
- }
return (
- <span className="w-[26px] h-[26px] rounded-[7px] inline-flex items-center justify-center shrink-0 bg-paper text-muted border border-line">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" aria-hidden="true">
- <path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
- </svg>
+ <span className="w-[26px] h-[26px] rounded-[7px] inline-flex items-center justify-center shrink-0 bg-panel text-muted border border-line" data-testid={`sandbox-badge-${name}`}>
+ {known ? (
+ <svg viewBox="0 0 24 24" width="15" height="15" fill={known[1]} aria-hidden="true">
+ <path d={known[0]} />
+ </svg>
+ ) : name === "ssh" ? (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
+ <circle cx="8" cy="15" r="4" />
+ <path d="M11 12l9-9M17 6l3 3M14 9l2 2" />
+ </svg>
+ ) : (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" aria-hidden="true">
+ <path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
+ </svg>
+ )}
</span>
);
}
@@ -1061,8 +1075,17 @@ function OpenShellDialog({
</span>
</li>
);
+ // The desktop webview opens nothing by itself: links go to the browser through the opener.
const link = (href: string, label: string, testid: string) => (
- <a className="text-accent" href={href} target="_blank" rel="noreferrer" data-testid={testid}>
+ <a
+ className="text-accent"
+ href={href}
+ onClick={(e) => {
+ e.preventDefault();
+ openExternal(href);
+ }}
+ data-testid={testid}
+ >
{label}
</a>
);
diff --git a/surfaces/gui/src/components/SettingsView.sandbox.test.tsx b/surfaces/gui/src/components/SettingsView.sandbox.test.tsx
index a0759ee6..4363f4c2 100644
--- a/surfaces/gui/src/components/SettingsView.sandbox.test.tsx
+++ b/surfaces/gui/src/components/SettingsView.sandbox.test.tsx
@@ -309,6 +309,7 @@ describe("Settings ▸ Sandbox", () => {
expect(screen.getByTestId("sandbox-preset-npm").getAttribute("data-found")).toBe("yes");
expect(within(screen.getByTestId("sandbox-preset-npm")).getByText("~/.npmrc · Install and publish private packages")).toBeTruthy();
expect(within(screen.getByTestId("sandbox-preset-gcloud")).getByText("not found")).toBeTruthy();
+ expect(screen.getByTestId("sandbox-badge-npm").querySelector("path")?.getAttribute("fill") ?? screen.getByTestId("sandbox-badge-npm").querySelector("svg")?.getAttribute("fill")).toBe("#CB3837"); // the real npm mark
expect(within(screen.getByTestId("sandbox-preset-gcloud")).getByText("not on this Mac")).toBeTruthy();
fireEvent.click(screen.getByTestId("sandbox-preset-npm-add"));
await waitFor(() => expect(lastPatch().credentials[lastPatch().credentials.length - 1]).toEqual({ name: "npm", enabled: true }));
diff --git a/surfaces/gui/src/tauri.ts b/surfaces/gui/src/tauri.ts
index 95f3ccdb..f79dd4ff 100644
--- a/surfaces/gui/src/tauri.ts
+++ b/surfaces/gui/src/tauri.ts
@@ -125,9 +125,8 @@ export const clearPendingUpdate = () => invokeStrict<void>("clear_pending_update
* Windows hands off to the installer). */
export const installUpdate = () => invokeStrict<void>("install_update");
-/** Best-effort open a URL in the user's browser. Uses the Tauri opener plugin if present, else
- * `window.open`. The caller should also render the raw URL so it stays copyable if both no-op
- * (the desktop webview has no opener plugin wired yet). */
+/** Open a URL in the user's browser: the Tauri opener plugin in the desktop app (wired in
+ * src-tauri, `opener:default`), `window.open` in a browser. */
export function openExternal(url: string): void {
const opener = (globalThis as any).__TAURI__?.opener;
if (opener?.openUrl) {
diff --git a/tests/test_sandbox_settings.py b/tests/test_sandbox_settings.py
index 438a2d4b..406af25e 100644
--- a/tests/test_sandbox_settings.py
+++ b/tests/test_sandbox_settings.py
@@ -40,8 +40,9 @@ def test_snapshot_reports_the_default_rule_and_the_shipped_entries(config_file):
assert (snap["windows_setup"] is None) == (sys.platform != "win32")
from coworker.sandbox import toolchains
- assert [e["name"] for e in snap["toolchains"]] == [e["name"] for e in toolchains.defaults()]
- assert all(e["shipped"] and e["enabled"] and "exists" in e for e in snap["toolchains"])
+ # Only the shipped folders this machine has, all switched off.
+ assert {e["name"] for e in snap["toolchains"]} <= {e["name"] for e in toolchains.defaults()}
+ assert all(e["shipped"] and not e["enabled"] and e["exists"] for e in snap["toolchains"])
def test_toolchain_switches_and_additions_are_written_slim(config_file):
@@ -49,7 +50,7 @@ def test_toolchain_switches_and_additions_are_written_slim(config_file):
rows = [dict(e) for e in toolchains.defaults()]
if rows:
- rows[0]["enabled"] = False
+ rows[0]["enabled"] = True # one switched on
rows.append({"name": "mytools", "title": "My tools", "path": "~/tools", "enabled": True})
out = settings.update({"toolchains": rows})
assert out["ok"], out
@@ -58,8 +59,8 @@ def test_toolchain_switches_and_additions_are_written_slim(config_file):
assert 'name = "mytools"' in text and 'path = "~/tools"' in text
by = {e["name"]: e for e in settings.snapshot()["toolchains"]}
assert by["mytools"]["enabled"] and not by["mytools"]["shipped"]
- if rows[:-1]:
- assert by[rows[0]["name"]]["enabled"] is False
+ if rows[:-1] and rows[0]["name"] in by: # shown only when this machine has it
+ assert by[rows[0]["name"]]["enabled"] is True
assert settings.update({"toolchains": [{"name": "x", "path": "relative/path"}]})["ok"] is False
diff --git a/tests/test_sandbox_toolchains.py b/tests/test_sandbox_toolchains.py
index 9cfea76f..40c48b7e 100644
--- a/tests/test_sandbox_toolchains.py
+++ b/tests/test_sandbox_toolchains.py
@@ -9,12 +9,12 @@ import os
from coworker.sandbox import toolchains
-def test_the_shipped_lists_are_per_platform_and_switched_on():
+def test_the_shipped_lists_are_per_platform_and_switched_off():
mac = toolchains.defaults("darwin")
win = toolchains.defaults("win32")
assert {e["name"] for e in mac} >= {"nvm", "pyenv", "cargo", "go", "uv"}
assert {e["name"] for e in win} >= {"nvm", "npm", "pyenv", "scoop", "cargo"}
- assert all(e["enabled"] and e["path"].startswith("~/") for e in mac + win)
+ assert all(not e["enabled"] and e["path"].startswith("~/") for e in mac + win) # nothing until switched on (UX-053 v6)
assert toolchains.defaults("linux") == [] # OpenShell mounts no home folder
@@ -31,6 +31,7 @@ def test_granted_is_only_what_is_on_and_exists_under_home(tmp_path):
(home / "tools").mkdir()
(tmp_path / "outside").mkdir()
configured = [
+ {"name": "nvm", "enabled": True},
{"name": "pyenv", "enabled": True}, # on, but missing here
{"name": "cargo", "enabled": False},
{"name": "mytools", "path": "~/tools"},
@@ -41,4 +42,5 @@ def test_granted_is_only_what_is_on_and_exists_under_home(tmp_path):
assert got == [os.path.realpath(home / ".nvm"), os.path.realpath(home / "tools")]
shown = {e["name"]: e for e in toolchains.for_display(configured, home=str(home), platform="darwin")}
assert shown["nvm"]["exists"] and shown["nvm"]["shipped"]
- assert not shown["pyenv"]["exists"] and shown["mytools"]["exists"] and not shown["mytools"]["shipped"]
+ assert "pyenv" not in shown and "go" not in shown # shipped but not on this machine: not shown
+ assert shown["mytools"]["exists"] and not shown["mytools"]["shipped"]