Repository navigation
fix(mobile): hide worktrees outside git repos - #8289
jesse-merhi wants to merge 1 commit into
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:
Comment |
| let gitRepoStatus = taskFlow.isGitStatusKnown ? taskFlow.isGitRepo : null; | ||
| if (taskEnvironmentConnected && selectedProject.workspaceRoot !== "" && detectionRequired) { | ||
| taskFlow.setSubmitting(true); | ||
| const detection = await requestRepositoryDetection(selectedProject); |
There was a problem hiding this comment.
🟠 High threads/NewTaskDraftScreen.tsx:710
Two rapid Start presses both pass the initial taskFlow.submitting check before requestRepositoryDetection resolves, then both continue into createProjectThread, creating duplicate threads/turns from one draft. Add a synchronous in-flight ref (or equivalent lock) that is set before the await and cleared on every terminal path.
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/mobile/src/features/threads/NewTaskDraftScreen.tsx around line 710:
Two rapid Start presses both pass the initial `taskFlow.submitting` check before `requestRepositoryDetection` resolves, then both continue into `createProjectThread`, creating duplicate threads/turns from one draft. Add a synchronous in-flight ref (or equivalent lock) that is set before the await and cleared on every terminal path.
045222c to
432f7e8
Compare
432f7e8 to
851bf24
Compare
ApprovabilityVerdict: Would Approve Macroscope's review found this PR approvable — This is a focused mobile bug fix that reuses existing VCS status data to hide Git-only workspace controls and normalize non-repository tasks without schema or server changes. A separate unresolved High-severity finding flags duplicate submissions from rapid Start presses, representing an independent correctness risk that must be addressed. Not approved because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
|
Note 🤖 GPT-5.6 Sol responding on behalf of Theo We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together. We selected #7927 for non-Git mobile task creation. It falls back to the current checkout in the send path and rechecks queued tasks, while this branch forces local mode and hides the worktree controls. Hiding the full control is not in #7927, so we are keeping that presentation choice as reference rather than claiming that it landed. If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed. |
The mobile new-task composer offered worktree and branch controls for folders that were not Git repositories. This PR uses the existing VCS status stream and hides those controls when the selected folder is not a Git repository.
Confirmed non-Git folders are normalized to the current checkout with no branch or worktree metadata.
Change breakdown
Proof
Matched iPhone 17 Pro simulator captures use the same non-Git project, backend, light theme, and viewport.
How to verify
.gitdirectory.Implementation note
This reuses the existing status subscription. It adds no RPCs, contracts, server routes, or compatibility machinery.
Built with gpt-5.6-sol in T3 Code via the Codex harness.
Note
Low Risk
Scoped mobile new-task UI and workspace resolution only; no server or auth changes, with a unit test for the mode guard.
Overview
The mobile new-task composer no longer shows worktree or branch controls when the selected project folder is not a Git repository. Detection reuses the existing
vcsEnvironment.statussubscription;isGitRepois exposed on the new-task flow (defaulting to Git while status loads to avoid a flash).resolveNewTaskWorkspaceModeforceslocalwhenisRepois false, and branch/worktree draft fields are cleared on submit, queue, and workspace changes so non-Git tasks always start as current checkout with no branch or worktree metadata.Reviewed by Cursor Bugbot for commit 851bf24. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Hide workspace controls in
NewTaskDraftScreenfor non-Git reposresolveNewTaskWorkspaceModeto force workspace mode tolocalwhen the selected project is not a Git repositoryNewTaskFlowProviderfetches VCS status, clears branch and worktree selections for non-Git projects, and omits them from queued messagesNewTaskDraftScreenonly renders workspace controls whenisGitRepois trueNewTaskFlowProviderdefaultsisGitRepototruewhile the VCS status query loads, potentially flashing Git-only UI before it resolvesMacroscope summarized 851bf24.