From cf9a56460cbe0b74ac676c116d808e337b5c5d3c Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Sat, 4 Jul 2026 06:38:03 -0700 Subject: [PATCH] Treat empty workspaceRoot as null when matching hosts by basename A pending-task placeholder project has workspaceRoot "" when no cwd was snapshotted; an "" basename rejected every real host, emptying the environment picker for that queued task. Co-Authored-By: Claude Fable 5 --- apps/mobile/src/features/threads/new-task-flow-provider.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/mobile/src/features/threads/new-task-flow-provider.tsx b/apps/mobile/src/features/threads/new-task-flow-provider.tsx index 1590728b92..ee2bde9d97 100644 --- a/apps/mobile/src/features/threads/new-task-flow-provider.tsx +++ b/apps/mobile/src/features/threads/new-task-flow-provider.tsx @@ -283,7 +283,9 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) { // identity is the primary signal; projects that haven't reported one yet (still // indexing) fall back to workspace basename / title so a valid host isn't hidden. const selectedRepositoryKey = selectedProject?.repositoryIdentity?.canonicalKey ?? null; - const selectedWorkspaceBasename = selectedProject?.workspaceRoot.split("/").at(-1) ?? null; + // `|| null` (not `??`): a pending-task placeholder project can have an empty + // workspaceRoot, and an "" basename would reject every real host below. + const selectedWorkspaceBasename = selectedProject?.workspaceRoot.split("/").at(-1) || null; const selectedProjectTitle = selectedProject?.title ?? null; const environments = useMemo(() => { const seen = new Set(); @@ -510,7 +512,7 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) { // indexed) fall back to workspace basename, then title, so switching // computers still follows the same repo instead of resetting to // whatever project is first on the target machine. - const workspaceBasename = selectedProject?.workspaceRoot.split("/").at(-1) ?? null; + const workspaceBasename = selectedProject?.workspaceRoot.split("/").at(-1) || null; const match = (repositoryKey !== null ? projectsOnTarget.find(