mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 06:15:51 +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,96 +1,72 @@
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import * as React from 'react';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { KeyboardShortcutHint } from '../components/design-system/KeyboardShortcutHint.js';
|
||||
import { Box, Text } from '../ink.js';
|
||||
import { useKeybinding } from '../keybindings/useKeybinding.js';
|
||||
import * as React from 'react'
|
||||
import { useEffect, useRef } from 'react'
|
||||
import { KeyboardShortcutHint } from '../components/design-system/KeyboardShortcutHint.js'
|
||||
import { Box, Text } from '../ink.js'
|
||||
import { useKeybinding } from '../keybindings/useKeybinding.js'
|
||||
|
||||
type Props = {
|
||||
onRun: () => void;
|
||||
onCancel: () => void;
|
||||
reason: string;
|
||||
};
|
||||
onRun: () => void
|
||||
onCancel: () => void
|
||||
reason: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Component that shows a notification about running /issue command
|
||||
* with the ability to cancel via ESC key
|
||||
*/
|
||||
export function AutoRunIssueNotification(t0) {
|
||||
const $ = _c(8);
|
||||
const {
|
||||
onRun,
|
||||
onCancel,
|
||||
reason
|
||||
} = t0;
|
||||
const hasRunRef = useRef(false);
|
||||
let t1;
|
||||
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t1 = {
|
||||
context: "Confirmation"
|
||||
};
|
||||
$[0] = t1;
|
||||
} else {
|
||||
t1 = $[0];
|
||||
}
|
||||
useKeybinding("confirm:no", onCancel, t1);
|
||||
let t2;
|
||||
let t3;
|
||||
if ($[1] !== onRun) {
|
||||
t2 = () => {
|
||||
if (!hasRunRef.current) {
|
||||
hasRunRef.current = true;
|
||||
onRun();
|
||||
}
|
||||
};
|
||||
t3 = [onRun];
|
||||
$[1] = onRun;
|
||||
$[2] = t2;
|
||||
$[3] = t3;
|
||||
} else {
|
||||
t2 = $[2];
|
||||
t3 = $[3];
|
||||
}
|
||||
useEffect(t2, t3);
|
||||
let t4;
|
||||
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t4 = <Box><Text bold={true}>Running feedback capture...</Text></Box>;
|
||||
$[4] = t4;
|
||||
} else {
|
||||
t4 = $[4];
|
||||
}
|
||||
let t5;
|
||||
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t5 = <Box><Text dimColor={true}>Press <KeyboardShortcutHint shortcut="Esc" action="cancel" /> anytime</Text></Box>;
|
||||
$[5] = t5;
|
||||
} else {
|
||||
t5 = $[5];
|
||||
}
|
||||
let t6;
|
||||
if ($[6] !== reason) {
|
||||
t6 = <Box flexDirection="column" marginTop={1}>{t4}{t5}<Box><Text dimColor={true}>Reason: {reason}</Text></Box></Box>;
|
||||
$[6] = reason;
|
||||
$[7] = t6;
|
||||
} else {
|
||||
t6 = $[7];
|
||||
}
|
||||
return t6;
|
||||
export function AutoRunIssueNotification({
|
||||
onRun,
|
||||
onCancel,
|
||||
reason,
|
||||
}: Props): React.ReactNode {
|
||||
const hasRunRef = useRef(false)
|
||||
|
||||
// Handle ESC key to cancel
|
||||
useKeybinding('confirm:no', onCancel, { context: 'Confirmation' })
|
||||
|
||||
// Run /issue immediately on mount
|
||||
useEffect(() => {
|
||||
if (!hasRunRef.current) {
|
||||
hasRunRef.current = true
|
||||
onRun()
|
||||
}
|
||||
}, [onRun])
|
||||
|
||||
return (
|
||||
<Box flexDirection="column" marginTop={1}>
|
||||
<Box>
|
||||
<Text bold>Running feedback capture...</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text dimColor>
|
||||
Press <KeyboardShortcutHint shortcut="Esc" action="cancel" /> anytime
|
||||
</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text dimColor>Reason: {reason}</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
export type AutoRunIssueReason = 'feedback_survey_bad' | 'feedback_survey_good';
|
||||
|
||||
export type AutoRunIssueReason = 'feedback_survey_bad' | 'feedback_survey_good'
|
||||
|
||||
/**
|
||||
* Determines if /issue should auto-run for Ant users
|
||||
*/
|
||||
export function shouldAutoRunIssue(reason: AutoRunIssueReason): boolean {
|
||||
// Only for Ant users
|
||||
if ((process.env.USER_TYPE) !== 'ant') {
|
||||
return false;
|
||||
if (process.env.USER_TYPE !== 'ant') {
|
||||
return false
|
||||
}
|
||||
|
||||
switch (reason) {
|
||||
case 'feedback_survey_bad':
|
||||
return false;
|
||||
return false
|
||||
case 'feedback_survey_good':
|
||||
return false;
|
||||
return false
|
||||
default:
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,10 +76,10 @@ export function shouldAutoRunIssue(reason: AutoRunIssueReason): boolean {
|
||||
*/
|
||||
export function getAutoRunCommand(reason: AutoRunIssueReason): string {
|
||||
// Only ant builds have the /good-claude command
|
||||
if ((process.env.USER_TYPE) === 'ant' && reason === 'feedback_survey_good') {
|
||||
return '/good-claude';
|
||||
if (process.env.USER_TYPE === 'ant' && reason === 'feedback_survey_good') {
|
||||
return '/good-claude'
|
||||
}
|
||||
return '/issue';
|
||||
return '/issue'
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -112,10 +88,10 @@ export function getAutoRunCommand(reason: AutoRunIssueReason): string {
|
||||
export function getAutoRunIssueReasonText(reason: AutoRunIssueReason): string {
|
||||
switch (reason) {
|
||||
case 'feedback_survey_bad':
|
||||
return 'You responded "Bad" to the feedback survey';
|
||||
return 'You responded "Bad" to the feedback survey'
|
||||
case 'feedback_survey_good':
|
||||
return 'You responded "Good" to the feedback survey';
|
||||
return 'You responded "Good" to the feedback survey'
|
||||
default:
|
||||
return 'Unknown reason';
|
||||
return 'Unknown reason'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user