mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-06 16:31:12 +08:00
feat: update styles and improve Chinese localization in CLI manager
This commit is contained in:
@@ -98,6 +98,29 @@ function getTriggerVariant(trigger: HookTriggerType): 'default' | 'secondary' |
|
||||
|
||||
// ========== Component ==========
|
||||
|
||||
// ========== Hook Name Translation ==========
|
||||
|
||||
/**
|
||||
* Get translated hook name if available
|
||||
* Falls back to original name if no translation exists
|
||||
*/
|
||||
function getHookDisplayName(name: string, formatMessage: (msg: { id: string }) => string): string {
|
||||
const translationKey = `cliHooks.templates.templates.${name}.name`;
|
||||
// Try to get translation, fallback to original name
|
||||
try {
|
||||
const translated = formatMessage({ id: translationKey });
|
||||
// If translation returns the key itself, no translation exists
|
||||
if (translated && !translated.includes('cliHooks.templates.templates')) {
|
||||
return translated;
|
||||
}
|
||||
} catch {
|
||||
// Translation not found
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
// ========== Component ==========
|
||||
|
||||
export function HookCard({
|
||||
hook,
|
||||
isExpanded,
|
||||
@@ -108,6 +131,9 @@ export function HookCard({
|
||||
}: HookCardProps) {
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
// Get translated hook name
|
||||
const displayName = getHookDisplayName(hook.name, formatMessage);
|
||||
|
||||
const handleToggle = () => {
|
||||
onToggle(hook.name, !hook.enabled);
|
||||
};
|
||||
|
||||
@@ -603,6 +603,8 @@ export function InjectionControlTab({ className }: InjectionControlTabProps) {
|
||||
!isOverLimit && isOverWarning && 'bg-yellow-100 dark:bg-yellow-900/30'
|
||||
)}
|
||||
indicatorClassName={cn(
|
||||
// Default: use a distinct blue color
|
||||
!isOverLimit && !isOverWarning && 'bg-sky-500 dark:bg-sky-400',
|
||||
isOverLimit && 'bg-destructive',
|
||||
!isOverLimit && isOverWarning && 'bg-yellow-500'
|
||||
)}
|
||||
|
||||
@@ -15,7 +15,7 @@ const Progress = React.forwardRef<
|
||||
<ProgressPrimitive.Root
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"relative h-4 w-full overflow-hidden rounded-full bg-secondary",
|
||||
"relative h-4 w-full overflow-hidden rounded-full bg-muted",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
|
||||
Reference in New Issue
Block a user