首页布局优化前

This commit is contained in:
iven
2026-03-17 23:26:16 +08:00
parent 74dbf42644
commit e262200f1e
89 changed files with 2266 additions and 2120 deletions

View File

@@ -5,9 +5,13 @@ import { useGatewayStore, type PluginStatus } from '../store/gatewayStore';
import { toChatAgent, useChatStore } from '../store/chatStore';
import {
Wifi, WifiOff, Bot, BarChart3, Plug, RefreshCw,
MessageSquare, Cpu, FileText, User, Activity, FileCode, Brain
MessageSquare, Cpu, FileText, User, Activity, FileCode, Brain,
Shield, Sparkles, GraduationCap
} from 'lucide-react';
import { MemoryPanel } from './MemoryPanel';
import { ReflectionLog } from './ReflectionLog';
import { AutonomyConfig } from './AutonomyConfig';
import { ActiveLearningPanel } from './ActiveLearningPanel';
import { cardHover, defaultTransition } from '../lib/animations';
import { Button, Badge, EmptyState } from './ui';
import { getPersonalityById } from '../lib/personality-presets';
@@ -19,7 +23,7 @@ export function RightPanel() {
connect, loadClones, loadUsageStats, loadPluginStatus, workspaceInfo, quickConfig, updateClone,
} = useGatewayStore();
const { messages, currentModel, currentAgent, setCurrentAgent } = useChatStore();
const [activeTab, setActiveTab] = useState<'status' | 'files' | 'agent' | 'memory'>('status');
const [activeTab, setActiveTab] = useState<'status' | 'files' | 'agent' | 'memory' | 'reflection' | 'autonomy' | 'learning'>('status');
const [isEditingAgent, setIsEditingAgent] = useState(false);
const [agentDraft, setAgentDraft] = useState<AgentDraft | null>(null);
@@ -152,12 +156,54 @@ export function RightPanel() {
>
<Brain className="w-4 h-4" />
</Button>
<Button
variant={activeTab === 'reflection' ? 'secondary' : 'ghost'}
size="sm"
onClick={() => setActiveTab('reflection')}
className="flex items-center gap-1 text-xs px-2 py-1"
title="Reflection"
aria-label="Reflection"
aria-selected={activeTab === 'reflection'}
role="tab"
>
<Sparkles className="w-4 h-4" />
</Button>
<Button
variant={activeTab === 'autonomy' ? 'secondary' : 'ghost'}
size="sm"
onClick={() => setActiveTab('autonomy')}
className="flex items-center gap-1 text-xs px-2 py-1"
title="Autonomy"
aria-label="Autonomy"
aria-selected={activeTab === 'autonomy'}
role="tab"
>
<Shield className="w-4 h-4" />
</Button>
<Button
variant={activeTab === 'learning' ? 'secondary' : 'ghost'}
size="sm"
onClick={() => setActiveTab('learning')}
className="flex items-center gap-1 text-xs px-2 py-1"
title="Learning"
aria-label="Learning"
aria-selected={activeTab === 'learning'}
role="tab"
>
<GraduationCap className="w-4 h-4" />
</Button>
</div>
</div>
<div className="flex-1 overflow-y-auto custom-scrollbar p-4 space-y-4">
{activeTab === 'memory' ? (
<MemoryPanel />
) : activeTab === 'reflection' ? (
<ReflectionLog />
) : activeTab === 'autonomy' ? (
<AutonomyConfig />
) : activeTab === 'learning' ? (
<ActiveLearningPanel />
) : activeTab === 'agent' ? (
<div className="space-y-4">
<motion.div