feat(site): add pause/resume action buttons to tasks table#21728
Conversation
f62d1c4 to
aa7b615
Compare
Documentation CheckUpdates Needed
The section should:
Suggested placement: After the "Customizing the Task UI" section, before "Automatically name your tasks". Automated review via Coder Tasks |
aa7b615 to
db6e2ee
Compare
Documentation CheckPrevious Feedback✅ Addressed - Documentation for pausing/resuming tasks has been added to The new section accurately describes:
No further documentation changes needed. Automated review via Coder Tasks |
908992c to
399928b
Compare
DanielleMaywood
left a comment
There was a problem hiding this comment.
The *.test.tsx files look like they should be storybook stories
mafredri
left a comment
There was a problem hiding this comment.
Implementation looks good to me, thanks for working on this! A few comments and as Danielle pointed out, we typically don't write .test.tsx files anymore, favoring stories.
For the "error" state, it might make more sense to show "pause" than "resume", or perhaps both. There are many ways a task may end up in this state, including a resumed/running task (which means re-resuming might not help).
I'm a bit conflicted about the "unknown" state. A user would ideally like to resolve this somehow but doing so likely requires manual fiddling with the associated workspace. Perhaps showing "pause" or both buttons in this case would also make sense?
Add TaskActionButton component with pause and resume actions that allow users to stop and start task workspaces directly from the tasks table.
399928b to
caf8569
Compare
ca9ced7 to
9ed54ca
Compare
9ed54ca to
ef995ad
Compare
ef995ad to
bb776a5
Compare
Documentation CheckUpdates Needed
Rationale: This PR adds user-facing action buttons (pause/resume) to the Tasks table. While these controls are discoverable through tooltips, a brief mention in the docs would help users understand they can manage task lifecycle directly from the UI without using the CLI. Suggested content:
Automated review via Coder Tasks |
mafredri
left a comment
There was a problem hiding this comment.
LGTM! I'd recommend going through the Chromatic changes and making sure it looks like you'd expect. I did take a look and it looks OK to me, but changes should be accepted.
|
@EhabY I updated the "Closes" to "Updates" as this doesn't update the tasks view which is also part of the ticket. Were you planning a follow-up or are there no updates to make there? |
|
AFAIK there are no more followups for this ticket except for using the correct API once it lands (pause/resume). Can you elaborate on what you mean with:
Do you mean the Tasks View details? I do not think this is part of this ticket 🤔 |
Ahhh I see the confusion now, I'll just merge this then and create another PR for that one! |


Summary
Add pause and resume action buttons to the tasks table, allowing users to control task workspace lifecycle directly from the list view.
Implementation Decisions
Button Visibility by Task Status
activeinitializingpendingpausederrorunknownRationale:
initializingstate because we have to cancel the build instead of stopping the workspace.API Calls
API.stopWorkspace(workspace_id)to stop the underlying workspace (can use the new API for pausing later on)API.startWorkspace(workspace_id, template_version_id)to restart the workspace with the same template version (can use the new API for resuming later on)Both mutations invalidate the
["tasks"]query on success to refresh the list.Updates coder/internal#1267