Skip to content

fix(mobile): project picker starts a chat in an open copy, not an archived one - #38984

Merged
juliusmarminge merged 6 commits into
pingdotgg:mainfrom
StiensWout:t3/1168-the-mobile-project-picker-can-start-a-ch
Nov 19, 2026
Merged

juliusmarminge merged 6 commits into
pingdotgg:mainfrom
StiensWout:t3/1168-the-mobile-project-picker-can-start-a-ch

Conversation

@StiensWout

Copy link
Copy Markdown
Contributor

The project picker could start a chat in an archived copy on the preferred machine even when the same repository had an open copy. Mobile, web, and desktop now rank only open copies, and the command palette applies the same rule before reusing the current project. Archived copies stay in the group for navigating existing threads.

Fixes #38983

Reproduction on main

Commit 8cf97b5f06 (main), in the running app:

  1. Install the iOS app built from main and open it.
  2. Connect two environments, name them Mac and Server, and leave both connected.
  3. On Mac, put two folders on disk: a Git checkout of one repository, and a second folder that is a different project.
  4. On Server, put a second checkout of that same repository, with the same Git remote as the checkout on Mac.
  5. Tap New chat. On Choose project, tap Add project, choose Mac, tap Local folder, and add the shared checkout.
  6. Add the other folder on Mac the same way, and add Server's checkout of the shared repository the same way, choosing Server.
  7. Open Settings, tap General, and under Project grouping tap Keep separate.
  8. Open Settings, tap Projects, open the filter, and under environments turn off Server so only Mac remains.
  9. In that same filter, under projects, choose the shared repository.
  10. Under Organize, tap Archive project.
  11. Open the filter again, tap All connected environments, then open Settings, tap General, and under Project grouping tap Group by repository.
  12. On the thread list, tap Filter threads by project and choose the project that exists only on Mac.
  13. Tap New chat.
  14. On the new-thread screen, tap the project name in What should we build in.
  15. On Choose project, tap the shared repository, the row whose subtitle says 2 workspaces.
  16. Read the line under the project name that begins with on.

That line says on Mac, the machine whose copy of the repository was archived. Expected: That line says on Server, the machine whose copy of the repository is still open.

Followed in the app on iPhone 18 Pro (iOS 27.0): Choose project listed Shared with “2 workspaces.” After I selected it, New thread showed “on Mac” under Shared even though Mac’s checkout was archived and Server’s was still active.

The cause is at apps/mobile/src/features/threads/new-task-project-selection.ts:26. Ran cd apps/mobile && pnpm exec vp test run src/features/threads/new-task-project-selection.test.ts with the repro test added: it failed in 2 of 2 runs on a clean checkout, with expected 'archived-copy' to be 'open-copy' in the output.

Evidence

Environment: Linux x64, the repository's own tests; iPhone 18 Pro, iOS 27.0, iOS Simulator on macOS

Proven: the test fails on base f7041fabc8 and passes on head f78d98817a. Following the steps in the app on iPhone 18 Pro shows the bug on main at 8cf97b5f06 and not on head f78d98817a.

Before After
Commit f7041fabc8 f78d98817a
Result Fails, with expected 'archived-copy' to be 'open-copy' in the output Passes
Archived Mac checkout Before: Archived Mac checkout After: Archived Mac checkout
Shared in the project picker Before: Shared in the project picker After: Shared in the project picker
Environment on New thread Before: Environment on New thread After: Environment on New thread
Project picker reproduction Before: Project picker reproduction After: Project picker reproduction

Tests

  • e3f3a6c5a8 adds the failing test, alone, before the fix.
  • pnpm exec vp run check:changed passed on head.

Not in this change

  • The mobile picker’s workspace count still includes archived copies of a repository.
  • A mobile share draft with a single project group still selects the group’s representative, which may be archived.
  • New thread shortcuts that bypass the picker can still reuse the current workspace.

