mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-19 06:45:50 +00:00
更新大量 tsx 原始文件; 已经迁移 login panel; 部分 (#121)
* style(B1-1): 格式化 ink/buddy/cli/context/screens/tasks/services/keybindings/state (43 files) 纯格式化:移除分号、React Compiler import、import 多行展开。 修复了 Box.tsx 和 ScrollBox.tsx 中无效的 global.d.ts import。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style(B1-2): 格式化 commands (79 files) 纯格式化:移除分号、React Compiler import、import 多行展开。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style(B1-3): 格式化 components/messages,permissions,mcp,sandbox,shell (104 files) 纯格式化:移除分号、React Compiler import、import 多行展开。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style(B1-4): 格式化 components/PromptInput,FeedbackSurvey,tasks,agents,skills,design-system,wizard (73 files) 纯格式化:移除分号、React Compiler import、import 多行展开。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style(B1-5): 格式化 components其余 + hooks + tools (232 files) 纯格式化:移除分号、React Compiler import、import 多行展开。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style(B1-6): 格式化 main/entrypoints/utils/moreright (21 files) 纯格式化:移除分号、React Compiler import、import 多行展开。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: 更新 README,新增 Run.ps1/TODO.md,删除 V6.md - README.md: 大幅重写,更详细版本历史和配置示例 - Run.ps1: 新增 Windows 启动脚本 - TODO.md: 新增包完成清单 - V6.md: 删除(架构重构规划已不适用) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: 修复以前的问题 * fix: 修复 login 面板的问题 --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,166 +1,108 @@
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import React from 'react';
|
||||
import { envDynamic } from 'src/utils/envDynamic.js';
|
||||
import { Box, Text } from '../ink.js';
|
||||
import { useKeybindings } from '../keybindings/useKeybinding.js';
|
||||
import { getGlobalConfig, saveGlobalConfig } from '../utils/config.js';
|
||||
import { env } from '../utils/env.js';
|
||||
import { getTerminalIdeType, type IDEExtensionInstallationStatus, isJetBrainsIde, toIDEDisplayName } from '../utils/ide.js';
|
||||
import { Dialog } from './design-system/Dialog.js';
|
||||
import React from 'react'
|
||||
import { envDynamic } from 'src/utils/envDynamic.js'
|
||||
import { Box, Text } from '../ink.js'
|
||||
import { useKeybindings } from '../keybindings/useKeybinding.js'
|
||||
import { getGlobalConfig, saveGlobalConfig } from '../utils/config.js'
|
||||
import { env } from '../utils/env.js'
|
||||
import {
|
||||
getTerminalIdeType,
|
||||
type IDEExtensionInstallationStatus,
|
||||
isJetBrainsIde,
|
||||
toIDEDisplayName,
|
||||
} from '../utils/ide.js'
|
||||
import { Dialog } from './design-system/Dialog.js'
|
||||
|
||||
interface Props {
|
||||
onDone: () => void;
|
||||
installationStatus: IDEExtensionInstallationStatus | null;
|
||||
onDone: () => void
|
||||
installationStatus: IDEExtensionInstallationStatus | null
|
||||
}
|
||||
export function IdeOnboardingDialog(t0) {
|
||||
const $ = _c(23);
|
||||
const {
|
||||
onDone,
|
||||
installationStatus
|
||||
} = t0;
|
||||
markDialogAsShown();
|
||||
let t1;
|
||||
if ($[0] !== onDone) {
|
||||
t1 = {
|
||||
"confirm:yes": onDone,
|
||||
"confirm:no": onDone
|
||||
};
|
||||
$[0] = onDone;
|
||||
$[1] = t1;
|
||||
} else {
|
||||
t1 = $[1];
|
||||
}
|
||||
let t2;
|
||||
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t2 = {
|
||||
context: "Confirmation"
|
||||
};
|
||||
$[2] = t2;
|
||||
} else {
|
||||
t2 = $[2];
|
||||
}
|
||||
useKeybindings(t1, t2);
|
||||
let t3;
|
||||
if ($[3] !== installationStatus?.ideType) {
|
||||
t3 = installationStatus?.ideType ?? getTerminalIdeType();
|
||||
$[3] = installationStatus?.ideType;
|
||||
$[4] = t3;
|
||||
} else {
|
||||
t3 = $[4];
|
||||
}
|
||||
const ideType = t3;
|
||||
const isJetBrains = isJetBrainsIde(ideType);
|
||||
let t4;
|
||||
if ($[5] !== ideType) {
|
||||
t4 = toIDEDisplayName(ideType);
|
||||
$[5] = ideType;
|
||||
$[6] = t4;
|
||||
} else {
|
||||
t4 = $[6];
|
||||
}
|
||||
const ideName = t4;
|
||||
const installedVersion = installationStatus?.installedVersion;
|
||||
const pluginOrExtension = isJetBrains ? "plugin" : "extension";
|
||||
const mentionShortcut = env.platform === "darwin" ? "Cmd+Option+K" : "Ctrl+Alt+K";
|
||||
let t5;
|
||||
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t5 = <Text color="claude">✻ </Text>;
|
||||
$[7] = t5;
|
||||
} else {
|
||||
t5 = $[7];
|
||||
}
|
||||
let t6;
|
||||
if ($[8] !== ideName) {
|
||||
t6 = <>{t5}<Text>Welcome to Claude Code for {ideName}</Text></>;
|
||||
$[8] = ideName;
|
||||
$[9] = t6;
|
||||
} else {
|
||||
t6 = $[9];
|
||||
}
|
||||
const t7 = installedVersion ? `installed ${pluginOrExtension} v${installedVersion}` : undefined;
|
||||
let t8;
|
||||
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t8 = <Text color="suggestion">⧉ open files</Text>;
|
||||
$[10] = t8;
|
||||
} else {
|
||||
t8 = $[10];
|
||||
}
|
||||
let t9;
|
||||
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t9 = <Text>• Claude has context of {t8}{" "}and <Text color="suggestion">⧉ selected lines</Text></Text>;
|
||||
$[11] = t9;
|
||||
} else {
|
||||
t9 = $[11];
|
||||
}
|
||||
let t10;
|
||||
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t10 = <Text color="diffAddedWord">+11</Text>;
|
||||
$[12] = t10;
|
||||
} else {
|
||||
t10 = $[12];
|
||||
}
|
||||
let t11;
|
||||
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t11 = <Text>• Review Claude Code's changes{" "}{t10}{" "}<Text color="diffRemovedWord">-22</Text> in the comfort of your IDE</Text>;
|
||||
$[13] = t11;
|
||||
} else {
|
||||
t11 = $[13];
|
||||
}
|
||||
let t12;
|
||||
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t12 = <Text>• Cmd+Esc<Text dimColor={true}> for Quick Launch</Text></Text>;
|
||||
$[14] = t12;
|
||||
} else {
|
||||
t12 = $[14];
|
||||
}
|
||||
let t13;
|
||||
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t13 = <Box flexDirection="column" gap={1}>{t9}{t11}{t12}<Text>• {mentionShortcut}<Text dimColor={true}> to reference files or lines in your input</Text></Text></Box>;
|
||||
$[15] = t13;
|
||||
} else {
|
||||
t13 = $[15];
|
||||
}
|
||||
let t14;
|
||||
if ($[16] !== onDone || $[17] !== t6 || $[18] !== t7) {
|
||||
t14 = <Dialog title={t6} subtitle={t7} color="ide" onCancel={onDone} hideInputGuide={true}>{t13}</Dialog>;
|
||||
$[16] = onDone;
|
||||
$[17] = t6;
|
||||
$[18] = t7;
|
||||
$[19] = t14;
|
||||
} else {
|
||||
t14 = $[19];
|
||||
}
|
||||
let t15;
|
||||
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t15 = <Box paddingX={1}><Text dimColor={true} italic={true}>Press Enter to continue</Text></Box>;
|
||||
$[20] = t15;
|
||||
} else {
|
||||
t15 = $[20];
|
||||
}
|
||||
let t16;
|
||||
if ($[21] !== t14) {
|
||||
t16 = <>{t14}{t15}</>;
|
||||
$[21] = t14;
|
||||
$[22] = t16;
|
||||
} else {
|
||||
t16 = $[22];
|
||||
}
|
||||
return t16;
|
||||
|
||||
export function IdeOnboardingDialog({
|
||||
onDone,
|
||||
installationStatus,
|
||||
}: Props): React.ReactNode {
|
||||
markDialogAsShown()
|
||||
|
||||
// Handle Enter/Escape to dismiss
|
||||
useKeybindings(
|
||||
{
|
||||
'confirm:yes': onDone,
|
||||
'confirm:no': onDone,
|
||||
},
|
||||
{ context: 'Confirmation' },
|
||||
)
|
||||
|
||||
const ideType = installationStatus?.ideType ?? getTerminalIdeType()
|
||||
const isJetBrains = isJetBrainsIde(ideType)
|
||||
|
||||
const ideName = toIDEDisplayName(ideType)
|
||||
const installedVersion = installationStatus?.installedVersion
|
||||
const pluginOrExtension = isJetBrains ? 'plugin' : 'extension'
|
||||
const mentionShortcut =
|
||||
env.platform === 'darwin' ? 'Cmd+Option+K' : 'Ctrl+Alt+K'
|
||||
|
||||
return (
|
||||
<>
|
||||
<Dialog
|
||||
title={
|
||||
<>
|
||||
<Text color="claude">✻ </Text>
|
||||
<Text>Welcome to Claude Code for {ideName}</Text>
|
||||
</>
|
||||
}
|
||||
subtitle={
|
||||
installedVersion
|
||||
? `installed ${pluginOrExtension} v${installedVersion}`
|
||||
: undefined
|
||||
}
|
||||
color="ide"
|
||||
onCancel={onDone}
|
||||
hideInputGuide
|
||||
>
|
||||
<Box flexDirection="column" gap={1}>
|
||||
<Text>
|
||||
• Claude has context of <Text color="suggestion">⧉ open files</Text>{' '}
|
||||
and <Text color="suggestion">⧉ selected lines</Text>
|
||||
</Text>
|
||||
<Text>
|
||||
• Review Claude Code's changes{' '}
|
||||
<Text color="diffAddedWord">+11</Text>{' '}
|
||||
<Text color="diffRemovedWord">-22</Text> in the comfort of your IDE
|
||||
</Text>
|
||||
<Text>
|
||||
• Cmd+Esc<Text dimColor> for Quick Launch</Text>
|
||||
</Text>
|
||||
<Text>
|
||||
• {mentionShortcut}
|
||||
<Text dimColor> to reference files or lines in your input</Text>
|
||||
</Text>
|
||||
</Box>
|
||||
</Dialog>
|
||||
<Box paddingX={1}>
|
||||
<Text dimColor italic>
|
||||
Press Enter to continue
|
||||
</Text>
|
||||
</Box>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export function hasIdeOnboardingDialogBeenShown(): boolean {
|
||||
const config = getGlobalConfig();
|
||||
const terminal = envDynamic.terminal || 'unknown';
|
||||
return config.hasIdeOnboardingBeenShown?.[terminal] === true;
|
||||
const config = getGlobalConfig()
|
||||
const terminal = envDynamic.terminal || 'unknown'
|
||||
return config.hasIdeOnboardingBeenShown?.[terminal] === true
|
||||
}
|
||||
|
||||
function markDialogAsShown(): void {
|
||||
if (hasIdeOnboardingDialogBeenShown()) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
const terminal = envDynamic.terminal || 'unknown';
|
||||
const terminal = envDynamic.terminal || 'unknown'
|
||||
saveGlobalConfig(current => ({
|
||||
...current,
|
||||
hasIdeOnboardingBeenShown: {
|
||||
...current.hasIdeOnboardingBeenShown,
|
||||
[terminal]: true
|
||||
}
|
||||
}));
|
||||
[terminal]: true,
|
||||
},
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user