From 246383da0dc7788fdc91b0aaef1b2fe905895ca9 Mon Sep 17 00:00:00 2001 From: GCWing Date: Sat, 7 Mar 2026 22:32:38 +0800 Subject: [PATCH 1/4] fix: restore corrupted Chinese text in component library preview --- .../component-library/components/registry.tsx | 370 +++++++++--------- .../src/component-library/preview/main.tsx | 5 +- 2 files changed, 189 insertions(+), 186 deletions(-) diff --git a/src/web-ui/src/component-library/components/registry.tsx b/src/web-ui/src/component-library/components/registry.tsx index b4df6113..2a50d45a 100644 --- a/src/web-ui/src/component-library/components/registry.tsx +++ b/src/web-ui/src/component-library/components/registry.tsx @@ -64,12 +64,12 @@ function createMockToolItem( toolResult: result ? { result, success: status === 'completed', - error: status === 'error' ? '????' : undefined + error: status === 'error' ? '执行失败' : undefined } : undefined, config: config || { toolName, displayName: toolName, - icon: '??', + icon: '🔧', requiresConfirmation: false, resultDisplayType: 'summary', description: '', @@ -83,28 +83,28 @@ function createMockToolItem( export const componentRegistry: ComponentCategory[] = [ { id: 'basic', - name: '????', - description: '?????UI ??', + name: '基础组件', + description: '常用的基础UI组件', layoutType: 'grid-4', components: [ { id: 'button-primary', name: 'Button - Primary', - description: '????', + description: '主要按钮', category: 'basic', component: () => , }, { id: 'button-secondary', name: 'Button - Secondary', - description: '????', + description: '次要按钮', category: 'basic', component: () => , }, { id: 'button-ghost', name: 'Button - Ghost', - description: '????', + description: '幽灵按钮', category: 'basic', component: () => , }, @@ -123,7 +123,7 @@ export const componentRegistry: ComponentCategory[] = [ }, { id: 'tag-demo', - name: 'Tag - ??', + name: 'Tag - 演示', description: 'Demo', category: 'basic', component: () => ( @@ -150,7 +150,7 @@ export const componentRegistry: ComponentCategory[] = [ }, { id: 'icon-button-variants', - name: 'IconButton - ??', + name: 'IconButton - 变体', description: 'Demo', category: 'basic', component: () => ( @@ -193,7 +193,7 @@ export const componentRegistry: ComponentCategory[] = [ }, { id: 'icon-button-sizes', - name: 'IconButton - ??', + name: 'IconButton - 尺寸', description: 'Demo', category: 'basic', component: () => ( @@ -218,7 +218,7 @@ export const componentRegistry: ComponentCategory[] = [ }, { id: 'icon-button-shapes', - name: 'IconButton - ??', + name: 'IconButton - 形状', description: 'Demo', category: 'basic', component: () => ( @@ -238,7 +238,7 @@ export const componentRegistry: ComponentCategory[] = [ }, { id: 'window-controls-demo', - name: 'WindowControls - ????', + name: 'WindowControls - 窗口控件', description: 'Demo', category: 'basic', component: () => ( @@ -271,20 +271,20 @@ export const componentRegistry: ComponentCategory[] = [ }, { id: 'feedback', - name: '????', + name: '反馈组件', description: 'Demo', layoutType: 'demo', components: [ { id: 'cube-loading-variants', - name: 'CubeLoading - ??????', - description: '3x3x3 ??????????', + name: 'CubeLoading - 所有变体', + description: '3x3x3 立方体加载动画展示', category: 'feedback', component: () => (
{}
-
??
+
尺寸
@@ -304,8 +304,8 @@ export const componentRegistry: ComponentCategory[] = [
With text
- - + +
@@ -314,17 +314,17 @@ export const componentRegistry: ComponentCategory[] = [ { id: 'modal-basic', name: 'Modal - Basic', - description: '?????', + description: '基础弹窗', category: 'feedback', component: () => { const [isOpen, setIsOpen] = React.useState(false); return ( <> - + setIsOpen(false)} - title="?????" + title="基础弹窗" >

Modal body content

@@ -336,7 +336,7 @@ export const componentRegistry: ComponentCategory[] = [ }, { id: 'alert-demo', - name: 'Alert - ????', + name: 'Alert - 四种类型', description: 'Demo', category: 'feedback', component: () => ( @@ -350,8 +350,8 @@ export const componentRegistry: ComponentCategory[] = [ }, { id: 'stream-text-demo', - name: 'StreamText - ??????', - description: 'AI ????????', + name: 'StreamText - 流式文本演示', + description: 'AI 流式文本打字机效果', category: 'feedback', component: () => { const [key, setKey] = React.useState(0); @@ -381,7 +381,7 @@ export const componentRegistry: ComponentCategory[] = [ variant="secondary" onClick={() => setKey(prev => prev + 1)} > - ?? ???? + 重新播放
); @@ -391,8 +391,8 @@ export const componentRegistry: ComponentCategory[] = [ }, { id: 'form', - name: '????', - description: '???????', + name: '表单组件', + description: '输入类表单组件', layoutType: 'grid-2', components: [ { @@ -405,7 +405,7 @@ name: 'Input - Demo', setValue(val)} /> { const [value, setValue] = React.useState(''); @@ -549,7 +549,7 @@ name: 'Search - Demo', { label: 'Svelte', value: 'svelte' }, { label: 'Solid', value: 'solid' }, ]} - placeholder="????" + placeholder="选择技术" value={multiValue} onChange={(v) => setMultiValue(v as (string | number)[])} clearable @@ -579,8 +579,8 @@ name: 'Search - Demo', }, { id: 'select-searchable', -name: 'Select - Demo', - description: '??????????', + name: 'Select - Demo', + description: '可搜索的选择器示例', category: 'form', component: () => { const [value, setValue] = React.useState(''); @@ -616,8 +616,8 @@ name: 'Select - Demo', }, { id: 'select-grouped', - name: 'Select - ????', - description: '????????', + name: 'Select - 分组选择', + description: '带分组的选择器', category: 'form', component: () => { const [value, setValue] = React.useState(''); @@ -637,10 +637,10 @@ name: 'Select - Demo', return (