Skip to content

Commit ff916b0

Browse files
juliusmarmingecodex
andcommitted
fix(mobile): align branch label with live checkout
Co-authored-by: codex <[email protected]>
1 parent 55a4d38 commit ff916b0

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎apps/mobile/src/features/threads/NewTaskDraftScreen.tsx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,11 +584,17 @@ export function NewTaskDraftScreen(props: {
584584
flow.environments.find(
585585
(environment) => environment.environmentId === flow.selectedEnvironmentId,
586586
)?.environmentLabel ?? "Environment";
587-
const currentBranchName =
587+
const availableCurrentBranchName =
588588
flow.availableBranches.find((branch) => branch.current)?.name ??
589589
flow.availableBranches.find((branch) => branch.isDefault)?.name ??
590590
null;
591-
const selectedBranchName = flow.selectedBranchName ?? currentBranchName;
591+
const selectedBranchName = resolveProjectThreadCreationBranch({
592+
workspaceMode: flow.workspaceMode,
593+
selectedBranch:
594+
flow.selectedBranchName ??
595+
(flow.workspaceMode === "worktree" ? availableCurrentBranchName : null),
596+
currentCheckoutBranch: flow.currentCheckoutBranchName,
597+
});
592598
const selectedBranchLabel = resolveNewTaskBranchLabel({
593599
branchName: selectedBranchName,
594600
startFromOrigin: flow.startFromOrigin,

‎apps/mobile/src/features/threads/projectThreadCreationValidation.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, expect, it } from "vite-plus/test";
33
import { resolveProjectThreadCreationBranch } from "./projectThreadCreationValidation";
44

55
describe("resolveProjectThreadCreationBranch", () => {
6-
it("records the current checkout for an untouched local draft", () => {
6+
it("uses the live checkout for an untouched local draft label and recorded branch", () => {
77
expect(
88
resolveProjectThreadCreationBranch({
99
workspaceMode: "local",

0 commit comments

Comments
 (0)