Who did the work

  • Confirmed by Grok 4.7, in Grok
  • Written by Claude Opus 5.5, in Claude Code
  • Review findings fixed by GPT 6.2 Sol, in Codex
  • Reviewed by Claude Opus 5.5, in Claude Code, and by GPT 6.2 Sol, in Codex, each on its own
  • Also reviewed by cubic, run locally by a program, with no score
  • Reproduced on the device, on main and on the head, by GPT 6.2 Sol, in Codex
  • Checks run by a program on base and head, not by an agent

Made in T3 Code by Grok 4.7, GPT 6.2 Sol and Claude Opus 5.5

StiensWout and others added 4 commits November 19, 2026 07:17
…ved one

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…hived one

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Grok 4.7 <noreply@x.ai>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 19, 2026
@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 19, 2026
juliusmarminge and others added 2 commits November 19, 2026 06:45
…s members

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Project grouping and picker selection now exclude archived copies when choosing a target. Mobile selection and the web command palette use an open copy when the preferred or contextual copy is archived.

Changes: Archived project copy selection

Layer / File(s) Summary
Shared pickability and sidebar selection
packages/client-runtime/src/state/projectGrouping.ts, apps/web/src/sidebarProjectGrouping.ts, apps/web/src/environmentGrouping.test.ts
isPickableProjectMember treats members with null or undefined archivedAt as pickable. A group is archived only when none of its members are pickable. Sidebar picker targets are selected from pickable members. The test checks that an archived copy remains in the group while the open copy is targeted.
Mobile project target selection
apps/mobile/src/features/threads/new-task-project-selection.ts, apps/mobile/src/features/threads/new-task-project-selection.test.ts
The mobile selector filters out archived members, returns a matching remembered copy when available, and ranks remaining members by preferred environment and representative. It selects a connected member when available, or the first ranked member. The test verifies that an open copy is selected over an archived copy on the preferred environment.
Command palette target selection
apps/web/src/components/CommandPalette.tsx, apps/web/src/components/CommandPalette.browser.test.tsx
The command palette uses the contextual project only when it belongs to the selected group and is pickable; otherwise, it uses the selected project. The test verifies that a new thread uses the open copy when the active thread belongs to an archived copy.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: t3dotgg, juliusmarminge

Merge Risk: Minimal · up to 74435

