feat: 第一版可用 pokemon

This commit is contained in:
claude-code-best
2026-04-21 19:03:31 +08:00
parent 956e98a445
commit 88ddba6c23
46 changed files with 4143 additions and 1317 deletions

View File

@@ -49,6 +49,7 @@ type CancelRequestHandlerProps = {
popCommandFromQueue?: () => void
vimMode?: VimMode
isLocalJSXCommand?: boolean
onDismissLocalJSX?: () => void
isSearchingHistory?: boolean
isHelpOpen?: boolean
inputMode?: PromptInputMode
@@ -71,6 +72,7 @@ export function CancelRequestHandler(props: CancelRequestHandlerProps): null {
popCommandFromQueue,
vimMode,
isLocalJSXCommand,
onDismissLocalJSX,
isSearchingHistory,
isHelpOpen,
inputMode,
@@ -92,6 +94,12 @@ export function CancelRequestHandler(props: CancelRequestHandlerProps): null {
streamMode as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
}
// Priority 0: Dismiss local JSX command panel (e.g. /buddy, /config)
if (isLocalJSXCommand && onDismissLocalJSX) {
onDismissLocalJSX()
return
}
// Priority 1: If there's an active task running, cancel it first
// This takes precedence over queue management so users can always interrupt Claude
if (abortSignal !== undefined && !abortSignal.aborted) {
@@ -140,16 +148,16 @@ export function CancelRequestHandler(props: CancelRequestHandlerProps): null {
screen !== 'transcript' &&
!isSearchingHistory &&
!isMessageSelectorVisible &&
!isLocalJSXCommand &&
!isHelpOpen &&
!isOverlayActive &&
!(isVimModeEnabled() && vimMode === 'INSERT')
// Escape (chat:cancel) defers to mode-exit when in special mode with empty
// input, and to useBackgroundTaskNavigation when viewing a teammate
// input, and to useBackgroundTaskNavigation when viewing a teammate.
// Also active when a local JSX command panel (e.g. /buddy) is showing.
const isEscapeActive =
isContextActive &&
(canCancelRunningTask || hasQueuedCommands) &&
(canCancelRunningTask || hasQueuedCommands || !!isLocalJSXCommand) &&
!isInSpecialModeWithEmptyInput &&
!isViewingTeammate