Repository navigation
Closed
Closed
Copy link
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/mobile
Steps to reproduce
- Install the iOS app built from main and open it.
- Connect two environments, name them Mac and Server, and leave both connected.
- On Mac, put two folders on disk: a Git checkout of one repository, and a second folder that is a different project.
- On Server, put a second checkout of that same repository, with the same Git remote as the checkout on Mac.
- Tap New chat. On Choose project, tap Add project, choose Mac, tap Local folder, and add the shared checkout.
- Add the other folder on Mac the same way, and add Server's checkout of the shared repository the same way, choosing Server.
- Open Settings, tap General, and under Project grouping tap Keep separate.
- Open Settings, tap Projects, open the filter, and under environments turn off Server so only Mac remains.
- In that same filter, under projects, choose the shared repository.
- Under Organize, tap Archive project.
- Open the filter again, tap All connected environments, then open Settings, tap General, and under Project grouping tap Group by repository.
- On the thread list, tap Filter threads by project and choose the project that exists only on Mac.
- Tap New chat.
- On the new-thread screen, tap the project name in What should we build in.
- On Choose project, tap the shared repository, the row whose subtitle says 2 workspaces.
- Read the line under the project name that begins with on.
Expected behavior
That line says on Server, the machine whose copy of the repository is still open.
Actual behavior
That line says on Mac, the machine whose copy of the repository was archived.
Impact
Minor bug or occasional failure. Mobile users with a partly archived repository group can start a chat in an archived checkout whenever the draft prefers that checkout's machine.
Version or commit
main at 8cf97b5f06. The cause is at apps/mobile/src/features/threads/new-task-project-selection.ts:26.
Environment
iPhone 18 Pro, iOS 27.0.
Logs or stack traces
expected 'archived-copy' to be 'open-copy'Automated repro
Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.
diff --git a/apps/mobile/src/features/threads/new-task-project-selection.test.ts b/apps/mobile/src/features/threads/new-task-project-selection.test.ts
index 82533a3c91..25246fcd06 100644
--- a/apps/mobile/src/features/threads/new-task-project-selection.test.ts
+++ b/apps/mobile/src/features/threads/new-task-project-selection.test.ts
@@ -2,7 +2,7 @@ import { EnvironmentId, ProjectId } from "@t3tools/contracts";
import { describe, expect, it } from "vite-plus/test";
import type { EnvironmentProject } from "@t3tools/client-runtime/state/shell";
-import type { HomeProjectScope } from "../home/homeThreadList";
+import { buildHomeProjectScopes, type HomeProjectScope } from "../home/homeThreadList";
import {
getProjectScopeSelectionTarget,
isSameRepository,
@@ -60,6 +60,29 @@ function makeScope(projects: ReadonlyArray<EnvironmentProject>): HomeProjectScop
}
describe("getProjectScopeSelectionTarget", () => {
+ it("chooses an open copy of a repository over an archived copy on the preferred machine", () => {
+ const repo = { repositoryKey: "github.com/t3tools/t3code" };
+ const archived = {
+ ...makeProject("archived-copy", "mac", repo),
+ archivedAt: "2026-07-02T00:00:00.000Z",
+ };
+ const open = makeProject("open-copy", "server", repo);
+ const [scope] = buildHomeProjectScopes({
+ projects: [archived, open],
+ environmentId: null,
+ projectGroupingMode: "repository",
+ });
+ if (!scope || scope.archived) throw new Error("Expected a pickable repository group");
+
+ expect(
+ getProjectScopeSelectionTarget(
+ scope,
+ archived.environmentId,
+ new Set([archived.environmentId, open.environmentId]),
+ ).id,
+ ).toBe(open.id);
+ });
+
it("prefers a connected copy of a project that spans environments", () => {
const mac = makeProject("t3code", "mac");
const server = makeProject("t3code", "server");cd apps/mobile && pnpm exec vp test run src/features/threads/new-task-project-selection.test.tsWorkaround
No response
Metadata
Metadata
Assignees
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.



Activity