Compare commits

...

1 Commits

Author SHA1 Message Date
default 72960aeb77 fix: show devcontainer Delete menu for failed/error states
The three-dot menu (containing Delete) was gated behind
showDevcontainerControls which requires both a subAgent AND a
container reference. When a devcontainer fails (e.g. exit status 1),
the container and/or subAgent may be missing, hiding the menu entirely.

Decouple the Delete menu from showDevcontainerControls so it renders
whenever the devcontainer is not in a transitioning state (starting,
stopping, deleting). The delete API only needs parentAgent.id and
devcontainer.id, so no subAgent or container is required.

Fixes #23754
2026-04-10 17:27:15 +00:00
2 changed files with 16 additions and 2 deletions
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from "@storybook/react-vite";
import { screen, spyOn, userEvent, within } from "storybook/test";
import { expect, screen, spyOn, userEvent, within } from "storybook/test";
import { API } from "#/api/api";
import { getPreferredProxy } from "#/contexts/ProxyContext";
import { chromatic } from "#/testHelpers/chromatic";
@@ -57,6 +57,13 @@ export const HasError: Story = {
agent: undefined,
},
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const moreActionsButton = canvas.getByRole("button", {
name: "Dev Container actions",
});
expect(moreActionsButton).toBeVisible();
},
};
export const NoPorts: Story = {};
@@ -123,6 +130,13 @@ export const NoContainerOrSubAgent: Story = {
},
subAgents: [],
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const moreActionsButton = canvas.getByRole("button", {
name: "Dev Container actions",
});
expect(moreActionsButton).toBeVisible();
},
};
export const NoContainerOrAgentOrName: Story = {
@@ -274,7 +274,7 @@ export const AgentDevcontainerCard: FC<AgentDevcontainerCardProps> = ({
/>
)}
{showDevcontainerControls && (
{!isTransitioning && (
<AgentDevcontainerMoreActions
deleteDevContainer={deleteDevcontainerMutation.mutate}
/>