mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-22 08:15:53 +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,56 @@
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import React from 'react';
|
||||
import { Link, Text } from '../ink.js';
|
||||
import type { PrReviewState } from '../utils/ghPrStatus.js';
|
||||
import React from 'react'
|
||||
import { Link, Text } from '../ink.js'
|
||||
import type { PrReviewState } from '../utils/ghPrStatus.js'
|
||||
|
||||
type Props = {
|
||||
number: number;
|
||||
url: string;
|
||||
reviewState?: PrReviewState;
|
||||
bold?: boolean;
|
||||
};
|
||||
export function PrBadge(t0) {
|
||||
const $ = _c(21);
|
||||
const {
|
||||
number,
|
||||
url,
|
||||
reviewState,
|
||||
bold
|
||||
} = t0;
|
||||
let t1;
|
||||
if ($[0] !== reviewState) {
|
||||
t1 = getPrStatusColor(reviewState);
|
||||
$[0] = reviewState;
|
||||
$[1] = t1;
|
||||
} else {
|
||||
t1 = $[1];
|
||||
}
|
||||
const statusColor = t1;
|
||||
const t2 = !statusColor && !bold;
|
||||
let t3;
|
||||
if ($[2] !== bold || $[3] !== number || $[4] !== statusColor || $[5] !== t2) {
|
||||
t3 = <Text color={statusColor} dimColor={t2} bold={bold}>#{number}</Text>;
|
||||
$[2] = bold;
|
||||
$[3] = number;
|
||||
$[4] = statusColor;
|
||||
$[5] = t2;
|
||||
$[6] = t3;
|
||||
} else {
|
||||
t3 = $[6];
|
||||
}
|
||||
const label = t3;
|
||||
const t4 = !bold;
|
||||
let t5;
|
||||
if ($[7] !== t4) {
|
||||
t5 = <Text dimColor={t4}>PR</Text>;
|
||||
$[7] = t4;
|
||||
$[8] = t5;
|
||||
} else {
|
||||
t5 = $[8];
|
||||
}
|
||||
const t6 = !statusColor && !bold;
|
||||
let t7;
|
||||
if ($[9] !== bold || $[10] !== number || $[11] !== statusColor || $[12] !== t6) {
|
||||
t7 = <Text color={statusColor} dimColor={t6} underline={true} bold={bold}>#{number}</Text>;
|
||||
$[9] = bold;
|
||||
$[10] = number;
|
||||
$[11] = statusColor;
|
||||
$[12] = t6;
|
||||
$[13] = t7;
|
||||
} else {
|
||||
t7 = $[13];
|
||||
}
|
||||
let t8;
|
||||
if ($[14] !== label || $[15] !== t7 || $[16] !== url) {
|
||||
t8 = <Link url={url} fallback={label}>{t7}</Link>;
|
||||
$[14] = label;
|
||||
$[15] = t7;
|
||||
$[16] = url;
|
||||
$[17] = t8;
|
||||
} else {
|
||||
t8 = $[17];
|
||||
}
|
||||
let t9;
|
||||
if ($[18] !== t5 || $[19] !== t8) {
|
||||
t9 = <Text>{t5}{" "}{t8}</Text>;
|
||||
$[18] = t5;
|
||||
$[19] = t8;
|
||||
$[20] = t9;
|
||||
} else {
|
||||
t9 = $[20];
|
||||
}
|
||||
return t9;
|
||||
number: number
|
||||
url: string
|
||||
reviewState?: PrReviewState
|
||||
bold?: boolean
|
||||
}
|
||||
function getPrStatusColor(state?: PrReviewState): 'success' | 'error' | 'warning' | 'merged' | undefined {
|
||||
|
||||
export function PrBadge({
|
||||
number,
|
||||
url,
|
||||
reviewState,
|
||||
bold,
|
||||
}: Props): React.ReactNode {
|
||||
const statusColor = getPrStatusColor(reviewState)
|
||||
const label = (
|
||||
<Text color={statusColor} dimColor={!statusColor && !bold} bold={bold}>
|
||||
#{number}
|
||||
</Text>
|
||||
)
|
||||
return (
|
||||
<Text>
|
||||
<Text dimColor={!bold}>PR</Text>{' '}
|
||||
<Link url={url} fallback={label}>
|
||||
<Text
|
||||
color={statusColor}
|
||||
dimColor={!statusColor && !bold}
|
||||
underline
|
||||
bold={bold}
|
||||
>
|
||||
#{number}
|
||||
</Text>
|
||||
</Link>
|
||||
</Text>
|
||||
)
|
||||
}
|
||||
|
||||
function getPrStatusColor(
|
||||
state?: PrReviewState,
|
||||
): 'success' | 'error' | 'warning' | 'merged' | undefined {
|
||||
switch (state) {
|
||||
case 'approved':
|
||||
return 'success';
|
||||
return 'success'
|
||||
case 'changes_requested':
|
||||
return 'error';
|
||||
return 'error'
|
||||
case 'pending':
|
||||
return 'warning';
|
||||
return 'warning'
|
||||
case 'merged':
|
||||
return 'merged';
|
||||
return 'merged'
|
||||
default:
|
||||
return undefined;
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user