Skip to content

Add confirmation dialog before deleting an agent #4

@cheapestinference

Description

@cheapestinference

Description

When a user deletes an agent from the agents list/card view, there is no confirmation dialog — the action can happen accidentally. The ConfigPanel.tsx (agent detail settings) does have a delete confirmation flow, but the agent card components used in the main agents grid do not surface a delete action with a safety prompt at all.

This issue is about adding a proper confirmation dialog (using the existing Dialog UI component) that warns the user before an agent is permanently deleted. The dialog should show the agent name and explain that the gateway will restart.

Where to look

  • src/components/views/AgentsPage.tsx — The main agents list view. Contains an inline AgentCard component that currently has no delete action. A delete button and confirmation flow should be added here.
  • src/components/agents/AgentCard.tsx — An alternative agent card component with a dropdown menu (MoreVertical). Currently has "Chat" and "Configure" actions but no "Delete" option. Adding a delete menu item here with confirmation would be the cleanest approach.
  • src/components/agents/ConfigPanel.tsx — Already implements delete with a confirmation pattern (see showDeleteConfirm state and handleDeleteAgent). Use this as a reference for the delete flow.
  • src/store/dashboard-store.ts — Contains the deleteAgent(agentId) action that calls agents.delete on the gateway.
  • src/components/ui/dialog.tsx — The reusable Dialog component to use for the confirmation modal.
  • src/i18n/locales/en.json — Already has translation keys like "deleteAgent", "confirmDelete", and "deleteDetails" that can be reused.

Acceptance criteria

  • A delete option is available from the agent card (either in AgentsPage.tsx inline card or AgentCard.tsx dropdown menu) — not only buried inside the agent detail settings
  • Clicking delete shows a confirmation dialog that displays the agent name and a warning that the gateway will restart
  • The "main" agent cannot be deleted (only reset) — ensure the delete option is hidden or disabled for the default agent, consistent with the logic in ConfigPanel.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions