diff --git a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte index ce192356c6..bbeb77b968 100644 --- a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte +++ b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte @@ -501,8 +501,8 @@ ) // Only when this tab could hold the posture itself: a mode its own selector // does not offer would read as a mode the user could switch away from here. - const showsMirroredPlan = $derived( - aiChatManager.mirroredPlanMode && aiChatManager.planModeAvailable + const showsRemotePlan = $derived( + aiChatManager.remotePlanMode && aiChatManager.planModeAvailable ) // Fall back to ask-permission when the persisted mode isn't applicable in the // current AI mode (e.g. auto-accept edits while in a mode without edits). @@ -510,7 +510,7 @@ // run this tab is showing, and this tab's own mode governs nothing until it // drives a turn itself. const effectiveAutonomyMode = $derived( - showsMirroredPlan + showsRemotePlan ? AIAutonomyMode.PLAN : availableAutonomyModeOptions.some((option) => option.mode === aiChatManager.autonomyMode) ? aiChatManager.autonomyMode @@ -535,16 +535,16 @@ return pending?.action === 'question' ? pending.toolCallId : undefined }) - // The composer is locked while another tab's run is on screen: this tab pairs - // a mirrored transcript with the history it held before that run, and a turn - // sent from that pair would reach the model as a conversation the driver has - // already moved past. It unlocks on its own once the re-read that follows the - // turn lands. A run parked on a question is the exception — answering is the - // one thing a watching tab is there to do, and the answer travels to the - // driver instead of starting a turn here. - const composerLocked = $derived( - aiChatManager.mirroringRemoteRun && pendingQuestionToolCallId === undefined - ) + // The composer is locked for as long as another tab's run is in flight: this + // tab still shows the transcript from before that run, and a turn sent from + // it would reach the model as a conversation the driver has already moved + // past. It unlocks on its own once the re-read that follows the turn lands. + // + // No exception for a run parked on a question. Only the driving tab holds the + // question and the resolver waiting on it; a card that looks parked here is a + // restored one whose resolver left with the old page, and answering it would + // deliver to nobody. + const composerLocked = $derived(aiChatManager.runHeldElsewhere) // Get app context for display when in APP mode const appContext = $derived.by((): SelectedContext | undefined => { @@ -639,10 +639,14 @@ the panel, or the Escape-to-stop focus check would wrongly reject them. --> {#each pastChats as chat (chat.id)}