Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

feat: make sidebar to show online/offline

Gus74575ea1d0a8
diff --git a/src/web/src/components/agent-preview-card.tsx b/src/web/src/components/agent-preview-card.tsx
index 9c81e44c6..10dd4af58 100644
--- a/src/web/src/components/agent-preview-card.tsx
+++ b/src/web/src/components/agent-preview-card.tsx
@@ -45,7 +45,7 @@ export function AgentPreviewCard({
{(() => {
const avatarConfig = parseAvatarUrl(agent.avatar_url);
if (avatarConfig) {
- return <AnimatedAvatar config={avatarConfig} size={32} className="shrink-0 rounded-xl" isHovered={isHovered ?? false} />;
+ return <AnimatedAvatar config={avatarConfig} size={32} className="shrink-0 rounded-xl" isHovered={isHovered ?? false} isWorking={!!isOnline && (activeTaskCount ?? 0) > 0} />;
}
return (
<div className="flex items-center justify-center size-8 rounded-xl bg-secondary text-secondary-foreground text-xs font-medium shrink-0">
@@ -83,8 +83,7 @@ export function AgentPreviewCard({
<span className="inline-flex items-center gap-1 text-[11px] text-muted-foreground">
<span className={cn(
"size-1.5 rounded-full",
- !isOnline ? "bg-status-offline" : "bg-status-online",
- isOnline && (activeTaskCount ?? 0) > 0 && "animate-pulse"
+ !isOnline ? "bg-status-offline" : "bg-status-online"
)} />
{!isOnline ? "Offline" : (activeTaskCount ?? 0) > 0 ? "Working" : "Online"}
</span>
diff --git a/src/web/src/components/agent-status-badge.tsx b/src/web/src/components/agent-status-badge.tsx
index afbd3a6e4..9803e2e91 100644
--- a/src/web/src/components/agent-status-badge.tsx
+++ b/src/web/src/components/agent-status-badge.tsx
@@ -35,13 +35,12 @@ function getTaskRoute(slug: string, agentId: string, type: string) {
}
}
-function StatusDot({ online, pulse }: { online: boolean; pulse?: boolean }) {
+function StatusDot({ online }: { online: boolean }) {
return (
<span
className={cn(
"size-1.5 rounded-full shrink-0",
- online ? "bg-status-online" : "bg-status-offline",
- pulse && "animate-pulse"
+ online ? "bg-status-online" : "bg-status-offline"
)}
/>
);
@@ -106,7 +105,7 @@ export function AgentStatusBadge({ isOnline, taskCount, agentId }: AgentStatusBa
/>
}
>
- <StatusDot online pulse={taskCount > 0} />
+ <StatusDot online />
{taskCount > 0 ? (
<>
<span className="hidden sm:inline">Working</span>
diff --git a/src/web/src/components/app-sidebar.tsx b/src/web/src/components/app-sidebar.tsx
index 859936b21..16d43181c 100644
--- a/src/web/src/components/app-sidebar.tsx
+++ b/src/web/src/components/app-sidebar.tsx
@@ -79,13 +79,14 @@ function AgentSidebarButton({
{(() => {
const avatarConfig = parseAvatarUrl(agent.avatar_url);
if (avatarConfig) {
- return <AnimatedAvatar config={avatarConfig} size={40} className="rounded-xl" isHovered={false} isWorking={taskCount > 0} />;
+ return <AnimatedAvatar config={avatarConfig} size={40} className="rounded-xl" isHovered={false} />;
}
return agent.name.charAt(0).toUpperCase();
})()}
- {taskCount > 0 && (
- <span className="absolute bottom-0 right-0 size-2 rounded-full bg-status-online animate-pulse ring-2 ring-background" />
- )}
+ <span className={cn(
+ "absolute bottom-0 right-0 size-2 rounded-full ring-2 ring-background",
+ isOnline ? "bg-status-online" : "bg-status-offline"
+ )} />
</PopoverTrigger>
<ContextMenuContent>
{isPinned ? (