From e252c5e8b481272996134166a69bf12776877bd7 Mon Sep 17 00:00:00 2001 From: claude-code-best Date: Sat, 20 Jun 2026 11:37:22 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=A7=BB=E9=99=A4=20ultrareview=20pre?= =?UTF-8?q?flight=20stub=20=E5=8F=8A=E5=85=B6=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除 src/services/api/ultrareviewPreflight.ts(自动生成的 stub) - 删除 src/commands/review/UltrareviewPreflightDialog.tsx(依赖前者的 UI stub) - 删除 src/services/api/__tests__/ultrareviewPreflight.test.ts(测试已删代码) - 同步移除 ultrareviewCommand.test.tsx 中对 UltrareviewPreflightDialog 的 mock Co-Authored-By: glm-5.2 --- .../review/UltrareviewPreflightDialog.tsx | 56 ----- .../__tests__/ultrareviewCommand.test.tsx | 5 +- .../__tests__/ultrareviewPreflight.test.ts | 226 ------------------ src/services/api/ultrareviewPreflight.ts | 81 ------- 4 files changed, 1 insertion(+), 367 deletions(-) delete mode 100644 src/commands/review/UltrareviewPreflightDialog.tsx delete mode 100644 src/services/api/__tests__/ultrareviewPreflight.test.ts delete mode 100644 src/services/api/ultrareviewPreflight.ts diff --git a/src/commands/review/UltrareviewPreflightDialog.tsx b/src/commands/review/UltrareviewPreflightDialog.tsx deleted file mode 100644 index 261ba3796..000000000 --- a/src/commands/review/UltrareviewPreflightDialog.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import React, { useCallback, useRef, useState } from 'react'; -import { Box, Dialog, Text } from '@anthropic/ink'; -import { Select } from '../../components/CustomSelect/select.js'; - -type Props = { - billingNote: string | null; - onConfirm: (signal: AbortSignal) => Promise; - onCancel: () => void; -}; - -/** - * Dialog shown when /v1/ultrareview/preflight returns action='confirm'. - * Displays the server-provided billing_note (or a generic fallback) and - * gives the user a Proceed / Cancel choice. - */ -export function UltrareviewPreflightDialog({ billingNote, onConfirm, onCancel }: Props): React.ReactNode { - const [isLaunching, setIsLaunching] = useState(false); - const abortControllerRef = useRef(new AbortController()); - - const handleSelect = useCallback( - (value: string) => { - if (value === 'proceed') { - setIsLaunching(true); - void onConfirm(abortControllerRef.current.signal).catch(() => setIsLaunching(false)); - } else { - onCancel(); - } - }, - [onConfirm, onCancel], - ); - - const handleCancel = useCallback(() => { - abortControllerRef.current.abort(); - onCancel(); - }, [onCancel]); - - const options = [ - { label: 'Proceed', value: 'proceed' }, - { label: 'Cancel', value: 'cancel' }, - ]; - - const displayNote = billingNote ?? 'This run may incur additional cost.'; - - return ( - - - {displayNote} - {isLaunching ? ( - Launching… - ) : ( -