Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The mobile “No project” row remains visible during environment synchronization and explains when it is waiting or unavailable. Task creation remains gated on a connected, configured environment and an explicit user action. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
AI-assisted; verified with the tests and tools listed above.
Problem
On mobile, Choose project first lists the projects without the No project row while an environment is still syncing. When the server config arrives, the row is inserted at the top and every project moves down one row, so a tap aimed at a project can land on No project instead.
#23391 meant to fix this by reserving the row, but only once the environment's server config is known (cached or live). Projects come from the shell cache, which is often ready before the config, so the shift still happens on cold start, after the config cache is cleared, and on a fresh pairing.
This qualifies as a small, focused fix for an obvious bug: one picker row, no change to what the row does once ready, and it completes what #23391 already set out to do.
Fix
resolveNewTaskScratchOptionnow reserves the row whenever an enabled, supported environment is listed, and returns a status instead of areadyflag. Disabled and unsupported environments are ignored, since they never receive a config and would otherwise hold the row pending forever.ready: an environment is connected and reports a scratch folder. Row enabled, as before.pending: no environment is ready yet. Row disabled, subtitle Waiting for your environment.unavailable: every environment is connected and reports no scratch folder (the server refuses to create it inside a git checkout). Row stays disabled with Not available on this environment rather than disappearing, so the list does not shift the other way either.The environment chosen for the row keeps the same preference order (ready, then cached, then any). Only
NewTaskRouteScreenreads it.Verification
vp test run apps/mobile/src/features/threads/new-task-project-selection.test.ts: 24 passed. The new case "reserves the option before any config arrives" fails onmain(it returnsnull). Existing cases are updated to the status shape. Added cases coverunavailable, a mixed connected and connecting pair that stayspending, and disabled or unsupported environments being ignored.vp run check:changed: format, lint, knip, typecheck, tests and React compiler pass.server-configrow, relaunch, open Choose project, start the server.main): the list shows no No project row. When the app reconnects, the row is inserted at the top and the projects shift down one row.mainit is hidden.Syncing (before, after, changed pixels). On
mainthe row is missing, with the fix it is reserved and disabled:Synced. Same final layout, 0.0% changed pixels:
Server without a scratch folder (after):
Reconnect, before: the row is inserted and the projects jump down (mp4)
Reconnect, after: the row turns on in place (mp4)
Not checked: Android, since no Android SDK is available on this machine. The Android row uses the same
scratchSubtitleanddisabledprops throughNavigationRow. The web new-thread picker has a similar gate on a known scratch root, but the server it talks to is usually local and its config is ready at once. It is left out to keep this PR to the reported mobile problem.Written by Claude Opus 5.5 in Claude Code.