Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix: group button and working status

Gusebc646fb2841
diff --git a/src/web/src/app/(app)/w/[slug]/home/page.tsx b/src/web/src/app/(app)/w/[slug]/home/page.tsx
index 29a30ebdc..5e5dbd3e8 100644
--- a/src/web/src/app/(app)/w/[slug]/home/page.tsx
+++ b/src/web/src/app/(app)/w/[slug]/home/page.tsx
@@ -417,8 +417,8 @@ function AgentCanvas() {
/>
<div className="absolute bottom-4 right-4 z-10 flex flex-wrap justify-end items-end gap-2">
- <ActiveTasksFloat />
<UpcomingEventsFloat />
+ <ActiveTasksFloat />
</div>
{/* Create agent button */}
diff --git a/src/web/src/components/agent-preview-card.tsx b/src/web/src/components/agent-preview-card.tsx
index 10dd4af58..0d1df6238 100644
--- a/src/web/src/components/agent-preview-card.tsx
+++ b/src/web/src/components/agent-preview-card.tsx
@@ -85,7 +85,7 @@ export function AgentPreviewCard({
"size-1.5 rounded-full",
!isOnline ? "bg-status-offline" : "bg-status-online"
)} />
- {!isOnline ? "Offline" : (activeTaskCount ?? 0) > 0 ? "Working" : "Online"}
+ {!isOnline ? "Offline" : (activeTaskCount ?? 0) > 0 ? "Working" : null}
</span>
)}
</div>
diff --git a/src/web/src/components/agent-status-badge.tsx b/src/web/src/components/agent-status-badge.tsx
index 79b5f4de6..cd6243481 100644
--- a/src/web/src/components/agent-status-badge.tsx
+++ b/src/web/src/components/agent-status-badge.tsx
@@ -105,13 +105,11 @@ export function AgentStatusBadge({ isOnline, taskCount, agentId }: AgentStatusBa
}
>
<StatusDot online />
- {taskCount > 0 ? (
+ {taskCount > 0 && (
<>
<span className="hidden sm:inline">Working</span>
<span className="tabular-nums">{taskCount}</span>
</>
- ) : (
- <span className="hidden sm:inline">Online</span>
)}
</PopoverTrigger>
<PopoverContent className="w-72 p-1">
diff --git a/src/web/src/components/sidebar/agent-sidebar-button.tsx b/src/web/src/components/sidebar/agent-sidebar-button.tsx
index 072bd7eef..f1d4d594c 100644
--- a/src/web/src/components/sidebar/agent-sidebar-button.tsx
+++ b/src/web/src/components/sidebar/agent-sidebar-button.tsx
@@ -25,6 +25,7 @@ export function AgentSidebarButton({
onPin,
onUnpin,
extraContextMenuItems,
+ hidePin,
}: {
agent: Agent;
isActive: boolean;
@@ -35,6 +36,7 @@ export function AgentSidebarButton({
onPin: () => void;
onUnpin: () => void;
extraContextMenuItems?: React.ReactNode;
+ hidePin?: boolean;
}) {
const [previewOpen, setPreviewOpen] = useState(false);
return (
@@ -79,7 +81,7 @@ export function AgentSidebarButton({
)} />
</PopoverTrigger>
<ContextMenuContent>
- {isPinned ? (
+ {!hidePin && (isPinned ? (
<ContextMenuItem onClick={onUnpin}>
<PinOffIcon className="size-3.5 mr-1.5" />
Unpin
@@ -89,7 +91,7 @@ export function AgentSidebarButton({
<PinIcon className="size-3.5 mr-1.5" />
Pin to top
</ContextMenuItem>
- )}
+ ))}
{extraContextMenuItems}
</ContextMenuContent>
</ContextMenu>
diff --git a/src/web/src/components/sidebar/folder-popover.tsx b/src/web/src/components/sidebar/folder-popover.tsx
index 01bb800b6..d85b3af60 100644
--- a/src/web/src/components/sidebar/folder-popover.tsx
+++ b/src/web/src/components/sidebar/folder-popover.tsx
@@ -4,10 +4,7 @@ import { useState, useRef, useEffect, useCallback } from "react";
import type { Agent } from "@alook/shared";
import type { AgentFolder } from "@/hooks/use-agent-folders";
import { AgentSidebarButton } from "./agent-sidebar-button";
-import {
- ContextMenuItem,
- ContextMenuSeparator,
-} from "@/components/ui/context-menu";
+import { ContextMenuItem } from "@/components/ui/context-menu";
import { PinOffIcon } from "lucide-react";
import {
DndContext,
@@ -99,7 +96,8 @@ export function FolderPopover({
popoverRef.current &&
!popoverRef.current.contains(target) &&
anchorRef &&
- !anchorRef.contains(target)
+ !anchorRef.contains(target) &&
+ !(target as HTMLElement).closest?.('[data-slot="context-menu-content"]')
) {
onClose();
}
@@ -166,6 +164,7 @@ export function FolderPopover({
isPinned={false}
isOnline={isOnline}
taskCount={taskCounts[agent.id] ?? 0}
+ hidePin
onClick={() => {
onAgentClick(agent.id);
onClose();
@@ -176,15 +175,12 @@ export function FolderPopover({
}}
onUnpin={() => {}}
extraContextMenuItems={
- <>
- <ContextMenuSeparator />
- <ContextMenuItem
- onClick={() => onRemoveFromFolder(agent.id)}
- >
- <PinOffIcon className="size-3.5 mr-1.5" />
- Remove from group
- </ContextMenuItem>
- </>
+ <ContextMenuItem
+ onClick={() => onRemoveFromFolder(agent.id)}
+ >
+ <PinOffIcon className="size-3.5 mr-1.5" />
+ Remove from group
+ </ContextMenuItem>
}
/>
</SortablePopoverAgent>