@@ -538,6 +538,7 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
538538 : "local" ;
539539 const selectedBranchName = selectedProjectDraft . workspaceSelection ?. branch ?? null ;
540540 const selectedWorktreePath = selectedProjectDraft . workspaceSelection ?. worktreePath ?? null ;
541+ const selectedBranchSelection = selectedProjectDraft . workspaceSelection ?. branchSelection ;
541542 const preferencesResult = useAtomValue ( mobilePreferencesAtom ) ;
542543 const preferencesLoaded = AsyncResult . isSuccess ( preferencesResult ) ;
543544 const savePreferences = useAtomSet ( updateMobilePreferencesAtom ) ;
@@ -954,10 +955,10 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
954955 mode,
955956 previousMode : workspaceMode ,
956957 branch : selectedBranchName ,
957- worktreePath : selectedWorktreePath ,
958- localSelection,
958+ branchSelection : selectedBranchSelection ,
959959 } ) ,
960- worktreePath : mode === "local" ? localSelection . worktreePath : selectedWorktreePath ,
960+ worktreePath : mode === "local" ? localSelection . worktreePath : null ,
961+ branchSelection : mode === "local" ? "auto" : ( selectedBranchSelection ?? "manual" ) ,
961962 ...( draftStartFromOrigin !== undefined ? { startFromOrigin : draftStartFromOrigin } : { } ) ,
962963 } ,
963964 } ) ;
@@ -966,9 +967,9 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
966967 availableBranches ,
967968 draftStartFromOrigin ,
968969 selectedBranchName ,
970+ selectedBranchSelection ,
969971 selectedProject ,
970972 selectedProjectDraftKey ,
971- selectedWorktreePath ,
972973 workspaceMode ,
973974 ] ,
974975 ) ;
@@ -996,6 +997,7 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
996997 mode : "local" ,
997998 branch : localSelection . branch ,
998999 worktreePath : localSelection . worktreePath ,
1000+ branchSelection : "auto" ,
9991001 ...( draftStartFromOrigin !== undefined ? { startFromOrigin : draftStartFromOrigin } : { } ) ,
10001002 } ,
10011003 } ) ;
@@ -1027,6 +1029,7 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
10271029 workspaceSelection : {
10281030 mode : workspaceMode ,
10291031 branch : branch . name ,
1032+ branchSelection : "manual" ,
10301033 worktreePath : resolveNewTaskBranchWorktreePath ( {
10311034 workspaceMode,
10321035 projectCwd : selectedProject . workspaceRoot ,
@@ -1055,11 +1058,18 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
10551058 mode : workspaceMode ,
10561059 branch : selectedBranchName ,
10571060 worktreePath : selectedWorktreePath ,
1061+ ...( selectedBranchSelection ? { branchSelection : selectedBranchSelection } : { } ) ,
10581062 startFromOrigin : value ,
10591063 } ,
10601064 } ) ;
10611065 } ,
1062- [ selectedBranchName , selectedProjectDraftKey , selectedWorktreePath , workspaceMode ] ,
1066+ [
1067+ selectedBranchName ,
1068+ selectedBranchSelection ,
1069+ selectedProjectDraftKey ,
1070+ selectedWorktreePath ,
1071+ workspaceMode ,
1072+ ] ,
10631073 ) ;
10641074
10651075 const refreshBranches = branchState . refresh ;
@@ -1104,6 +1114,7 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
11041114 mode : "worktree" ,
11051115 branch : preferredBranch ,
11061116 worktreePath : null ,
1117+ branchSelection : "auto" ,
11071118 ...( draftStartFromOrigin !== undefined ? { startFromOrigin : draftStartFromOrigin } : { } ) ,
11081119 } ,
11091120 } ) ;
0 commit comments