feat(site): confirm before batch stopping workspaces - #27631
Conversation
Documentation CheckUpdates Needed
Automated review via Coder Agents |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37e14971d5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await openBulkActions(canvas, user); | ||
| await user.click(await body.findByRole("menuitem", { name: /stop/i })); | ||
|
|
||
| const confirmButton = await body.findByTestId("confirm-button"); |
There was a problem hiding this comment.
Query Stop confirmations by role and name
In both newly changed stop flows, the confirmation control is a real button visibly named Stop, so locating it through confirm-button bypasses the semantic/accessibility contract and would keep passing if the button lost its accessible name. Scope the query to the dialog and use findByRole("button", { name: "Stop" }), including in the mixed-state story.
AGENTS.md reference: site/AGENTS.md:L26-L27
Useful? React with 👍 / 👎.
aqandrew
left a comment
There was a problem hiding this comment.
LGTM except for the Codex comment about workspaceCount being misleading. I'm good with merging this once that's addressed!
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
What
Bulk stopping workspaces from the workspaces table currently fires immediately with no confirmation, whereas the single-row Stop action and the bulk Delete / Update actions all show a dialog first. This adds a confirmation dialog to the bulk Stop action so it matches the rest.
How
BatchStopConfirmation, a smallConfirmDialogwrapper mirroring the wording of the single-workspace stop confirmation but pluralized for the selected count.WorkspacesPage:onBatchStopTransitionnow opens the dialog (setActiveBatchAction("stop")) instead of callingbatchActions.stop(...)directly, and the actual stop runs on confirm. Added"stop"to theBatchActionunion.No change to the underlying
batchActions.stopbehavior (still only stopsrunningworkspaces).Reviewer notes
Before:
onBatchStopTransition={() => batchActions.stop(checkedWorkspaces)}— no confirmation.After: opens
BatchStopConfirmation; confirm callsbatchActions.stop(checkedWorkspaces)then clears the active action, consistent with howBatchDeleteConfirmationandBatchUpdateModalFormare handled.Opened as a draft. Disclosure: this PR was generated by Coder Agents on behalf of @jakehwll.