Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
0cba575
fix(mobile): a new thread on a branch held by a worktree uses that wo…
Oct 17, 2026
b06fac8
fix(mobile): keep looking past the first page for the branch's worktree
Oct 17, 2026
6eaee36
fix(mobile): look up branches longer than the ref query limit
Oct 17, 2026
523a4fe
fix(mobile): map a remote ref to its local branch by the ref's own re…
Oct 17, 2026
93f23c1
Merge main into mobile worktree takeover
juliusmarminge Oct 19, 2026
d8ef409
test(server): cover local ref upstream metadata
juliusmarminge Oct 19, 2026
ea344de
feat(server): include upstream refs in Git branch snapshots
juliusmarminge Oct 19, 2026
81ab275
fix(mobile): reuse worktrees when preparing new threads
juliusmarminge Oct 19, 2026
fc6220a
test(mobile): cover remote worktree identity and nested projects
juliusmarminge Oct 19, 2026
94e3f1a
fix(mobile): verify upstream before reusing branch worktrees
juliusmarminge Oct 19, 2026
18c8ee4
test(mobile): reject unsafe worktree reuse for nested projects
juliusmarminge Oct 19, 2026
8884205
fix(mobile): reject unsafe worktree reuse for subdirectory projects
juliusmarminge Oct 19, 2026
a9a54ce
test(mobile): cover worktree reuse from symlinked project roots
juliusmarminge Oct 19, 2026
ab91420
fix(mobile): allow worktree reuse from symlinked repository roots
juliusmarminge Oct 19, 2026
db4d406
test(server): use a junction for the repository alias fixture
juliusmarminge Oct 19, 2026
1b3b634
fix(mobile): clear stale worktree paths after branch checkout
juliusmarminge Oct 19, 2026
f636333
Merge remote-tracking branch 'origin/main' into l69-20825
juliusmarminge Oct 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export function NewTaskBranchPickerRouteScreen() {
AuthSourceControlWriteScope,
);
const navigation = useNavigation();
const readRefs = useAtomCommand(vcsEnvironment.readRefs, { reportFailure: false });
const switchRef = useAtomCommand(vcsEnvironment.switchRef, { reportFailure: false });
const [switchingBranchName, setSwitchingBranchName] = useState<string | null>(null);
const selectingBranchNameRef = useRef<string | null>(null);
Expand Down Expand Up @@ -314,6 +315,7 @@ export function NewTaskBranchPickerRouteScreen() {
branch,
project,
workspaceMode: flow.workspaceMode,
readRefs,
switchRef,
});
if (mountedRef.current) setSwitchingBranchName(null);
Expand Down
20 changes: 15 additions & 5 deletions apps/mobile/src/features/threads/NewTaskDraftRouteScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { useAtomCommand } from "../../state/use-atom-command";
import { useWorkspaceState } from "../../state/workspace";
import { vcsEnvironment } from "../../state/vcs";
import { checkoutNewTaskBranch } from "./checkout-new-task-branch";
import { resolveNewTaskBranchWorktreePath } from "./new-task-context-presentation";
import { NativeStackScreenOptions } from "../../native/StackHeader";

import { NewTaskDraftScreen } from "./NewTaskDraftScreen";
Expand All @@ -37,6 +38,7 @@ export function NewTaskDraftRouteScreen({ route }: StaticScreenProps<NewTaskDraf
const projects = useProjects();
const { state: catalogState } = useWorkspaceState();
const navigation = useNavigation();
const readRefs = useAtomCommand(vcsEnvironment.readRefs, { reportFailure: false });
const switchRef = useAtomCommand(vcsEnvironment.switchRef, { reportFailure: false });

const initialProjectRef = useMemo(
Expand Down Expand Up @@ -87,8 +89,6 @@ export function NewTaskDraftRouteScreen({ route }: StaticScreenProps<NewTaskDraf
return;
}
const result = await checkoutNewTaskBranch({
// A thread's branch is historical; only switchRef can establish that
// the shared project checkout now matches it.
branch: {
name: branchName,
current: false,
Expand All @@ -97,6 +97,7 @@ export function NewTaskDraftRouteScreen({ route }: StaticScreenProps<NewTaskDraf
},
project: environmentId && workspaceRoot ? { environmentId, workspaceRoot } : null,
workspaceMode: "local",
readRefs,
switchRef,
});
setPendingCheckouts((count) => count - 1);
Expand All @@ -110,6 +111,7 @@ export function NewTaskDraftRouteScreen({ route }: StaticScreenProps<NewTaskDraf
workspaceRoot,
initialProjectRef,
needsPreparation,
readRefs,
switchRef,
waitingForProject,
]);
Expand All @@ -136,10 +138,18 @@ export function NewTaskDraftRouteScreen({ route }: StaticScreenProps<NewTaskDraf

const preparedProjectRef = useMemo(
() =>
result?._tag === "Success"
? { ...initialProjectRef, branch: result.value.name }
result?._tag === "Success" && workspaceRoot
? {
...initialProjectRef,
branch: result.value.name,
worktreePath: resolveNewTaskBranchWorktreePath({
workspaceMode: "local",
projectCwd: workspaceRoot,
branchWorktreePath: result.value.worktreePath,
}),
}
: initialProjectRef,
[initialProjectRef, result],
[initialProjectRef, result, workspaceRoot],
);
const preparingBranch = checkoutPending || (needsPreparation && result?._tag !== "Success");

Expand Down
Loading
Loading