|
1 | 1 | import React, { useState, useEffect, useMemo } from "react"; |
2 | 2 | import { usePersistedState, updatePersistedState } from "@/browser/hooks/usePersistedState"; |
3 | | -import { getRetryStateKey, getAutoRetryKey } from "@/common/constants/storage"; |
| 3 | +import { getRetryStateKey, getAutoRetryKey, VIM_ENABLED_KEY } from "@/common/constants/storage"; |
| 4 | +import { KEYBINDS, formatKeybind } from "@/browser/utils/ui/keybinds"; |
4 | 5 | import { CUSTOM_EVENTS, createCustomEvent } from "@/common/constants/events"; |
5 | 6 | import { cn } from "@/common/lib/utils"; |
6 | 7 | import type { RetryState } from "@/browser/hooks/useResumeManager"; |
@@ -33,6 +34,12 @@ export const RetryBarrier: React.FC<RetryBarrierProps> = ({ workspaceId, classNa |
33 | 34 | { listener: true } |
34 | 35 | ); |
35 | 36 |
|
| 37 | + // Read vim mode for displaying correct stop keybind |
| 38 | + const [vimEnabled] = usePersistedState<boolean>(VIM_ENABLED_KEY, false, { listener: true }); |
| 39 | + const stopKeybind = formatKeybind( |
| 40 | + vimEnabled ? KEYBINDS.INTERRUPT_STREAM_VIM : KEYBINDS.INTERRUPT_STREAM_NORMAL |
| 41 | + ); |
| 42 | + |
36 | 43 | // Use persisted state for retry tracking (survives workspace switches) |
37 | 44 | // Read retry state (managed by useResumeManager) |
38 | 45 | const [retryState] = usePersistedState<RetryState>( |
@@ -149,7 +156,7 @@ export const RetryBarrier: React.FC<RetryBarrierProps> = ({ workspaceId, classNa |
149 | 156 | 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" |
150 | 157 | onClick={handleStopAutoRetry} |
151 | 158 | > |
152 | | - Stop (Ctrl+C) |
| 159 | + Stop ({stopKeybind}) |
153 | 160 | </button> |
154 | 161 | </div> |
155 | 162 | {lastError && ( |
|
0 commit comments