Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/browser/components/Messages/ChatBarrier/RetryBarrier.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState, useEffect, useMemo } from "react";
import { usePersistedState, updatePersistedState } from "@/browser/hooks/usePersistedState";
import { getRetryStateKey, getAutoRetryKey } from "@/common/constants/storage";
import { getRetryStateKey, getAutoRetryKey, VIM_ENABLED_KEY } from "@/common/constants/storage";
import { KEYBINDS, formatKeybind } from "@/browser/utils/ui/keybinds";
import { CUSTOM_EVENTS, createCustomEvent } from "@/common/constants/events";
import { cn } from "@/common/lib/utils";
import type { RetryState } from "@/browser/hooks/useResumeManager";
Expand Down Expand Up @@ -33,6 +34,12 @@ export const RetryBarrier: React.FC<RetryBarrierProps> = ({ workspaceId, classNa
{ listener: true }
);

// Read vim mode for displaying correct stop keybind
const [vimEnabled] = usePersistedState<boolean>(VIM_ENABLED_KEY, false, { listener: true });
const stopKeybind = formatKeybind(
vimEnabled ? KEYBINDS.INTERRUPT_STREAM_VIM : KEYBINDS.INTERRUPT_STREAM_NORMAL
);

// Use persisted state for retry tracking (survives workspace switches)
// Read retry state (managed by useResumeManager)
const [retryState] = usePersistedState<RetryState>(
Expand Down Expand Up @@ -149,7 +156,7 @@ export const RetryBarrier: React.FC<RetryBarrierProps> = ({ workspaceId, classNa
className="border-warning font-primary text-warning hover:bg-warning-overlay cursor-pointer rounded border bg-transparent px-4 py-2 text-xs font-semibold whitespace-nowrap transition-all duration-200 hover:-translate-y-px active:translate-y-0 disabled:cursor-not-allowed disabled:opacity-50"
onClick={handleStopAutoRetry}
>
Stop (Ctrl+C)
Stop ({stopKeybind})
</button>
</div>
{lastError && (
Expand Down