@@ -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" ;
@@ -248,15 +252,15 @@ const AIViewInner: React.FC<AIViewProps> = ({
248252 // Track if last message was interrupted or errored (for RetryBarrier)
249253 // Uses same logic as useResumeManager for DRY
250254 const showRetryBarrier = workspaceState
251- ? ! workspaceState . canInterrupt &&
255+ ? ! canInterrupt ( workspaceState . interruptType ) &&
252256 hasInterruptedStream ( workspaceState . messages , workspaceState . pendingStreamStartTime )
253257 : false ;
254258
255259 // Handle keyboard shortcuts (using optional refs that are safe even if not initialized)
256260 useAIViewKeybinds ( {
257261 workspaceId,
258262 currentModel : workspaceState ?. currentModel ?? null ,
259- canInterrupt : workspaceState ?. canInterrupt ?? false ,
263+ canInterrupt : canInterrupt ( workspaceState . interruptType ) ,
260264 showRetryBarrier,
261265 currentWorkspaceThinking,
262266 setThinkingLevel,
@@ -305,8 +309,7 @@ const AIViewInner: React.FC<AIViewProps> = ({
305309 ) ;
306310 }
307311
308- // Extract state from workspace state
309- const { messages, canInterrupt, isCompacting, loading, currentModel } = workspaceState ;
312+ const { messages, interruptType, isCompacting, loading, currentModel } = workspaceState ;
310313
311314 // Get active stream message ID for token counting
312315 const activeStreamMessageId = aggregator . getActiveStreamMessageId ( ) ;
@@ -318,6 +321,14 @@ const AIViewInner: React.FC<AIViewProps> = ({
318321 // Merge consecutive identical stream errors
319322 const mergedMessages = mergeConsecutiveStreamErrors ( messages ) ;
320323
324+ const model = currentModel ? getModelName ( currentModel ) : "" ;
325+ const interrupting = interruptType === "hard" ;
326+
327+ const prefix = interrupting ? "⏸️ Interrupting " : "" ;
328+ const action = interrupting ? "" : isCompacting ? "compacting..." : "streaming..." ;
329+
330+ const statusText = `${ prefix } ${ model } ${ action } ` . trim ( ) ;
331+
321332 // When editing, find the cutoff point
322333 const editCutoffHistoryId = editingMessage
323334 ? mergedMessages . find (
@@ -390,8 +401,8 @@ const AIViewInner: React.FC<AIViewProps> = ({
390401 onTouchMove = { markUserInteraction }
391402 onScroll = { handleScroll }
392403 role = "log"
393- aria-live = { canInterrupt ? "polite" : "off" }
394- aria-busy = { canInterrupt }
404+ aria-live = { canInterrupt ( interruptType ) ? "polite" : "off" }
405+ aria-busy = { canInterrupt ( interruptType ) }
395406 aria-label = "Conversation transcript"
396407 tabIndex = { 0 }
397408 className = "h-full overflow-y-auto p-[15px] leading-[1.5] break-words whitespace-pre-wrap"
@@ -450,21 +461,13 @@ const AIViewInner: React.FC<AIViewProps> = ({
450461 </ >
451462 ) }
452463 < PinnedTodoList workspaceId = { workspaceId } />
453- { canInterrupt && (
464+ { canInterrupt ( interruptType ) && (
454465 < StreamingBarrier
455- statusText = {
456- isCompacting
457- ? currentModel
458- ? `${ getModelName ( currentModel ) } compacting...`
459- : "compacting..."
460- : currentModel
461- ? `${ getModelName ( currentModel ) } streaming...`
462- : "streaming..."
463- }
466+ statusText = { statusText }
464467 cancelText = {
465468 isCompacting
466469 ? `${ formatKeybind ( vimEnabled ? KEYBINDS . INTERRUPT_STREAM_VIM : KEYBINDS . INTERRUPT_STREAM_NORMAL ) } cancel | ${ formatKeybind ( KEYBINDS . ACCEPT_EARLY_COMPACTION ) } accept early`
467- : `hit ${ formatKeybind ( vimEnabled ? KEYBINDS . INTERRUPT_STREAM_VIM : KEYBINDS . INTERRUPT_STREAM_NORMAL ) } to cancel`
470+ : `hit ${ formatKeybind ( vimEnabled ? KEYBINDS . INTERRUPT_STREAM_VIM : KEYBINDS . INTERRUPT_STREAM_NORMAL ) } to ${ interruptType === "hard" ? "force" : "" } cancel`
468471 }
469472 tokenCount = {
470473 activeStreamMessageId
@@ -507,7 +510,7 @@ const AIViewInner: React.FC<AIViewProps> = ({
507510 editingMessage = { editingMessage }
508511 onCancelEdit = { handleCancelEdit }
509512 onEditLastUserMessage = { ( ) => void handleEditLastUserMessage ( ) }
510- canInterrupt = { canInterrupt }
513+ canInterrupt = { canInterrupt ( interruptType ) }
511514 onReady = { handleChatInputReady }
512515 />
513516 </ div >
0 commit comments