Add environment-first new task flow on mobile#4447
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:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
2d96724 to
355a74a
Compare
ApprovabilityVerdict: Needs human review 1 blocking correctness issue found. New feature introducing an environment-first task creation flow on mobile with new screens, navigation changes, and business logic. Multiple unresolved comments identify potential bugs in loading states and navigation stack handling. You can customize Macroscope's approvability policy. Learn more. |
355a74a to
06d4dbd
Compare
61fee70 to
0bad292
Compare
| }; | ||
| } | ||
|
|
||
| return { |
There was a problem hiding this comment.
🟡 Medium threads/newTaskPicker.ts:155
deriveNewTaskPickerEmptyState shows "No projects found" while projects are still loading. When an environment is already connected and its first shell snapshot is synchronizing, hasLoadedShellSnapshot is false but hasConnectingEnvironment is also false, so none of the earlier branches match and the function falls through to the "No projects found" fallback. The picker presents an empty catalog and offers "Add new project" until the snapshot arrives.
The same fallback is reached when all connections stay healthy but the shell subscription fails before producing any snapshot. catalogState.shellSnapshotError is never checked, so users are told the catalog is genuinely empty instead of seeing the load failure.
Consider checking hasPendingShellSnapshot to show a loading state, and checking shellSnapshotError before falling through to "No projects found".
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/mobile/src/features/threads/newTaskPicker.ts around line 155:
`deriveNewTaskPickerEmptyState` shows "No projects found" while projects are still loading. When an environment is already connected and its first shell snapshot is synchronizing, `hasLoadedShellSnapshot` is `false` but `hasConnectingEnvironment` is also `false`, so none of the earlier branches match and the function falls through to the "No projects found" fallback. The picker presents an empty catalog and offers "Add new project" until the snapshot arrives.
The same fallback is reached when all connections stay healthy but the shell subscription fails before producing any snapshot. `catalogState.shellSnapshotError` is never checked, so users are told the catalog is genuinely empty instead of seeing the load failure.
Consider checking `hasPendingShellSnapshot` to show a loading state, and checking `shellSnapshotError` before falling through to "No projects found".
| environmentId, | ||
| incomingShareId: props.incomingShareId, | ||
| }) | ||
| : StackActions.replace("NewTask", { incomingShareId: props.incomingShareId }), |
There was a problem hiding this comment.
Draft fallback duplicates project screen
Medium Severity
When the draft screen falls back to NewTaskProject, StackActions.replace can leave a duplicate NewTaskProject route on the stack if one already existed. This causes back navigation to return to a stale project picker instead of the environment stage.
Reviewed by Cursor Bugbot for commit 0bad292. Configure here.
| Add new project | ||
| </Text> | ||
| </Pressable> | ||
| )} |
There was a problem hiding this comment.
Loading empty state still shows CTAs
Medium Severity
The new environment empty state shows "Add environment" or "Add new project" buttons while emptyState.loading is true. This contradicts the loading messages and could prompt users to add items prematurely.
Reviewed by Cursor Bugbot for commit 0bad292. Configure here.
An environment connection can stay `connected` while its shell subscription fails, which left the project picker rendering a spinner and "Loading projects" with no way to learn why projects never arrive. Report the shell error before falling through to the loading state, and keep cached snapshots on the existing empty-catalog message. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…icked The project picker showed the "Add environment" call to action whenever the chosen environment was not connected with a shell snapshot, so a still-loading or unreachable environment pushed users toward creating a new connection instead of working with the one they just selected. Derive the empty state action explicitly: no action while loading or while the selected environment is unavailable, "Add environment" only when no environment is selected, and "Add new project" once the selected environment is ready. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0bad292 to
7013878
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7013878. Configure here.
| title: "No projects found", | ||
| detail: "The connected environment did not report any projects.", | ||
| loading: false, | ||
| }; |
There was a problem hiding this comment.
Premature empty environment state
Medium Severity
deriveNewTaskPickerEmptyState only treats connection-phase connecting as loading. Once an environment is connected but its shell is still synchronizing (or failed) with no snapshot, it falls through to “No projects found”. The new environment picker then also always shows an Add CTA, so users can be pushed to add a project while projects are still loading.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 7013878. Configure here.


What Changed
Why
This brings the mobile new-task flow in line with #4426: users explicitly choose where a task will run before choosing the project.
UI Changes
All shots: Android emulator (Pixel 6, API 35), light theme, same device and seeded environments for every image.
Environment-first new task flow (new behavior)
Step 1 — choose the environment:
Step 2 — choose a project, scoped to that environment:
Empty-state call to action when the selected environment is not ready
Same state in both images: an environment was already chosen from step 1, and its project list has not arrived yet.
Before — the picker offered "Add environment", pushing the user toward creating another connection instead of working with the one they had just selected:
After — no call to action while the selected environment is loading or unavailable; the back chevron to the environment picker is still the escape hatch:
Verification
vp test run apps/mobile/src/features/threads/newTaskPicker.test.ts(2 tests)vp run --filter @t3tools/mobile typecheckvp run lint:mobile(native linters unavailable on Linux; generated native projects skipped)vp check(zero errors; existing web warnings only)vp run typecheckNote
Medium Risk
Changes core navigation and deep-link paths for new tasks and share continuation; logic is covered by unit tests but multi-environment UX regressions are possible.
Overview
Mobile new-task creation is now environment → project → draft, instead of picking a project across all environments in one list.
The
NewTasksheet route opens a new Choose environment screen that lists only environments with at least one logical project (with counts). Project selection moves toNewTaskProjectwith a requiredenvironmentId(deep link:new/projects/:environmentId).Project lists are scoped to the chosen environment via shared
newTaskPickerhelpers, so duplicate repos on different machines no longer collapse into a single misleading choice.Empty states and CTAs are environment-aware: the project step uses per-environment shell/connection state (
useEnvironmentShellState), surfaces shell sync failures instead of spinning forever, and drops “Add environment” while a specific environment is selected, loading, or unavailable.Incoming share and add project flows pass
environmentIdthrough navigation; draft fallback returns toNewTaskProjectwhen the initial project is missing. Reserved share destinations still auto-skip to draft.Reviewed by Cursor Bugbot for commit 7013878. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add environment-first new task flow on mobile
NewTaskroute now renders the environment picker; project selection moves to a newNewTaskProjectsub-route with anenvironmentIdparam, which affects deep-link patterns.Macroscope summarized 7013878.