@@ -434,7 +434,7 @@ import { NoActiveThreadState } from "./NoActiveThreadState";
434434import {
435435 type EnvironmentOption ,
436436 resolveEffectiveEnvMode ,
437- resolveLocalCheckoutBranchMismatch ,
437+ resolveCheckoutBranchMismatch ,
438438 shouldShowComposerContextStrip ,
439439 shouldShowEnvironmentIndicator ,
440440} from "./BranchToolbar.logic" ;
@@ -6433,10 +6433,10 @@ export default function ChatView(props: ChatViewProps) {
64336433 requestedEnvMode : envMode ,
64346434 isGitRepo,
64356435 } ) ;
6436- const localCheckoutBranchMismatch = useMemo (
6436+ const checkoutBranchMismatch = useMemo (
64376437 ( ) =>
64386438 isServerThread
6439- ? resolveLocalCheckoutBranchMismatch ( {
6439+ ? resolveCheckoutBranchMismatch ( {
64406440 effectiveEnvMode : envMode ,
64416441 activeWorktreePath,
64426442 activeThreadBranch,
@@ -6736,10 +6736,10 @@ export default function ChatView(props: ChatViewProps) {
67366736 const nowMinute = useNowMinute ( ) ;
67376737 const activeBranchMismatchKey = branchMismatchKey (
67386738 activeThread ?. id ?? null ,
6739- localCheckoutBranchMismatch ,
6739+ checkoutBranchMismatch ,
67406740 ) ;
67416741 const showBranchMismatchBanner = shouldShowBranchMismatchBanner ( {
6742- hasMismatch : localCheckoutBranchMismatch !== null ,
6742+ hasMismatch : checkoutBranchMismatch !== null ,
67436743 isDismissed : isBranchMismatchDismissedForSession ( activeBranchMismatchKey ) ,
67446744 composerHasContent : composerHasDraftContent ,
67456745 wasShownForCurrentMismatch :
@@ -6759,7 +6759,7 @@ export default function ChatView(props: ChatViewProps) {
67596759 if (
67606760 ! activeProjectCwd ||
67616761 ! activeThread ||
6762- ! localCheckoutBranchMismatch ||
6762+ ! checkoutBranchMismatch ?. canRestoreThreadBranch ||
67636763 isRestoringThreadBranch
67646764 ) {
67656765 return ;
@@ -6769,7 +6769,7 @@ export default function ChatView(props: ChatViewProps) {
67696769 environmentId,
67706770 input : {
67716771 cwd : activeProjectCwd ,
6772- refName : localCheckoutBranchMismatch . threadBranch ,
6772+ refName : checkoutBranchMismatch . threadBranch ,
67736773 } ,
67746774 } ) ;
67756775 if ( checkoutResult . _tag === "Failure" ) {
@@ -6786,7 +6786,7 @@ export default function ChatView(props: ChatViewProps) {
67866786 return ;
67876787 }
67886788
6789- const nextBranch = checkoutResult . value . refName ?? localCheckoutBranchMismatch . threadBranch ;
6789+ const nextBranch = checkoutResult . value . refName ?? checkoutBranchMismatch . threadBranch ;
67906790 if ( nextBranch !== activeThread . branch ) {
67916791 const updateResult = await updateThreadMetadata ( {
67926792 environmentId,
@@ -6816,7 +6816,7 @@ export default function ChatView(props: ChatViewProps) {
68166816 environmentId ,
68176817 gitStatusQuery ,
68186818 isRestoringThreadBranch ,
6819- localCheckoutBranchMismatch ,
6819+ checkoutBranchMismatch ,
68206820 scheduleComposerFocus ,
68216821 switchGitRef ,
68226822 updateThreadMetadata ,
@@ -7132,7 +7132,7 @@ export default function ChatView(props: ChatViewProps) {
71327132 // The user asked for this one, so it leads the notice tier instead of trailing it.
71337133 const usageLimitsItems = usageLimitsBanner === null ? [ ] : [ usageLimitsBanner ] ;
71347134 const projectCloneItems = projectCloneBannerItem === null ? [ ] : [ projectCloneBannerItem ] ;
7135- if ( ! localCheckoutBranchMismatch || ! showBranchMismatchBanner || ! activeBranchMismatchKey ) {
7135+ if ( ! checkoutBranchMismatch || ! showBranchMismatchBanner || ! activeBranchMismatchKey ) {
71367136 return [
71377137 ...feedbackBannerItems ,
71387138 ...limitRecoveryItems ,
@@ -7165,18 +7165,18 @@ export default function ChatView(props: ChatViewProps) {
71657165 < TooltipTrigger
71667166 render = {
71677167 < code className = "min-w-0 truncate font-medium text-foreground" >
7168- { localCheckoutBranchMismatch . threadBranch }
7168+ { checkoutBranchMismatch . threadBranch }
71697169 </ code >
71707170 }
71717171 />
71727172 < TooltipPopup side = "top" >
7173- This thread last ran on { localCheckoutBranchMismatch . threadBranch } . Sending will
7174- continue on { localCheckoutBranchMismatch . currentBranch } .
7173+ This thread last ran on { checkoutBranchMismatch . threadBranch } . Sending will continue
7174+ on { checkoutBranchMismatch . currentBranch } .
71757175 </ TooltipPopup >
71767176 </ Tooltip >
71777177 </ span >
71787178 ) ,
7179- actions : (
7179+ actions : checkoutBranchMismatch . canRestoreThreadBranch ? (
71807180 < Button
71817181 size = "xs"
71827182 variant = "ghost"
@@ -7185,7 +7185,7 @@ export default function ChatView(props: ChatViewProps) {
71857185 >
71867186 { isRestoringThreadBranch ? "Restoring..." : "Restore branch" }
71877187 </ Button >
7188- ) ,
7188+ ) : null ,
71897189 dismissLabel : "Dismiss branch change notice" ,
71907190 onDismiss : ( ) => {
71917191 dismissBranchMismatchForSession ( activeBranchMismatchKey ) ;
@@ -7203,7 +7203,7 @@ export default function ChatView(props: ChatViewProps) {
72037203 handleRestoreThreadBranch ,
72047204 isRestoringThreadBranch ,
72057205 backgroundWorkBannerItem ,
7206- localCheckoutBranchMismatch ,
7206+ checkoutBranchMismatch ,
72077207 parkedThreadBannerItem ,
72087208 projectCloneBannerItem ,
72097209 resumeCompactionBannerItem ,
@@ -7930,9 +7930,7 @@ export default function ChatView(props: ChatViewProps) {
79307930 const settingsResult = await persistThreadSettingsForNextTurn ( {
79317931 threadId,
79327932 createdAt,
7933- ...( localCheckoutBranchMismatch
7934- ? { branch : localCheckoutBranchMismatch . currentBranch }
7935- : { } ) ,
7933+ ...( checkoutBranchMismatch ? { branch : checkoutBranchMismatch . currentBranch } : { } ) ,
79367934 runtimeMode,
79377935 interactionMode : context . interactionMode ,
79387936 } ) ;
@@ -7997,9 +7995,7 @@ export default function ChatView(props: ChatViewProps) {
79977995 const settingsResult = await persistThreadSettingsForNextTurn ( {
79987996 threadId,
79997997 createdAt,
8000- ...( localCheckoutBranchMismatch
8001- ? { branch : localCheckoutBranchMismatch . currentBranch }
8002- : { } ) ,
7998+ ...( checkoutBranchMismatch ? { branch : checkoutBranchMismatch . currentBranch } : { } ) ,
80037999 runtimeMode,
80048000 interactionMode,
80058001 } ) ;
@@ -9115,9 +9111,7 @@ export default function ChatView(props: ChatViewProps) {
91159111 const settingsResult = await persistThreadSettingsForNextTurn ( {
91169112 threadId : threadIdForSend ,
91179113 createdAt : messageCreatedAt ,
9118- ...( localCheckoutBranchMismatch
9119- ? { branch : localCheckoutBranchMismatch . currentBranch }
9120- : { } ) ,
9114+ ...( checkoutBranchMismatch ? { branch : checkoutBranchMismatch . currentBranch } : { } ) ,
91219115 runtimeMode,
91229116 interactionMode : sendInteractionMode ,
91239117 } ) ;
@@ -9703,7 +9697,7 @@ export default function ChatView(props: ChatViewProps) {
97039697 const settingsResult = await persistThreadSettingsForNextTurn ( {
97049698 threadId : threadIdForSend ,
97059699 createdAt : messageCreatedAt ,
9706- ...( localCheckoutBranchMismatch ? { branch : localCheckoutBranchMismatch . currentBranch } : { } ) ,
9700+ ...( checkoutBranchMismatch ? { branch : checkoutBranchMismatch . currentBranch } : { } ) ,
97079701 runtimeMode,
97089702 interactionMode : nextInteractionMode ,
97099703 } ) ;
@@ -11068,7 +11062,7 @@ export default function ChatView(props: ChatViewProps) {
1106811062 < AlertDialogTitle >
1106911063 Switch to{ " " }
1107011064 < code className = "font-medium" >
11071- { localCheckoutBranchMismatch ?. threadBranch ?? "" }
11065+ { checkoutBranchMismatch ?. threadBranch ?? "" }
1107211066 </ code >
1107311067 ?
1107411068 </ AlertDialogTitle >
0 commit comments