Skip to content

Commit 3069b2a

Browse files
committed
feat(animations): 添加动画演示导航组和相关页面组件
添加新的动画演示导航组,包含完整流程动画和内部机制动画两个分类 实现 MCP 服务发现、上下文压缩和 Token 计数三个动画演示页面 重构导航结构,将原动画演示项移动到新分类下
1 parent 5bea7b0 commit 3069b2a

12 files changed

Lines changed: 6551 additions & 1 deletion

src/App.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ const UIRenderingLayer = lazy(() => import('./pages/UIRenderingLayer').then(m =>
5050
const ThemeSystem = lazy(() => import('./pages/ThemeSystem').then(m => ({ default: m.ThemeSystem })));
5151
const TelemetrySystem = lazy(() => import('./pages/TelemetrySystem').then(m => ({ default: m.TelemetrySystem })));
5252
const Animation = lazy(() => import('./pages/Animation').then(m => ({ default: m.Animation })));
53+
const ToolSchedulerAnimation = lazy(() => import('./pages/ToolSchedulerAnimation').then(m => ({ default: m.ToolSchedulerAnimation })));
54+
const StreamingParserAnimation = lazy(() => import('./pages/StreamingParserAnimation').then(m => ({ default: m.StreamingParserAnimation })));
55+
const MCPDiscoveryAnimation = lazy(() => import('./pages/MCPDiscoveryAnimation').then(m => ({ default: m.MCPDiscoveryAnimation })));
56+
const ContextCompressionAnimation = lazy(() => import('./pages/ContextCompressionAnimation').then(m => ({ default: m.ContextCompressionAnimation })));
57+
const SubagentAnimation = lazy(() => import('./pages/SubagentAnimation').then(m => ({ default: m.SubagentAnimation })));
58+
const TurnInternalAnimation = lazy(() => import('./pages/TurnInternalAnimation').then(m => ({ default: m.TurnInternalAnimation })));
59+
const FormatConverterAnimation = lazy(() => import('./pages/FormatConverterAnimation').then(m => ({ default: m.FormatConverterAnimation })));
60+
const ChunkAssemblyAnimation = lazy(() => import('./pages/ChunkAssemblyAnimation').then(m => ({ default: m.ChunkAssemblyAnimation })));
61+
const TokenCountingAnimation = lazy(() => import('./pages/TokenCountingAnimation').then(m => ({ default: m.TokenCountingAnimation })));
62+
const FunctionResponseAnimation = lazy(() => import('./pages/FunctionResponseAnimation').then(m => ({ default: m.FunctionResponseAnimation })));
5363
const CoreCode = lazy(() => import('./pages/CoreCode').then(m => ({ default: m.CoreCode })));
5464
const LoopMechanism = lazy(() => import('./pages/LoopMechanism').then(m => ({ default: m.LoopMechanism })));
5565

@@ -222,6 +232,26 @@ function App() {
222232
return <TelemetrySystem />;
223233
case 'animation':
224234
return <Animation />;
235+
case 'tool-scheduler-anim':
236+
return <ToolSchedulerAnimation />;
237+
case 'streaming-parser-anim':
238+
return <StreamingParserAnimation />;
239+
case 'mcp-discovery-anim':
240+
return <MCPDiscoveryAnimation />;
241+
case 'context-compression-anim':
242+
return <ContextCompressionAnimation />;
243+
case 'subagent-anim':
244+
return <SubagentAnimation />;
245+
case 'turn-internal-anim':
246+
return <TurnInternalAnimation />;
247+
case 'format-converter-anim':
248+
return <FormatConverterAnimation />;
249+
case 'chunk-assembly-anim':
250+
return <ChunkAssemblyAnimation />;
251+
case 'token-counting-anim':
252+
return <TokenCountingAnimation />;
253+
case 'function-response-anim':
254+
return <FunctionResponseAnimation />;
225255
case 'code':
226256
return <CoreCode />;
227257
case 'loop':

src/nav.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,33 @@ export const navGroups: NavGroup[] = [
114114
{ id: 'telemetry', label: '遥测系统' },
115115
],
116116
},
117+
{
118+
id: 'animations',
119+
title: '动画演示',
120+
icon: '🎬',
121+
defaultOpen: false,
122+
items: [
123+
{ id: 'animation', label: '完整流程动画', highlight: true },
124+
{ id: 'tool-scheduler-anim', label: '工具调度状态机', highlight: true },
125+
{ id: 'streaming-parser-anim', label: '流式解析器', highlight: true },
126+
{ id: 'mcp-discovery-anim', label: 'MCP服务发现', highlight: true },
127+
{ id: 'context-compression-anim', label: '上下文压缩', highlight: true },
128+
{ id: 'subagent-anim', label: '子代理系统', highlight: true },
129+
],
130+
},
131+
{
132+
id: 'internal-animations',
133+
title: '内部机制动画',
134+
icon: '🔬',
135+
defaultOpen: true,
136+
items: [
137+
{ id: 'turn-internal-anim', label: 'Turn 状态流转', highlight: true },
138+
{ id: 'format-converter-anim', label: '格式转换管道', highlight: true },
139+
{ id: 'chunk-assembly-anim', label: 'Chunk 组装', highlight: true },
140+
{ id: 'token-counting-anim', label: 'Token 计数', highlight: true },
141+
{ id: 'function-response-anim', label: 'FunctionResponse 构建', highlight: true },
142+
],
143+
},
117144
{
118145
id: 'appendix',
119146
title: '附录',
@@ -123,7 +150,6 @@ export const navGroups: NavGroup[] = [
123150
{ id: 'config', label: '配置系统' },
124151
{ id: 'auth', label: '认证流程' },
125152
{ id: 'startup', label: '启动流程' },
126-
{ id: 'animation', label: '动画演示', highlight: true },
127153
{ id: 'code', label: '核心代码' },
128154
{ id: 'loop', label: 'Loop机制' },
129155
],

0 commit comments

Comments
 (0)