Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat(ide): show VS Code and Cursor with their real logos in the workspace menu

rubenluetke10-beepf5b199c47f5a
diff --git a/jarvis/plugins/tool/app_resolver.py b/jarvis/plugins/tool/app_resolver.py
index 2a1e69828c..fac386272b 100644
--- a/jarvis/plugins/tool/app_resolver.py
+++ b/jarvis/plugins/tool/app_resolver.py
@@ -88,6 +88,7 @@ _EXE_ALIASES_WIN = {
_EXE_ALIASES_DARWIN = {
"vscode": "Visual Studio Code",
"code": "Visual Studio Code",
+ "cursor": "Cursor",
"calc": "Calculator",
"chrome": "Google Chrome",
"terminal": "Terminal",
diff --git a/jarvis/ui/web/chat_library_routes.py b/jarvis/ui/web/chat_library_routes.py
index defe67dd8d..036c549063 100644
--- a/jarvis/ui/web/chat_library_routes.py
+++ b/jarvis/ui/web/chat_library_routes.py
@@ -315,6 +315,9 @@ def reveal_project(request: Request, project_id: str) -> RevealedOut:
class LauncherOut(BaseModel):
id: str
label: str
+ # False for a featured editor that is not on this computer: the menu still
+ # lists it, greyed out, so the user can see where the folder could open.
+ installed: bool = True
class LaunchersOut(BaseModel):
@@ -334,6 +337,10 @@ class OpenInIn(BaseModel):
)
+# The editors the project menu always offers, in this order.
+_FEATURED_EDITORS = ("code", "cursor")
+
+
def _require_folder(request: Request, project_id: str) -> str:
if not bool(getattr(request.app.state, "native_file_actions", False)):
raise HTTPException(status_code=404, detail="native-file-actions-disabled")
@@ -367,12 +374,22 @@ def project_launchers(request: Request, project_id: str) -> LaunchersOut:
from jarvis.agentic_ide import project_links
from jarvis.ui.web import outputs_routes
- editor_ids = {oid for oid, _ in outputs_routes._OPENER_EDITORS}
+ labels = dict(outputs_routes._OPENER_EDITORS)
+ installed = [
+ entry["id"] for entry in outputs_routes._available_openers() if entry["id"] in labels
+ ]
+ # VS Code and Cursor are always listed, installed or not. Another editor
+ # only stands in when neither of them is on this computer.
editors = [
- LauncherOut(id=entry["id"], label=entry["label"])
- for entry in outputs_routes._available_openers()
- if entry["id"] in editor_ids
+ LauncherOut(id=oid, label=labels[oid], installed=oid in installed)
+ for oid in _FEATURED_EDITORS
]
+ if not any(editor.installed for editor in editors):
+ editors += [
+ LauncherOut(id=oid, label=labels[oid])
+ for oid in installed
+ if oid not in _FEATURED_EDITORS
+ ][:2]
remote = project_links.remote_web_url(folder)
return LaunchersOut(
file_manager=True,
diff --git a/jarvis/ui/web/frontend/src/assets/editors/LOGOS.md b/jarvis/ui/web/frontend/src/assets/editors/LOGOS.md
new file mode 100644
index 0000000000..bfe1f0b1a5
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/assets/editors/LOGOS.md
@@ -0,0 +1,15 @@
+# Code-editor marks
+
+The original marks of the code editors a project folder can be opened in,
+bundled so the sidebar menu renders them offline and on every OS. They are
+kept apart from the tool-brand folders on purpose: those are matched against
+tool names, and an editor mark must only ever label its own "Open in" item.
+
+Every mark belongs to its owner and is used solely to identify the editor the
+menu item launches (nominative use). It does not imply endorsement. If you own
+a mark listed here and want it removed, open an issue and it will be taken out.
+
+| Asset | Source | License |
+| --- | --- | --- |
+| `vscode.svg` | [gilbarbara/logos visual-studio-code](https://raw.githubusercontent.com/gilbarbara/logos/37a6b807fd71c622efea27a9309b5d4edc792969/logos/visual-studio-code.svg) | CC0 (drawing) |
+| `cursor.svg` | Redrawn from the app icon Cursor ships in its installer (`resources/app/out/media/logo.png`): the shaded cube on its black tile | Trademark of Anysphere |
diff --git a/jarvis/ui/web/frontend/src/assets/editors/cursor.svg b/jarvis/ui/web/frontend/src/assets/editors/cursor.svg
new file mode 100644
index 0000000000..5756c47c70
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/assets/editors/cursor.svg
@@ -0,0 +1,20 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
+ <title>Cursor</title>
+ <defs>
+ <linearGradient id="top-left" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#9b9b9b"/><stop offset="1" stop-color="#3a3a3a"/></linearGradient>
+ <linearGradient id="top-right" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#121212"/><stop offset="1" stop-color="#5a5a5a"/></linearGradient>
+ <linearGradient id="left" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#565656"/><stop offset="1" stop-color="#2c2c2c"/></linearGradient>
+ <linearGradient id="bottom-left" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#5a5a5a"/><stop offset="1" stop-color="#d2d2d2"/></linearGradient>
+ <linearGradient id="right" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#1c1c1c"/><stop offset="1" stop-color="#3c3c3c"/></linearGradient>
+ <linearGradient id="bottom-right" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#9a9a9a"/><stop offset="1" stop-color="#e8e8e8"/></linearGradient>
+ </defs>
+ <rect width="24" height="24" rx="5.4" fill="#000"/>
+ <path d="M12 4.26 5.292 8.13H12z" fill="url(#top-left)"/>
+ <path d="M12 4.26V8.13h6.708z" fill="url(#top-right)"/>
+ <path d="M5.292 8.13 12 12 5.292 15.87z" fill="url(#left)"/>
+ <path d="M5.292 15.87 12 12v7.74z" fill="url(#bottom-left)"/>
+ <path d="M18.708 8.13v7.74l-3.32-1.995z" fill="url(#right)"/>
+ <path d="M15.388 13.875 18.708 15.87 12 19.74z" fill="url(#bottom-right)"/>
+ <path d="M12 12 18.708 8.13 12 19.74z" fill="#e3e3e3"/>
+ <path d="M5.292 8.13h13.416L12 12z" fill="#fff"/>
+</svg>
diff --git a/jarvis/ui/web/frontend/src/assets/editors/vscode.svg b/jarvis/ui/web/frontend/src/assets/editors/vscode.svg
new file mode 100644
index 0000000000..2d17f78b09
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/assets/editors/vscode.svg
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="256px" height="254px" viewBox="0 0 256 254" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
+ <defs>
+ <path d="M180.82764,252.605272 C184.843951,254.170159 189.42406,254.069552 193.478224,252.11917 L245.979142,226.856851 C251.495593,224.202221 255.003889,218.618034 255.003889,212.49296 L255.003889,41.1971845 C255.003889,35.0719113 251.495593,29.4886211 245.979142,26.8339907 L193.478224,1.57068551 C188.158006,-0.989256713 181.931329,-0.362230036 177.262566,3.0323459 C176.595173,3.51727166 175.959655,4.05869672 175.363982,4.65536598 L74.8565893,96.3498444 L31.0778002,63.1181557 C27.0024197,60.0246398 21.3020866,60.2780499 17.5170718,63.7211005 L3.47578059,76.4937075 C-1.15402423,80.7052561 -1.15933349,87.9889043 3.46431538,92.2072265 L41.430759,126.844525 L3.46431538,161.482221 C-1.15933349,165.700742 -1.15402423,172.984291 3.47578059,177.19584 L17.5170718,189.967949 C21.3020866,193.411497 27.0024197,193.664509 31.0778002,190.571591 L74.8565893,157.339404 L175.363982,249.034221 C176.953772,250.625007 178.82048,251.823326 180.82764,252.605272 Z M191.291764,68.9559518 L115.029663,126.844525 L191.291764,184.733396 L191.291764,68.9559518 Z" id="path-1"></path>
+ <linearGradient x1="50.0000484%" y1="-3.91645412e-07%" x2="50.0000484%" y2="99.999921%" id="linearGradient-3">
+ <stop stop-color="#FFFFFF" offset="0%"></stop>
+ <stop stop-color="#FFFFFF" stop-opacity="0" offset="100%"></stop>
+ </linearGradient>
+ </defs>
+ <g>
+ <mask id="mask-2" fill="white">
+ <use xlink:href="#path-1"></use>
+ </mask>
+ <g></g>
+ <path d="M246.134784,26.873337 L193.593025,1.57523773 C187.51178,-1.35300582 180.243173,-0.117807811 175.469819,4.65514684 L3.46641717,161.482221 C-1.16004072,165.700742 -1.1547215,172.984291 3.47789235,177.19584 L17.5276804,189.967949 C21.3150858,193.411497 27.0189053,193.664509 31.0966765,190.571591 L238.228667,33.4363005 C245.177523,28.1646927 255.158535,33.1209324 255.158535,41.8432608 L255.158535,41.2332436 C255.158535,35.11066 251.651235,29.5293619 246.134784,26.873337 Z" fill="#0065A9" fill-rule="nonzero" mask="url(#mask-2)"></path>
+ <path d="M246.134784,226.816011 L193.593025,252.11419 C187.51178,255.041754 180.243173,253.806579 175.469819,249.034221 L3.46641717,92.2070273 C-1.16004072,87.9888047 -1.1547215,80.7049573 3.47789235,76.4935082 L17.5276804,63.7209012 C21.3150858,60.2778506 27.0189053,60.0243409 31.0966765,63.1179565 L238.228667,220.252649 C245.177523,225.524058 255.158535,220.568416 255.158535,211.84549 L255.158535,212.456104 C255.158535,218.57819 251.651235,224.159388 246.134784,226.816011 Z" fill="#007ACC" fill-rule="nonzero" mask="url(#mask-2)"></path>
+ <path d="M193.428324,252.134497 C187.345086,255.060069 180.076479,253.823898 175.303125,249.050544 C181.184153,254.931571 191.240868,250.765843 191.240868,242.448334 L191.240868,11.2729623 C191.240868,2.95542269 181.184153,-1.21005093 175.303125,4.67135981 C180.076479,-0.102038107 187.345086,-1.3389793 193.428324,1.58667934 L245.961117,26.8500144 C251.481553,29.5046448 254.991841,35.0879351 254.991841,41.2132082 L254.991841,212.509283 C254.991841,218.634357 251.481553,224.217548 245.961117,226.872178 L193.428324,252.134497 Z" fill="#1F9CF0" fill-rule="nonzero" mask="url(#mask-2)"></path>
+ <path d="M180.827889,252.605272 C184.8442,254.169163 189.424309,254.069552 193.477476,252.11917 L245.978395,226.855855 C251.495842,224.201225 255.004138,218.618034 255.004138,212.49296 L255.004138,41.1969853 C255.004138,35.0717121 251.495842,29.4884219 245.979391,26.8337915 L193.477476,1.57052613 C188.158255,-0.989423064 181.931578,-0.362396387 177.261819,3.03217656 C176.595422,3.51710232 175.959904,4.05852738 175.363235,4.65519664 L74.8565395,96.3496452 L31.0777504,63.1179565 C27.0024695,60.0244405 21.3020368,60.2779503 17.517022,63.7209012 L3.4757806,76.4935082 C-1.15402423,80.7050569 -1.15933349,87.9888047 3.46431539,92.2071269 L41.4308088,126.844525 L3.46431539,161.482221 C-1.15933349,165.700742 -1.15402423,172.984291 3.4757806,177.19584 L17.517022,189.967949 C21.3020368,193.411497 27.0024695,193.664509 31.0777504,190.571591 L74.8565395,157.339404 L175.363235,249.034221 C176.953025,250.625007 178.820729,251.823326 180.827889,252.605272 Z M191.292013,68.9557526 L115.029912,126.844525 L191.292013,184.733396 L191.292013,68.9557526 Z" fill-opacity="0.25" fill="url(#linearGradient-3)" mask="url(#mask-2)"></path>
+ </g>
+</svg>
diff --git a/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.test.tsx
index c37e6fd9df..42ca362735 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.test.tsx
@@ -326,6 +326,24 @@ it("offers the project's real launchers and runs them", async () => {
await waitFor(() => expect(openProjectIn).toHaveBeenCalledWith("p1", "remote"));
});
+it("shows VS Code and Cursor with their logos and greys out the one not installed", async () => {
+ fetchProjectLaunchers.mockResolvedValue({
+ file_manager: true, remote_url: null, remote_label: null,
+ editors: [{ id: "code", label: "VS Code", installed: true }, { id: "cursor", label: "Cursor", installed: false }],
+ });
+ render(<IdeProjectTree />);
+ fireEvent.click(screen.getByRole("button", { name: "Project actions for App" }));
+ const vscode = await screen.findByTestId("ide-project-menu-editor-code");
+ const cursor = screen.getByTestId("ide-project-menu-editor-cursor");
+ expect((vscode as HTMLButtonElement).disabled).toBe(false);
+ expect(screen.getByTestId("ide-project-menu-editor-code-logo").className).not.toContain("grayscale");
+ expect((cursor as HTMLButtonElement).disabled).toBe(true);
+ expect(cursor.textContent).toBe("Open in CursorNot installed");
+ expect(screen.getByTestId("ide-project-menu-editor-cursor-logo").className).toContain("grayscale");
+ fireEvent.click(cursor);
+ expect(openProjectIn).not.toHaveBeenCalled();
+});
+
it("hides launchers the backend cannot offer", async () => {
fetchProjectLaunchers.mockRejectedValue(new Error("Not Found"));
render(<IdeProjectTree />);
diff --git a/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.tsx b/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.tsx
index 127c3a99bd..b2aacd936e 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.tsx
@@ -7,6 +7,8 @@ import { useComputerChoices } from "@/hooks/useComputers";
import { addTerminal, fetchWorkspacePanes, interruptTerminal, placeWorkspace, removeWorkspace, renameWorkspace, startIdeSession, IdeApiError, reorderWorkspaces, type IdeProject, type ProjectWorkspace, type WorkspacePaneRow } from "@/lib/agenticIdeApi";
import { useEventStore } from "@/store/events";
import { useIdeProjectsStore } from "@/store/ideProjects";
+import cursorLogo from "@/assets/editors/cursor.svg?url";
+import vscodeLogo from "@/assets/editors/vscode.svg?url";
const EXPANSION_KEY = "jarvis.ide.projectExpansion.v1";
const WORKSPACE_DRAG_MIME = "application/x-jarvis-workspace-id";
@@ -668,14 +670,18 @@ export function IdeProjectTree() {
const run = (action: () => void) => () => { setContextMenu(null); action(); };
- /** Up to two installed editors and the hosted remote, as menu items. */
+ /** VS Code, Cursor (greyed when not installed) and the hosted remote, as menu items. */
const launcherItems = (project: IdeProject, scope: "project" | "workspace"): TreeMenuItem[] => {
const found = launchers[project.id];
if (!found) return [];
- const items: TreeMenuItem[] = found.editors.slice(0, 2).map((editor) => ({
- id: `editor-${editor.id}`, label: `Open in ${editor.label}`, icon: SquareCode, testId: `ide-${scope}-menu-editor-${editor.id}`,
- onSelect: run(() => void openIn(project.id, editor.id)),
- }));
+ const items: TreeMenuItem[] = found.editors.map((editor) => {
+ const installed = editor.installed !== false;
+ return {
+ id: `editor-${editor.id}`, label: `Open in ${editor.label}`, icon: SquareCode, image: EDITOR_LOGOS[editor.id],
+ testId: `ide-${scope}-menu-editor-${editor.id}`, disabled: !installed, hint: installed ? undefined : "Not installed",
+ onSelect: run(() => void openIn(project.id, editor.id)),
+ };
+ });
if (scope === "project" && found.file_manager) {
items.push({ id: "reveal", label: FILE_MANAGER_LABEL, icon: FolderOpen, testId: "ide-project-menu-reveal", onSelect: run(() => void revealFolder(project.id)) });
}
@@ -855,12 +861,16 @@ const FILE_MANAGER_LABEL = (() => {
return "Show in file manager";
})();
const TREE_MENU_MARGIN = 8;
+/** Each featured editor's own app icon, in its real colours. */
+const EDITOR_LOGOS: Record<string, string> = { code: vscodeLogo, cursor: cursorLogo };
/** One row of the sidebar's action menu. */
interface TreeMenuItem {
id: string;
label: string;
icon: LucideIcon;
+ /** A brand mark drawn instead of `icon`; greyed out with the item when disabled. */
+ image?: string;
testId: string;
onSelect: () => void;
disabled?: boolean;
@@ -981,7 +991,10 @@ function TreeContextMenu({
: "text-foreground hover:bg-muted focus-visible:bg-muted"
}`}
>
- <Icon aria-hidden className={`h-4 w-4 shrink-0 ${item.destructive ? "" : "text-muted-foreground"}`} />
+ {item.image
+ ? <img src={item.image} alt="" aria-hidden draggable={false} data-testid={`${item.testId}-logo`}
+ className={`h-4 w-4 shrink-0 object-contain ${item.disabled ? "grayscale" : ""}`} />
+ : <Icon aria-hidden className={`h-4 w-4 shrink-0 ${item.destructive ? "" : "text-muted-foreground"}`} />}
<span className="flex min-w-0 flex-1 flex-col">
<span className="truncate">{item.label}</span>
{item.hint && <span className="truncate text-[11px] text-muted-foreground">{item.hint}</span>}
diff --git a/jarvis/ui/web/frontend/src/lib/chatLibraryApi.ts b/jarvis/ui/web/frontend/src/lib/chatLibraryApi.ts
index 422c5aa9e8..f48d3159d0 100644
--- a/jarvis/ui/web/frontend/src/lib/chatLibraryApi.ts
+++ b/jarvis/ui/web/frontend/src/lib/chatLibraryApi.ts
@@ -153,7 +153,8 @@ export async function revealProject(projectId: string): Promise<boolean> {
/** Where a project's folder can be opened on this machine right now. */
export interface ProjectLaunchers {
file_manager: boolean;
- editors: { id: string; label: string }[];
+ /** `installed: false` marks a featured editor this computer does not have. */
+ editors: { id: string; label: string; installed?: boolean }[];
remote_url: string | null;
remote_label: string | null;
}
diff --git a/jarvis/ui/web/outputs_routes.py b/jarvis/ui/web/outputs_routes.py
index 63ab0af9e0..5d0a2d33a0 100644
--- a/jarvis/ui/web/outputs_routes.py
+++ b/jarvis/ui/web/outputs_routes.py
@@ -1221,19 +1221,80 @@ def _macos_app_present(display_name: str) -> bool:
return False
+def _editor_install_candidates(app_id: str) -> list[Path]:
+ """The standard install locations of VS Code and Cursor on this OS.
+
+ Checked before the generic resolver so the editor's own GUI executable is
+ found even when its shell command is not on ``PATH`` (a GUI-launched
+ backend often has a short ``PATH``) and so Windows launches ``Code.exe`` /
+ ``Cursor.exe`` rather than the ``.cmd`` shim. macOS is not listed: its
+ ``.app`` bundles resolve through ``open -a``.
+ """
+ plat = detect_platform()
+ home = Path.home()
+ if plat == "win32":
+ local = Path(os.environ.get("LOCALAPPDATA") or home / "AppData" / "Local")
+ program_dirs = [
+ Path(value)
+ for value in (os.environ.get("ProgramFiles"), os.environ.get("ProgramFiles(x86)"))
+ if value
+ ]
+ if app_id == "code":
+ return [
+ base / "Microsoft VS Code" / "Code.exe"
+ for base in (local / "Programs", *program_dirs)
+ ]
+ if app_id == "cursor":
+ return [local / "Programs" / "cursor" / "Cursor.exe"] + [
+ base / "Cursor" / "Cursor.exe" for base in program_dirs
+ ]
+ return []
+ if plat == "linux":
+ flatpak_bins = [
+ Path("/var/lib/flatpak/exports/bin"),
+ home / ".local" / "share" / "flatpak" / "exports" / "bin",
+ ]
+ if app_id == "code":
+ return [
+ Path("/usr/bin/code"),
+ Path("/usr/share/code/code"),
+ Path("/snap/bin/code"),
+ *(base / "com.visualstudio.code" for base in flatpak_bins),
+ ]
+ if app_id == "cursor":
+ appimages = sorted((home / "Applications").glob("[Cc]ursor*.AppImage"), reverse=True)
+ return [
+ Path("/usr/bin/cursor"),
+ Path("/usr/share/cursor/cursor"),
+ Path("/opt/Cursor/cursor"),
+ Path("/opt/cursor/cursor"),
+ home / ".local" / "bin" / "cursor",
+ *appimages,
+ ]
+ return []
+
+
def _resolve_installed(app_id: str) -> tuple[str, str] | None:
"""Resolve *app_id* to a launch ``(kind, value)`` IFF it is actually
installed, else None. Distinguishes a real resolution (executable / a
Start-Menu ``.lnk`` / a present macOS ``.app``) from the resolver's
raw-name ``startfile`` fallback, which just means "not found"."""
- from jarvis.plugins.tool.app_resolver import resolve_app_launch_target
+ from jarvis.plugins.tool.app_resolver import (
+ launch_services_can_open,
+ resolve_app_launch_target,
+ )
+ for candidate in _editor_install_candidates(app_id):
+ if candidate.is_file() and os.access(candidate, os.X_OK):
+ return ("executable", str(candidate))
target = resolve_app_launch_target(app_id)
if target.kind == "executable":
return (target.kind, target.value)
if target.kind == "startfile" and target.value.lower().endswith(".lnk"):
return (target.kind, target.value)
- if target.kind == "open_a" and _macos_app_present(target.value):
+ if target.kind == "open_a" and (
+ _macos_app_present(target.value) or launch_services_can_open({target.value})
+ ):
return (target.kind, target.value)
return None
diff --git a/tests/unit/agentic_ide/test_chat_library_routes.py b/tests/unit/agentic_ide/test_chat_library_routes.py
index 1ad374aeb3..d07c0554d1 100644
--- a/tests/unit/agentic_ide/test_chat_library_routes.py
+++ b/tests/unit/agentic_ide/test_chat_library_routes.py
@@ -308,12 +308,40 @@ def test_launchers_list_only_what_is_available(
body = client.get(f"/api/chat-library/projects/{project.id}/launchers").json()
assert body == {
"file_manager": True,
- "editors": [{"id": "cursor", "label": "Cursor"}],
+ "editors": [
+ {"id": "code", "label": "VS Code", "installed": False},
+ {"id": "cursor", "label": "Cursor", "installed": True},
+ ],
"remote_url": "https://github.com/me/app",
"remote_label": "GitHub",
}
+def test_launchers_offer_another_editor_only_without_vs_code_and_cursor(
+ client: TestClient, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ from jarvis.agentic_ide import project_links
+ from jarvis.ui.web import outputs_routes
+
+ monkeypatch.setattr(
+ outputs_routes,
+ "_available_openers",
+ lambda: [
+ {"id": "default", "label": "System default app"},
+ {"id": "zed", "label": "Zed"},
+ ],
+ )
+ monkeypatch.setattr(project_links, "remote_web_url", lambda folder: None)
+ client.app.state.native_file_actions = True
+ project = library.ensure_project(tmp_path)
+ body = client.get(f"/api/chat-library/projects/{project.id}/launchers").json()
+ assert body["editors"] == [
+ {"id": "code", "label": "VS Code", "installed": False},
+ {"id": "cursor", "label": "Cursor", "installed": False},
+ {"id": "zed", "label": "Zed", "installed": True},
+ ]
+
+
def test_launchers_are_empty_on_a_headless_host(client: TestClient, tmp_path: Path) -> None:
project = library.ensure_project(tmp_path)
body = client.get(f"/api/chat-library/projects/{project.id}/launchers").json()
@@ -336,3 +364,34 @@ def test_open_in_remote_needs_a_remote(client: TestClient, tmp_path: Path) -> No
f"/api/chat-library/projects/{project.id}/open-in", json={"target": "remote"}
)
assert response.status_code == 404
+
+
+def test_editors_resolve_from_their_standard_install_folder_on_windows(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ from jarvis.ui.web import outputs_routes
+
+ monkeypatch.setattr(outputs_routes, "detect_platform", lambda: "win32")
+ monkeypatch.setenv("LOCALAPPDATA", str(tmp_path))
+ monkeypatch.delenv("ProgramFiles", raising=False)
+ monkeypatch.delenv("ProgramFiles(x86)", raising=False)
+ exe = tmp_path / "Programs" / "cursor" / "Cursor.exe"
+ exe.parent.mkdir(parents=True)
+ exe.write_bytes(b"")
+ exe.chmod(0o755)
+ assert outputs_routes._resolve_installed("cursor") == ("executable", str(exe))
+
+
+def test_cursor_appimage_counts_as_installed_on_linux(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ from jarvis.ui.web import outputs_routes
+
+ monkeypatch.setattr(outputs_routes, "detect_platform", lambda: "linux")
+ monkeypatch.setattr(outputs_routes.Path, "home", lambda: tmp_path)
+ image = tmp_path / "Applications" / "Cursor-1.7.0-x86_64.AppImage"
+ image.parent.mkdir()
+ image.write_bytes(b"")
+ image.chmod(0o755)
+ assert str(image) in [str(p) for p in outputs_routes._editor_install_candidates("cursor")]
+ assert outputs_routes._editor_install_candidates("zed") == []