Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import { getSessionService } from "@features/sessions/service/service";
import {
MagnifyingGlassMinus,
MagnifyingGlassPlus,
Stop,
Trash,
} from "@phosphor-icons/react";
import { Flex, Select, Text } from "@radix-ui/themes";
import type {
CommandCenterCellData,
StatusSummary,
} from "../hooks/useCommandCenterData";
import type { StatusSummary } from "../hooks/useCommandCenterData";
import {
type LayoutPreset,
useCommandCenterStore,
Expand Down Expand Up @@ -68,7 +63,6 @@ const LAYOUT_OPTIONS: {

interface CommandCenterToolbarProps {
summary: StatusSummary;
cells: CommandCenterCellData[];
}

function StatusSummaryText({ summary }: { summary: StatusSummary }) {
Expand All @@ -85,31 +79,14 @@ function StatusSummaryText({ summary }: { summary: StatusSummary }) {
);
}

export function CommandCenterToolbar({
summary,
cells,
}: CommandCenterToolbarProps) {
export function CommandCenterToolbar({ summary }: CommandCenterToolbarProps) {
const layout = useCommandCenterStore((s) => s.layout);
const setLayout = useCommandCenterStore((s) => s.setLayout);
const clearAll = useCommandCenterStore((s) => s.clearAll);
const zoom = useCommandCenterStore((s) => s.zoom);
const zoomIn = useCommandCenterStore((s) => s.zoomIn);
const zoomOut = useCommandCenterStore((s) => s.zoomOut);

const hasActiveAgents = summary.running > 0 || summary.waiting > 0;

const stopAll = () => {
const service = getSessionService();
for (const cell of cells) {
if (
cell.taskId &&
(cell.status === "running" || cell.status === "waiting")
) {
service.cancelPrompt(cell.taskId);
}
}
};

return (
<Flex
align="center"
Expand Down Expand Up @@ -163,17 +140,6 @@ export function CommandCenterToolbar({

<div className="flex-1" />

<button
type="button"
onClick={stopAll}
disabled={!hasActiveAgents}
className="flex items-center gap-1 rounded px-1.5 py-0.5 text-[12px] text-red-10 transition-colors hover:bg-red-3 hover:text-red-11 disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-red-10"
title="Stop all agents"
>
<Stop size={12} weight="fill" />
Stop All
</button>

<button
type="button"
onClick={clearAll}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function CommandCenterView() {

return (
<Flex direction="column" height="100%">
<CommandCenterToolbar summary={summary} cells={cells} />
<CommandCenterToolbar summary={summary} />
<Box className="min-h-0 flex-1">
<CommandCenterGrid layout={layout} cells={cells} />
</Box>
Expand Down
Loading