style: 完成所有文件的lint

This commit is contained in:
claude-code-best
2026-05-01 21:39:30 +08:00
parent d136872cc9
commit 6182015005
1333 changed files with 68255 additions and 77882 deletions

View File

@@ -56,7 +56,7 @@ export function UltraplanChoiceDialog({
setConversationId,
resultDedupState: _resultDedupState,
}: UltraplanChoiceDialogProps): React.ReactNode {
useRegisterOverlay('ultraplan-choice')
useRegisterOverlay('ultraplan-choice');
const setAppState = useSetAppState();
const { rows, columns } = useTerminalSize();
@@ -65,7 +65,7 @@ export function UltraplanChoiceDialog({
const visibleHeight = React.useMemo(
() => Math.min(MAX_VISIBLE_LINES, Math.max(1, Math.floor(rows / 2) - CHROME_LINES)),
[rows],
)
);
const wrappedLines = React.useMemo(
() => wrapText(plan, Math.max(1, columns - 4), 'wrap').split('\n'),
@@ -106,7 +106,7 @@ export function UltraplanChoiceDialog({
const handleChoice = React.useCallback(
async (choice: ChoiceValue) => {
switch (choice) {
case 'here':
case 'here':
enqueuePendingNotification({
value: [
'Ultraplan approved in browser. Here is the plan:',
@@ -120,9 +120,12 @@ export function UltraplanChoiceDialog({
mode: 'task-notification',
});
break;
case 'fresh':
case 'fresh':
const previousSessionId = getSessionId();
const transcriptSaved = await stat(getTranscriptPath()).then(() => true, () => false)
const transcriptSaved = await stat(getTranscriptPath()).then(
() => true,
() => false,
);
await clearConversation({
setMessages,
@@ -135,7 +138,10 @@ export function UltraplanChoiceDialog({
if (transcriptSaved) {
setMessages(prev => [
...prev,
createSystemMessage(`Previous session saved · resume with: claude --resume ${previousSessionId}`, 'suggestion'),
createSystemMessage(
`Previous session saved · resume with: claude --resume ${previousSessionId}`,
'suggestion',
),
]);
}
@@ -170,16 +176,7 @@ export function UltraplanChoiceDialog({
// Archive the remote CCR session.
archiveRemoteSession(sessionId);
},
[
plan,
sessionId,
taskId,
setMessages,
getAppState,
setAppState,
readFileState,
setConversationId,
],
[plan, sessionId, taskId, setMessages, getAppState, setAppState, readFileState, setConversationId],
);
// ── Menu options ───────────────────────────────────────────────────
@@ -206,8 +203,8 @@ export function UltraplanChoiceDialog({
// ── Render ─────────────────────────────────────────────────────────
return (
<Dialog
title="Ultraplan approved"
<Dialog
title="Ultraplan approved"
subtitle="How should the plan be implemented?"
onCancel={() => {}}
hideInputGuide

View File

@@ -23,7 +23,7 @@ interface UltraplanLaunchDialogProps {
) => void;
}
function dispatchShowTermsLink(){
function dispatchShowTermsLink() {
return !getGlobalConfig().hasSeenUltraplanTerms;
}
@@ -41,7 +41,7 @@ export function UltraplanLaunchDialog({ onChoice }: UltraplanLaunchDialogProps):
// Dialog copy derived from the prompt identifier
const dialogConfig = React.useMemo(() => {
return getDialogConfig(promptIdentifier);
}, [promptIdentifier])
}, [promptIdentifier]);
// Whether the remote-control bridge is currently active
const isBridgeEnabled = useAppState(state => state.replBridgeEnabled);
@@ -52,13 +52,14 @@ export function UltraplanLaunchDialog({ onChoice }: UltraplanLaunchDialogProps):
// Choice handler
// ------------------------------------------------------------------
const handleChoice = React.useCallback((value: ChoiceValue) => {
const handleChoice = React.useCallback(
(value: ChoiceValue) => {
// If the user chose "run" while the bridge is enabled, disconnect it
// first so the ultraplan session doesn't collide with remote control.
const disconnectedBridge = value === 'run' && isBridgeEnabled;
if (disconnectedBridge) {
setAppState((prev) => {
setAppState(prev => {
if (!prev.replBridgeEnabled) {
return prev;
}
@@ -76,14 +77,14 @@ export function UltraplanLaunchDialog({ onChoice }: UltraplanLaunchDialogProps):
saveGlobalConfig(prev => (prev.hasSeenUltraplanTerms ? prev : { ...prev, hasSeenUltraplanTerms: true }));
}
onChoice(value, { disconnectedBridge, promptIdentifier});
onChoice(value, { disconnectedBridge, promptIdentifier });
},
[onChoice, isBridgeEnabled, setAppState, showTermsLink],
)
);
const handleCancel = React.useCallback(() => {
handleChoice('cancel')
}, [handleChoice])
handleChoice('cancel');
}, [handleChoice]);
const runDescription = isBridgeEnabled
? 'Disable remote control and launch in Claude Code on the web'
@@ -99,24 +100,16 @@ export function UltraplanLaunchDialog({ onChoice }: UltraplanLaunchDialogProps):
];
return (
<Dialog
title="Run ultraplan in the cloud?"
subtitle={dialogConfig.timeEstimate}
onCancel={handleCancel}
>
<Dialog title="Run ultraplan in the cloud?" subtitle={dialogConfig.timeEstimate} onCancel={handleCancel}>
<Box flexDirection="column" gap={1}>
<Box flexDirection="column">
<Text dimColor>{dialogConfig.dialogBody}</Text>
{
showTermsLink
? (
<Text dimColor>
For more information on Claude Code on the web:
<Link url={CCR_TERMS_URL}>{CCR_TERMS_URL}</Link>
</Text>
)
: null
}
{showTermsLink ? (
<Text dimColor>
For more information on Claude Code on the web:
<Link url={CCR_TERMS_URL}>{CCR_TERMS_URL}</Link>
</Text>
) : null}
</Box>
{/* Pipeline description (hidden when bridge will be disconnected) */}
@@ -124,10 +117,7 @@ export function UltraplanLaunchDialog({ onChoice }: UltraplanLaunchDialogProps):
{isBridgeEnabled ? 'This will disable Remote Control for this session.' : dialogConfig.dialogPipeline}
</Text>
<Select
options={options}
onChange={handleChoice}
/>
<Select options={options} onChange={handleChoice} />
</Box>
</Dialog>
);