Project pickers now start chats in an open copy instead of an archived one when an open copy exists. The change is narrow and covered by tests. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the mobile project picker and the fix: it starts a chat in an open copy rather than an archived one. The raw summary shows the change centers on that selection logic in apps/mobile, bu…
Description check Passed The description follows the template well. It states the problem, the change, and the scope with a linked issue (#38983). It gives detailed reproduction steps, before/after evidence with a test on bas…
Linked Issues check Passed Issue #38983 requires the mobile project picker to start a new thread in an open copy when a repository group has an archived copy on the preferred machine. At head 74435c8, apps/mobile/src/feature…
Out of Scope Changes check Passed The issue scopes the bug to apps/mobile. The PR also changes shared and web code: packages/client-runtime/src/state/projectGrouping.ts (adds isPickableProjectMember and marks a group archived only whe…
Full details: Title check

Explanation

The title names the mobile project picker and the fix: it starts a chat in an open copy rather than an archived one. The raw summary shows the change centers on that selection logic in apps/mobile, but also covers web and client-runtime grouping. The title matches the primary change and is specific. It uses a conventional commit prefix and avoids vague terms.

Full details: Description check

Explanation

The description follows the template well. It states the problem, the change, and the scope with a linked issue (#38983). It gives detailed reproduction steps, before/after evidence with a test on base and head, and verification commands. It also lists the model and harness used, as the template asks. Minor gaps: the Scope section does not say explicitly why the fix is a bug fix rather than a feature, and the Change section is brief on how web, desktop, and the command palette are affected. The Verification section also says the check passed on head but does not report the mobile test result as a full run.

Full details: Linked Issues check

Explanation

Issue #38983 requires the mobile project picker to start a new thread in an open copy when a repository group has an archived copy on the preferred machine. At head 74435c8, apps/mobile/src/features/threads/new-task-project-selection.ts filters scope members with isPickableProjectMember before ranking. selectOpenProjectScopeMember ranks the preferred environment first, then the representative, and prefers a connected member. getProjectScopeSelectionTarget and newTaskFilteredProject both call this helper. In the reproduction, the open Server copy is selected. An incremental diff of this file from previous head f78d988 to head returned no text change. The whole-PR diff and the incremental diff for other paths could not be read (changed blobs missing), so changes outside this file since the previous review are not verified. The regression test result is reported by the author; I did not run it. The issue lists no non-coding acceptance criteria.

Full details: Out of Scope Changes check

Explanation

The issue scopes the bug to apps/mobile. The PR also changes shared and web code: packages/client-runtime/src/state/projectGrouping.ts (adds isPickableProjectMember and marks a group archived only when no member is pickable), apps/web/src/sidebarProjectGrouping.ts, apps/web/src/components/CommandPalette.tsx, and related web tests. The mobile picker uses the shared isPickableProjectMember helper, so the shared change supports the mobile fix. The web changes apply the same open-copy rule, as the PR description states, and address the same archived-copy selection defect. The PR excludes three related gaps (mobile workspace count, single-group share-draft representative, and picker-bypassing shortcuts), so they do not count as scope violations. Incremental changes since the previous review could not be fully read, so this verdict relies on the PR summary and the unchanged mobile file.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f78d988 and 74435c8.

Files selected for processing: 1

  • apps/web/src/components/CommandPalette.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Proven on iOS and web: base selects archived Scenario; head selects Open workspace.

Create two connected environments containing Shared with the same Git origin, plus Unrelated only on Scenario. Choose Keep separate; turn off Open workspace in the initially all-selected Settings environment filter, leaving Scenario selected; select Shared and archive it. Restore all environments and repository grouping. Filter Chats to Unrelated → New chat → project name → Shared (2 workspaces).

Web also exercises the New thread command-palette submenu while an existing archived Shared thread is current, and the composer project-name picker. All three web paths show the same before/after difference.

Environment: pooled iPhone 18 Pro, 402×874 logical viewport; Chromium, 1280×800; light theme, fresh synthetic data and replay provider on both commits. Addresses and paths are redacted; archive state, filter checkmarks, names and destinations remain visible.

Capture Before After
Commit 94baff19c6 74435c8e8a
Archived Scenario checkout Before: Shared archived on Scenario After: Shared archived on Scenario
Archive filter Before: only Scenario selected After: only Scenario selected
Mobile destination Before: on Scenario After: on Open workspace
Mobile interaction Before recording After recording
Web archive precondition Before: Shared archived on Scenario After: Shared archived on Scenario
Web New thread picker Before: Scenario selected After: Open workspace selected
Web archived current-project context Before: archived context reused After: open workspace selected
Web composer picker Before: Scenario selected After: Open workspace selected
Web picker interaction Before After
Web archived-context interaction Before After
Web composer interaction Before After

Drivers: iOS scenario, web scenario, fixtures and redaction scripts, setup README, sanitized logs and verdicts.

Not shown:

  • Android and a standalone Electron session were not separately run; the changed mobile helper was exercised on iOS and the changed shared web/desktop components in Chromium.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 19, 2026
@juliusmarminge
juliusmarminge merged commit c9359f6 into pingdotgg:main Nov 19, 2026
60 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 19, 2026
HNRow pushed a commit to HNRow/r3code that referenced this pull request Nov 19, 2026
…hived one (pingdotgg#38984)

Co-authored-by: Grok 4.7 <noreply@x.ai>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c9359f6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: The mobile project picker can start a chat in an archived workspace

2 participants