@@ -20,7 +20,11 @@ import { formatKeybind, KEYBINDS } from "@/browser/utils/ui/keybinds";
2020import { useAutoScroll } from "@/browser/hooks/useAutoScroll" ;
2121import { usePersistedState } from "@/browser/hooks/usePersistedState" ;
2222import { useThinking } from "@/browser/contexts/ThinkingContext" ;
23- import { useWorkspaceState , useWorkspaceAggregator } from "@/browser/stores/WorkspaceStore" ;
23+ import {
24+ useWorkspaceState ,
25+ useWorkspaceAggregator ,
26+ canInterrupt ,
27+ } from "@/browser/stores/WorkspaceStore" ;
2428import { WorkspaceHeader } from "./WorkspaceHeader" ;
2529import { getModelName } from "@/common/utils/ai/models" ;
2630import type { DisplayedMessage } from "@/common/types/message" ;
@@ -227,15 +231,15 @@ const AIViewInner: React.FC<AIViewProps> = ({
227231 // Track if last message was interrupted or errored (for RetryBarrier)
228232 // Uses same logic as useResumeManager for DRY
229233 const showRetryBarrier = workspaceState
230- ? ! workspaceState . canInterrupt &&
234+ ? ! canInterrupt ( workspaceState . interruptType ) &&
231235 hasInterruptedStream ( workspaceState . messages , workspaceState . pendingStreamStartTime )
232236 : false ;
233237
234238 // Handle keyboard shortcuts (using optional refs that are safe even if not initialized)
235239 useAIViewKeybinds ( {
236240 workspaceId,
237241 currentModel : workspaceState ?. currentModel ?? null ,
238- canInterrupt : workspaceState ?. canInterrupt ?? false ,
242+ canInterrupt : canInterrupt ( workspaceState . interruptType ) ,
239243 showRetryBarrier,
240244 currentWorkspaceThinking,
241245 setThinkingLevel,
@@ -284,8 +288,7 @@ const AIViewInner: React.FC<AIViewProps> = ({
284288 ) ;
285289 }
286290
287- // Extract state from workspace state
288- const { messages, canInterrupt, isCompacting, loading, currentModel } = workspaceState ;
291+ const { messages, interruptType, isCompacting, loading, currentModel } = workspaceState ;
289292
290293 // Get active stream message ID for token counting
291294 const activeStreamMessageId = aggregator . getActiveStreamMessageId ( ) ;
@@ -297,6 +300,14 @@ const AIViewInner: React.FC<AIViewProps> = ({
297300 // Merge consecutive identical stream errors
298301 const mergedMessages = mergeConsecutiveStreamErrors ( messages ) ;
299302
303+ const model = currentModel ? getModelName ( currentModel ) : "" ;
304+ const interrupting = interruptType === "hard" ;
305+
306+ const prefix = interrupting ? "⏸️ Interrupting " : "" ;
307+ const action = interrupting ? "" : isCompacting ? "compacting..." : "streaming..." ;
308+
309+ const statusText = `${ prefix } ${ model } ${ action } ` . trim ( ) ;
310+
300311 // When editing, find the cutoff point
301312 const editCutoffHistoryId = editingMessage
302313 ? mergedMessages . find (
@@ -369,8 +380,8 @@ const AIViewInner: React.FC<AIViewProps> = ({
369380 onTouchMove = { markUserInteraction }
370381 onScroll = { handleScroll }
371382 role = "log"
372- aria-live = { canInterrupt ? "polite" : "off" }
373- aria-busy = { canInterrupt }
383+ aria-live = { canInterrupt ( interruptType ) ? "polite" : "off" }
384+ aria-busy = { canInterrupt ( interruptType ) }
374385 aria-label = "Conversation transcript"
375386 tabIndex = { 0 }
376387 className = "h-full overflow-y-auto p-[15px] leading-[1.5] break-words whitespace-pre-wrap"
@@ -429,21 +440,13 @@ const AIViewInner: React.FC<AIViewProps> = ({
429440 </ >
430441 ) }
431442 < PinnedTodoList workspaceId = { workspaceId } />
432- { canInterrupt && (
443+ { canInterrupt ( interruptType ) && (
433444 < StreamingBarrier
434- statusText = {
435- isCompacting
436- ? currentModel
437- ? `${ getModelName ( currentModel ) } compacting...`
438- : "compacting..."
439- : currentModel
440- ? `${ getModelName ( currentModel ) } streaming...`
441- : "streaming..."
442- }
445+ statusText = { statusText }
443446 cancelText = {
444447 isCompacting
445448 ? `${ formatKeybind ( vimEnabled ? KEYBINDS . INTERRUPT_STREAM_VIM : KEYBINDS . INTERRUPT_STREAM_NORMAL ) } cancel | ${ formatKeybind ( KEYBINDS . ACCEPT_EARLY_COMPACTION ) } accept early`
446- : `hit ${ formatKeybind ( vimEnabled ? KEYBINDS . INTERRUPT_STREAM_VIM : KEYBINDS . INTERRUPT_STREAM_NORMAL ) } to cancel`
449+ : `hit ${ formatKeybind ( vimEnabled ? KEYBINDS . INTERRUPT_STREAM_VIM : KEYBINDS . INTERRUPT_STREAM_NORMAL ) } to ${ interruptType === "hard" ? "force" : "" } cancel`
447450 }
448451 tokenCount = {
449452 activeStreamMessageId
@@ -480,7 +483,7 @@ const AIViewInner: React.FC<AIViewProps> = ({
480483 editingMessage = { editingMessage }
481484 onCancelEdit = { handleCancelEdit }
482485 onEditLastUserMessage = { handleEditLastUserMessage }
483- canInterrupt = { canInterrupt }
486+ canInterrupt = { canInterrupt ( interruptType ) }
484487 onReady = { handleChatInputReady }
485488 />
486489 </ div >
0 commit comments