feat(site): add confirmation dialogs to agent archive actions by DanielleMaywood · Pull Request #22549 · coder/coder
coder
unlocked this conversation
Adds confirmation dialogs before archiving an agent or archiving an agent and deleting its workspace. Previously, clicking these actions in the TopBar or sidebar dropdown menus would immediately trigger the destructive action with no confirmation step. Both the AgentDetailTopBar and AgentsSidebar ChatTreeNode components now show a ConfirmDialog (type 'delete') before proceeding. Storybook stories cover dialog visibility and handler invocation for both locations.
The confirmation dialog is only needed for the destructive "Archive & Delete Workspace" flow, not the simple archive. Reverts the archive menu items in both TopBar and AgentsSidebar to call the handler directly, and removes the corresponding storybook stories.
…alog Displays the workspace name in 'owner/name' format in the confirmation dialog for the 'Archive & Delete Workspace' action, matching the pattern used elsewhere in the agents UI. - TopBar: receives workspaceName as a prop from AgentDetail, which already fetches the workspace object. - AgentsSidebar: fetches the workspace via useQuery(workspaceById) in ChatTreeNode to resolve the name from workspace_id.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters