fix(clients): disable add project while disconnected - #4834
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
22ed672 to
308dbd3
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 308dbd3. Configure here.
ApprovabilityVerdict: Approved 5226075 This PR adds defensive UI behavior to disable project creation when environments are disconnected. The core logic is a simple connection state check, with unit tests covering the new helper functions. The changes are well-scoped and low-risk. You can customize Macroscope's approvability policy. Learn more. |

What changed
Why
Configured environments remain in the connection catalog while offline. The add-project UI treated catalog membership as availability, so users could enter a flow that could only fail when the RPC layer rejected the disconnected request.
This keeps configured environments visible where useful, but prevents project creation until the target reports a connected phase.
Impact
Web, desktop, and mobile now consistently prevent project creation against disconnected environments. Existing RPC rejection remains as the final safety boundary.
Validation
vp test run packages/client-runtime/src/operations/projects.test.ts packages/client-runtime/src/state/filesystem.test.tsvp run --filter @t3tools/client-runtime --filter @t3tools/web --filter @t3tools/mobile typecheckGenerated by GPT-5.6-sol via the T3 Code Codex harness.
Note
Disable add project actions when no environment is connected
canCreateProjectInEnvironmentinpackages/client-runtime/src/operations/projects.tsas the canonical check for whether an environment's connection phase is'connected'.NewTaskRouteScreenis hidden when no ready environment exists; the command palette add-project flow blocks or shows error toasts for disconnected environments.useCreateProjectanduseEnvironmentFromParamguard against disconnected environments, returning null instead of proceeding.Macroscope summarized 5226075.
Note
Low Risk
UX and client-side guards around add-project; no auth or data-model changes, with existing RPC rejection as backup.
Overview
Introduces
canCreateProjectInEnvironmentin client-runtime so only environments in theconnectedphase can be used for add-project flows.Mobile enriches environment options with live connection state, disables unavailable rows with status text, and picks targets via
resolveAddProjectEnvironment(explicit offline IDs are not silently swapped). Repository/local/clone screens show an empty state when no connected target exists; create is blocked if the environment drops mid-flow. The new-task Add project header action is hidden whenhasReadyEnvironmentis false.Web command palette mirrors this: disconnected environments are disabled with status labels, defaults and WSL options require a connected env, and browse/clone/create/submit paths toast Environment unavailable instead of proceeding.
Reviewed by Cursor Bugbot for commit 5226075. Bugbot is set up for automated code reviews on this repo. Configure here.