mirror of
https://github.com/coder/coder.git
synced 2026-11-08 05:32:55 +08:00
When archiving a chat that has an attached workspace, a dialog now pops up asking whether to also delete the associated workspace. ## Changes ### New file: `ArchiveAgentDialog.tsx` A Radix-based dialog component that appears when archiving a chat that has a `workspace_id`. It provides: - A checkbox to opt into deleting the associated workspace - **Cancel** — closes without archiving - **Archive only** — archives the chat, leaves the workspace intact - **Archive & Delete Workspace** — archives the chat and triggers workspace deletion (enabled only when checkbox is checked) ### Modified: `AgentsPage.tsx` - Extracted archive logic into a `performArchive` helper - `requestArchiveAgent` now checks if the chat has a `workspace_id`: - If yes, opens the `ArchiveAgentDialog` - If no, proceeds with archiving directly (existing behavior) - Added `handleArchiveOnly`, `handleArchiveAndDeleteWorkspace`, and `handleCloseArchiveDialog` handlers - Renders the `<ArchiveAgentDialog>` at the page level Chats without a workspace are archived immediately as before — no UX change for those.