diff --git a/desktop/src/App.tsx b/desktop/src/App.tsx index 04e9477..62d383d 100644 --- a/desktop/src/App.tsx +++ b/desktop/src/App.tsx @@ -7,7 +7,9 @@ import { SettingsLayout } from './components/Settings/SettingsLayout'; import { HandTaskPanel } from './components/HandTaskPanel'; import { WorkflowList } from './components/WorkflowList'; import { TriggersPanel } from './components/TriggersPanel'; +import { TeamCollaborationView } from './components/TeamCollaborationView'; import { useGatewayStore } from './store/gatewayStore'; +import { useTeamStore } from './store/teamStore'; import { getStoredGatewayToken } from './lib/gateway-client'; type View = 'main' | 'settings'; @@ -16,7 +18,9 @@ function App() { const [view, setView] = useState('main'); const [mainContentView, setMainContentView] = useState('chat'); const [selectedHandId, setSelectedHandId] = useState(undefined); + const [selectedTeamId, setSelectedTeamId] = useState(undefined); const { connect, connectionState } = useGatewayStore(); + const { activeTeam, setActiveTeam, teams } = useTeamStore(); useEffect(() => { document.title = 'ZCLAW'; @@ -38,6 +42,14 @@ function App() { } }; + const handleSelectTeam = (teamId: string) => { + const team = teams.find(t => t.id === teamId); + if (team) { + setActiveTeam(team); + setSelectedTeamId(teamId); + } + }; + if (view === 'settings') { return setView('main')} />; } @@ -50,6 +62,8 @@ function App() { onMainViewChange={handleMainViewChange} selectedHandId={selectedHandId} onSelectHand={setSelectedHandId} + selectedTeamId={selectedTeamId} + onSelectTeam={handleSelectTeam} /> {/* 中间区域 */} @@ -76,6 +90,22 @@ function App() { + ) : mainContentView === 'team' ? ( + activeTeam ? ( + + ) : ( +
+
+
+ 👥 +
+

选择或创建团队

+

+ 从左侧列表选择一个团队,或点击 + 创建新的多 Agent 协作团队。 +

+
+
+ ) ) : ( )} diff --git a/desktop/src/components/Sidebar.tsx b/desktop/src/components/Sidebar.tsx index a9ee9d8..c401a67 100644 --- a/desktop/src/components/Sidebar.tsx +++ b/desktop/src/components/Sidebar.tsx @@ -3,26 +3,37 @@ import { Settings } from 'lucide-react'; import { CloneManager } from './CloneManager'; import { HandList } from './HandList'; import { TaskList } from './TaskList'; +import { TeamList } from './TeamList'; import { useGatewayStore } from '../store/gatewayStore'; -export type MainViewType = 'chat' | 'hands' | 'workflow'; +export type MainViewType = 'chat' | 'hands' | 'workflow' | 'team'; interface SidebarProps { onOpenSettings?: () => void; onMainViewChange?: (view: MainViewType) => void; selectedHandId?: string; onSelectHand?: (handId: string) => void; + selectedTeamId?: string; + onSelectTeam?: (teamId: string) => void; } -type Tab = 'clones' | 'hands' | 'workflow'; +type Tab = 'clones' | 'hands' | 'workflow' | 'team'; const TABS: { key: Tab; label: string; mainView?: MainViewType }[] = [ { key: 'clones', label: '分身' }, { key: 'hands', label: 'HANDS', mainView: 'hands' }, { key: 'workflow', label: 'Workflow', mainView: 'workflow' }, + { key: 'team', label: 'Team', mainView: 'team' }, ]; -export function Sidebar({ onOpenSettings, onMainViewChange, selectedHandId, onSelectHand }: SidebarProps) { +export function Sidebar({ + onOpenSettings, + onMainViewChange, + selectedHandId, + onSelectHand, + selectedTeamId, + onSelectTeam +}: SidebarProps) { const [activeTab, setActiveTab] = useState('clones'); const userName = useGatewayStore((state) => state.quickConfig.userName) || '用户7141'; @@ -37,22 +48,21 @@ export function Sidebar({ onOpenSettings, onMainViewChange, selectedHandId, onSe const handleSelectHand = (handId: string) => { onSelectHand?.(handId); - // 切换到 hands 视图 setActiveTab('hands'); onMainViewChange?.('hands'); }; return ( -