Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Expand Up @@ -116,7 +116,6 @@ export const PERSISTED_KEY_REGISTRY: ReadonlyArray<
"browser-import-banner-dismissals-v1",
],
],
["src/renderer/stores/workspace-agents-row.ts", ["workspace-agents-row"]],
[
"src/renderer/routes/_authenticated/settings/usage/utils/usageLastSection/usageLastSection.ts",
["usage-last-section-v1"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export const DEAD_KEYS: DeadKey[] = [
{ key: "last-active-v2-workspace", match: "exact" },
// Sidebar automations failure badge removed; it polled for every window
{ key: "automation-failures-v1", match: "exact" },
// Sidebar workspace agents chip removed along with its experiment toggle
{ key: "workspace-agents-row", match: "exact" },
];

function matchesDeadKey(key: string): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import { cn } from "@superset/ui/utils";
import type { MouseEventHandler, SyntheticEvent } from "react";
import { useDashboardSidebarWorkspacePorts } from "renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/providers/DashboardSidebarPortsProvider";
import { useInlineWorkspacePortsEnabled } from "renderer/stores/inline-workspace-ports";
import { useWorkspaceAgentsRowEnabled } from "renderer/stores/workspace-agents-row";
import type { DashboardSidebarWorkspaceIndentation } from "../../../../../../types";
import { DashboardSidebarAgentsChip } from "./components/DashboardSidebarAgentsChip";
import { DashboardSidebarPortsChip } from "./components/DashboardSidebarPortsChip";
import { useDashboardSidebarWorkspaceRunningAgents } from "./hooks/useDashboardSidebarWorkspaceRunningAgents";

interface DashboardSidebarWorkspaceChipsProps {
workspaceId: string;
Expand All @@ -26,36 +23,18 @@ function stopChipDragStart(event: SyntheticEvent<HTMLDivElement>) {
}
}

/**
* Activity line beneath a workspace row, left-aligned with the title: an
* agents chip and a ports chip. Agent chips appear only when more than one
* agent is running — a lone agent is the norm for a workspace and showing it
* adds no signal.
*/
/** Activity line beneath a workspace row, left-aligned with the title. */
export function DashboardSidebarWorkspaceChips({
workspaceId,
isInSection = false,
indentation,
onClick,
}: DashboardSidebarWorkspaceChipsProps) {
const inlineWorkspacePortsEnabled = useInlineWorkspacePortsEnabled();
const workspaceAgentsRowEnabled = useWorkspaceAgentsRowEnabled();

const portGroup = useDashboardSidebarWorkspacePorts(workspaceId);
const ports = inlineWorkspacePortsEnabled ? (portGroup?.ports ?? []) : [];
const runningAgents = useDashboardSidebarWorkspaceRunningAgents(workspaceId);
// One agent alone is what the pane already shows; the chip earns its
// place once there is more than one, or once the one has subagents
// running underneath it that the sidebar would otherwise never surface.
const hasSubagents = runningAgents.some(
(agent) => agent.subagents.length > 0,
);
const agents =
workspaceAgentsRowEnabled && (runningAgents.length > 1 || hasSubagents)
? runningAgents
: [];

if (ports.length === 0 && agents.length === 0) {
if (ports.length === 0) {
return null;
}

Expand Down Expand Up @@ -90,10 +69,7 @@ export function DashboardSidebarWorkspaceChips({
onClick(event);
}}
>
{agents.length > 0 && (
<DashboardSidebarAgentsChip workspaceId={workspaceId} agents={agents} />
)}
{ports.length > 0 && <DashboardSidebarPortsChip ports={ports} />}
<DashboardSidebarPortsChip ports={ports} />
</div>
);
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading