Skip to content

fix(clients): disable add project while disconnected - #4834

Open
StiensWout wants to merge 2 commits into
pingdotgg:mainfrom
StiensWout:agent/disable-add-project-when-disconnected
Open

fix(clients): disable add project while disconnected#4834
StiensWout wants to merge 2 commits into
pingdotgg:mainfrom
StiensWout:agent/disable-add-project-when-disconnected

Conversation

@StiensWout

@StiensWout StiensWout commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What changed

  • disable unavailable environments in the web and mobile add-project pickers
  • only select connected environments as add-project targets
  • guard browse, clone, and create submission if the environment disconnects while the flow is open
  • hide mobile add-project header actions when no environment is connected

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.ts
  • vp run --filter @t3tools/client-runtime --filter @t3tools/web --filter @t3tools/mobile typecheck
  • targeted lint and formatting for the changed files

Generated by GPT-5.6-sol via the T3 Code Codex harness.

Note

Disable add project actions when no environment is connected

  • Adds canCreateProjectInEnvironment in packages/client-runtime/src/operations/projects.ts as the canonical check for whether an environment's connection phase is 'connected'.
  • Environment option types in both the mobile and web clients are extended to include connection state; disconnected environments are disabled and annotated with status text in the add-project UI.
  • The 'Add project' button in NewTaskRouteScreen is hidden when no ready environment exists; the command palette add-project flow blocks or shows error toasts for disconnected environments.
  • useCreateProject and useEnvironmentFromParam guard against disconnected environments, returning null instead of proceeding.
  • Behavioral Change: previously, users could attempt to add a project in a disconnected environment; now those paths are blocked with empty states or error toasts.

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 canCreateProjectInEnvironment in client-runtime so only environments in the connected phase 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 when hasReadyEnvironment is 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.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: af6cadc6-bc52-434a-9e66-aed887002aee

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Jul 29, 2026
@github-actions github-actions Bot added the size:L 100-499 changed lines (additions + deletions). label Jul 29, 2026
@StiensWout
StiensWout force-pushed the agent/disable-add-project-when-disconnected branch from 22ed672 to 308dbd3 Compare July 29, 2026 12:20
Comment thread apps/mobile/src/features/projects/AddProjectScreen.tsx Outdated
@StiensWout
StiensWout marked this pull request as ready for review July 29, 2026 12:23

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ 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.

Comment thread apps/mobile/src/features/projects/AddProjectScreen.tsx Outdated
Comment thread apps/mobile/src/features/projects/AddProjectScreen.tsx
@macroscopeapp

macroscopeapp Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant