The best way to control Claude Code, Codex and more from any computer or phone
fix(client-runtime): a disconnected machine's scratch folder no longer lists as a second "No project" (#30597)
Co-authored-by: DanielJBurbridge <36094258+DanielJBurbridge@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
tiliakoos committed
Nov 14, 2026 at 18:38 UTC
26bf047d5e676f6d92294f7c21a37313bde6d785
2 files changed
+18
-2
packages/client-runtime/src/state/projects.test.ts
new
+14
@@ -0,0 +1,14 @@
1
+import { describe, expect, it } from "vite-plus/test";
2
+
3
+import { isScratchProject } from "./projects.ts";
4
+
5
+describe("isScratchProject", () => {
6
+ it.each([null, undefined])(
7
+ "recognises a loaded scratch project when its environment offers no available root (%s)",
8
+ (scratchWorkspaceRoot) => {
9
+ const project = { workspaceRoot: "/remote/scratch", isScratch: true as const };
10
+
11
+ expect(isScratchProject(project, scratchWorkspaceRoot)).toBe(true);
12
+ },
13
+ );
14
+});
packages/client-runtime/src/state/projects.ts
+4
-2
@@ -136,11 +136,13 @@ export function findProjectByPath<T extends { workspaceRoot?: string; cwd?: stri
136
}
137
138
export function isScratchProject(
139
- project: { readonly workspaceRoot: string },
139
+ project: { readonly workspaceRoot: string; readonly isScratch?: true },
140
scratchWorkspaceRoot: string | null | undefined,
141
): boolean {
142
return (
143
- scratchWorkspaceRoot != null && findProjectByPath([project], scratchWorkspaceRoot) !== undefined
143
+ project.isScratch === true ||
144
+ (scratchWorkspaceRoot != null &&
145
+ findProjectByPath([project], scratchWorkspaceRoot) !== undefined)
146
);
147
}
148