From ae7f13c3af1c8cb034ea4a270fefd78be21ebb20 Mon Sep 17 00:00:00 2001 From: zenchantlive Date: Sun, 1 Mar 2026 17:22:25 -0800 Subject: [PATCH] feat(8ij.4): add LaunchSwarmDialog to TopBar as global action Co-Authored-By: Oz --- src/components/shared/top-bar.tsx | 62 ++++++++++++++++++++++++- src/components/shared/unified-shell.tsx | 1 + 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/src/components/shared/top-bar.tsx b/src/components/shared/top-bar.tsx index a419f44..e80e759 100644 --- a/src/components/shared/top-bar.tsx +++ b/src/components/shared/top-bar.tsx @@ -1,10 +1,11 @@ 'use client'; -import { ReactNode } from 'react'; -import { LayoutGrid, Lock, Plus, Sidebar, SidebarClose } from 'lucide-react'; +import { ReactNode, useState } from 'react'; +import { LayoutGrid, Lock, Plus, Sidebar, SidebarClose, Rocket } from 'lucide-react'; import { useUrlState } from '../../hooks/use-url-state'; import { useResponsive } from '../../hooks/use-responsive'; import { ThemeToggle } from './theme-toggle'; +import { LaunchSwarmDialog } from '../swarm/launch-dialog'; export interface TopBarProps { onCreateTask?: () => Promise | void; @@ -15,6 +16,9 @@ export interface TopBarProps { criticalAlerts?: number; idleCount?: number; busyCount?: number; + actor?: string; + onActorChange?: (name: string) => void; + projectRoot?: string; } interface MetricTileProps { @@ -42,6 +46,36 @@ function MetricTile({ label, value, accent = 'info' }: MetricTileProps) { ); } +function IdentityChip({ actor, onActorChange }: { actor: string; onActorChange: (name: string) => void }) { + const [editing, setEditing] = useState(false); + + if (editing) { + return ( + onActorChange(e.target.value)} + onBlur={() => setEditing(false)} + onKeyDown={e => { if (e.key === 'Enter') setEditing(false); }} + placeholder="your name" + className="h-7 w-28 rounded-full border border-[var(--accent-info)] bg-[var(--surface-tertiary)] px-3 text-xs text-[var(--text-primary)] outline-none" + /> + ); + } + + return ( + + ); +} + export function TopBar({ onCreateTask, isCreatingTask = false, @@ -51,9 +85,13 @@ export function TopBar({ criticalAlerts = 0, idleCount = 0, busyCount = 0, + actor = '', + onActorChange, + projectRoot, }: TopBarProps) { const { leftPanel, toggleLeftPanel, rightPanel, toggleRightPanel, blockedOnly, toggleBlockedOnly } = useUrlState(); const { isDesktop } = useResponsive(); + const [showLaunchSwarm, setShowLaunchSwarm] = useState(false); return (
@@ -113,6 +151,17 @@ export function TopBar({ + {projectRoot && ( + + )} +
); } diff --git a/src/components/shared/unified-shell.tsx b/src/components/shared/unified-shell.tsx index cc5209c..e3e31ea 100644 --- a/src/components/shared/unified-shell.tsx +++ b/src/components/shared/unified-shell.tsx @@ -192,6 +192,7 @@ export function UnifiedShell({ idleCount={0} actor={actor} onActorChange={handleActorChange} + projectRoot={projectRoot} /> {!bdHealth.loading && !bdHealth.healthy ? (