fix(ui): remove action buttons from agent list
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
fac07b42ad
commit
bb41aa1a30
|
|
@ -479,15 +479,11 @@ describe("Agents", () => {
|
|||
expect(subtitle).toBeDefined();
|
||||
expect(subtitle?.classList.contains("truncate")).toBe(true);
|
||||
const actions = row?.querySelector('button[aria-label="Open actions for Paperclip Engineer With A Much Longer Display Name"]');
|
||||
expect(actions).not.toBeNull();
|
||||
// Neither the action button nor its ancestors may hide the mobile menu.
|
||||
for (let node = actions; node && node !== row; node = node.parentElement) {
|
||||
expect(node.classList.contains("hidden")).toBe(false);
|
||||
}
|
||||
await act(async () => { (actions as HTMLButtonElement).click(); });
|
||||
await flushReact();
|
||||
expect(document.body.textContent).toContain("Duplicate");
|
||||
expect(document.body.textContent).toContain("Terminate");
|
||||
expect(actions).toBeNull();
|
||||
expect(row?.textContent).not.toContain("Assign Task");
|
||||
expect(row?.textContent).not.toContain("Run Heartbeat");
|
||||
expect(row?.textContent).not.toContain("Run with provider trace");
|
||||
expect(row?.textContent).not.toContain("Pause");
|
||||
});
|
||||
|
||||
it("uses the built-in agents route segment as the built-in filter", async () => {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import { builtInAgentsApi, type BuiltInAgentState } from "../api/builtInAgents";
|
|||
import { environmentsApi } from "../api/environments";
|
||||
import { heartbeatsApi } from "../api/heartbeats";
|
||||
import { instanceSettingsApi } from "../api/instanceSettings";
|
||||
import { accessApi } from "../api/access";
|
||||
import { useCompany } from "../context/CompanyContext";
|
||||
import { useDialogActions } from "../context/DialogContext";
|
||||
import { useBreadcrumbs } from "../context/BreadcrumbContext";
|
||||
|
|
@ -15,7 +14,6 @@ import { useStreamlinedUiEnabled } from "../hooks/useStreamlinedUiEnabled";
|
|||
import { queryKeys } from "../lib/queryKeys";
|
||||
import { isPlatformManagedEnvironment } from "../lib/managed-sandbox-environment";
|
||||
import { AgentStatusBadge, AgentStatusCapsule } from "../components/StatusBadge";
|
||||
import { AgentActionButtons } from "../components/AgentActionButtons";
|
||||
import { MembershipAction } from "../components/MembershipAction";
|
||||
import { StarToggle } from "../components/StarToggle";
|
||||
import { EntityRow } from "../components/EntityRow";
|
||||
|
|
@ -211,15 +209,6 @@ export function Agents({ initialView = "list" }: { initialView?: AgentsView } =
|
|||
setView(streamlinedUiEnabled ? initialView : "org");
|
||||
}, [initialView, streamlinedUiEnabled]);
|
||||
|
||||
const { data: boardAccess } = useQuery({
|
||||
queryKey: queryKeys.access.currentBoardAccess,
|
||||
queryFn: () => accessApi.getCurrentBoardAccess(),
|
||||
retry: false,
|
||||
});
|
||||
const canUseProviderTrace =
|
||||
boardAccess?.source === "local_implicit" ||
|
||||
boardAccess?.isInstanceAdmin === true;
|
||||
|
||||
const { data: instanceSettings } = useQuery({
|
||||
queryKey: queryKeys.instance.settings,
|
||||
queryFn: () => instanceSettingsApi.get(),
|
||||
|
|
@ -411,32 +400,11 @@ export function Agents({ initialView = "list" }: { initialView?: AgentsView } =
|
|||
) : (
|
||||
<AgentStatusCapsule status={agent.status} />
|
||||
)}
|
||||
secondaryRow={
|
||||
<div className="flex flex-col gap-2">
|
||||
{builtInCluster && (
|
||||
<div className="@5xl:hidden flex flex-wrap items-center gap-1.5">
|
||||
{builtInCluster}
|
||||
</div>
|
||||
)}
|
||||
{/* Actions have their own wrapping line, so names keep their width. */}
|
||||
<div
|
||||
className="pt-1"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}}
|
||||
>
|
||||
<AgentActionButtons
|
||||
agent={agent}
|
||||
companyId={selectedCompanyId}
|
||||
runLabel="Run Heartbeat"
|
||||
showStatus={false}
|
||||
canRunWithProviderTrace={canUseProviderTrace}
|
||||
className="flex flex-wrap items-center gap-2"
|
||||
/>
|
||||
</div>
|
||||
secondaryRow={builtInCluster && (
|
||||
<div className="@5xl:hidden flex flex-wrap items-center gap-1.5">
|
||||
{builtInCluster}
|
||||
</div>
|
||||
}
|
||||
)}
|
||||
meta={
|
||||
<div className="flex items-center gap-3">
|
||||
{builtInCluster && (
|
||||
|
|
|
|||
Loading…
Reference in New Issue