|
1 | 1 | import { useState } from 'react'; |
| 2 | +import { RelatedPages } from '../components/RelatedPages'; |
2 | 3 |
|
3 | 4 | // ============================================================ |
4 | 5 | // Session 持久化与上下文压缩 - 深度解析页面 |
@@ -635,35 +636,15 @@ function BestPracticesSection() { |
635 | 636 | ); |
636 | 637 | } |
637 | 638 |
|
638 | | -// 关联页面 |
639 | | -function RelatedPagesSection() { |
640 | | - const pages = [ |
641 | | - { id: 'turn-state-machine', label: 'Turn 状态机', desc: '了解 CompressionStatus 的来源' }, |
642 | | - { id: 'token-accounting', label: 'Token 计费系统', desc: '了解 Token 计数机制' }, |
643 | | - { id: 'memory', label: '上下文管理', desc: '了解整体内存管理策略' }, |
644 | | - { id: 'checkpointing', label: '检查点恢复', desc: '了解 Git 级别的恢复机制' }, |
645 | | - { id: 'history-compression-anim', label: '历史压缩动画', desc: '可视化压缩过程' }, |
646 | | - { id: 'chat-compression-anim', label: '聊天压缩动画', desc: '分割点选择可视化' }, |
647 | | - ]; |
648 | | - |
649 | | - return ( |
650 | | - <div className="mt-8 p-6 bg-gray-800/30 rounded-xl border border-gray-700/50"> |
651 | | - <h3 className="text-lg font-semibold text-gray-200 mb-4">📚 相关页面</h3> |
652 | | - <div className="grid grid-cols-2 gap-3"> |
653 | | - {pages.map((page) => ( |
654 | | - <a |
655 | | - key={page.id} |
656 | | - href={`?tab=${page.id}`} |
657 | | - className="p-3 bg-gray-900/50 rounded-lg hover:bg-gray-700/50 transition-colors group" |
658 | | - > |
659 | | - <div className="text-cyan-400 group-hover:text-cyan-300 font-medium">{page.label}</div> |
660 | | - <div className="text-xs text-gray-500 mt-1">{page.desc}</div> |
661 | | - </a> |
662 | | - ))} |
663 | | - </div> |
664 | | - </div> |
665 | | - ); |
666 | | -} |
| 639 | +// 关联页面配置 |
| 640 | +const sessionRelatedPages = [ |
| 641 | + { id: 'turn-state-machine', label: 'Turn 状态机', description: '了解 CompressionStatus 的来源' }, |
| 642 | + { id: 'token-accounting', label: 'Token 计费系统', description: '了解 Token 计数机制' }, |
| 643 | + { id: 'memory', label: '上下文管理', description: '了解整体内存管理策略' }, |
| 644 | + { id: 'checkpointing', label: '检查点恢复', description: '了解 Git 级别的恢复机制' }, |
| 645 | + { id: 'history-compression-anim', label: '历史压缩动画', description: '可视化压缩过程' }, |
| 646 | + { id: 'chat-compression-anim', label: '聊天压缩动画', description: '分割点选择可视化' }, |
| 647 | +]; |
667 | 648 |
|
668 | 649 | // 主组件 |
669 | 650 | export function SessionPersistence() { |
@@ -707,7 +688,7 @@ export function SessionPersistence() { |
707 | 688 | <BestPracticesSection /> |
708 | 689 | </CollapsibleSection> |
709 | 690 |
|
710 | | - <RelatedPagesSection /> |
| 691 | + <RelatedPages title="📚 相关页面" pages={sessionRelatedPages} /> |
711 | 692 | </div> |
712 | 693 | ); |
713 | 694 | } |
0 commit comments