Skip to content

feat(site): add pause/resume action buttons to tasks table#21728

Merged
EhabY merged 6 commits intomainfrom
add-resume-pause-buttons-to-tasks
Feb 4, 2026
Merged

feat(site): add pause/resume action buttons to tasks table#21728
EhabY merged 6 commits intomainfrom
add-resume-pause-buttons-to-tasks

Conversation

@EhabY
Copy link
Contributor

@EhabY EhabY commented Jan 28, 2026

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

Task Status Button Shown Button State
active Pause Enabled
initializing Pause Disabled
pending Pause Disabled
paused Resume Enabled
error Resume Enabled
unknown None N/A

Rationale:

  • Pause is shown for active/initializing/pending tasks but disabled during initialization since the workspace isn't ready yet
  • Resume is shown for both paused and error states to allow recovery from failures
  • Tasks with unknown status show no action buttons
  • Pause is disabled during initializing state because we have to cancel the build instead of stopping the workspace.

API Calls

  • Pause: Calls API.stopWorkspace(workspace_id) to stop the underlying workspace (can use the new API for pausing later on)
  • Resume: Calls 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

@EhabY EhabY force-pushed the add-resume-pause-buttons-to-tasks branch from f62d1c4 to aa7b615 Compare January 28, 2026 11:41
@coder-tasks
Copy link
Contributor

coder-tasks bot commented Jan 28, 2026

Documentation Check

Updates Needed

  • docs/ai-coder/tasks.md - Add a section about pausing and resuming tasks from the Tasks UI. This new UI feature allows users to pause running tasks to save resources and resume them later directly from the table view, which is a significant workflow improvement that should be documented.

The section should:

  • Explain that pause/resume buttons appear in the tasks table for different task states
  • Describe the button behavior for each status (active, initializing, pending, paused, error)
  • Note that pausing saves resources and resuming restarts the workspace
  • Mention this is an alternative to using the CLI commands or navigating to individual workspace settings

Suggested placement: After the "Customizing the Task UI" section, before "Automatically name your tasks".


Automated review via Coder Tasks

@EhabY EhabY force-pushed the add-resume-pause-buttons-to-tasks branch from aa7b615 to db6e2ee Compare January 28, 2026 11:55
@coder-tasks
Copy link
Contributor

coder-tasks bot commented Jan 28, 2026

Documentation Check

Previous Feedback

✅ Addressed - Documentation for pausing/resuming tasks has been added to docs/ai-coder/tasks.md.

The new section accurately describes:

  • The pause/resume button functionality in the Tasks table
  • Button behavior for different task states
  • Resource-saving benefits of pausing tasks
  • Context about workspace restart time when resuming

No further documentation changes needed.


Automated review via Coder Tasks

@EhabY EhabY force-pushed the add-resume-pause-buttons-to-tasks branch 2 times, most recently from 908992c to 399928b Compare January 28, 2026 12:23
@mafredri mafredri self-requested a review January 30, 2026 11:15
@DanielleMaywood DanielleMaywood self-requested a review February 2, 2026 14:07
Copy link
Contributor

@DanielleMaywood DanielleMaywood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The *.test.tsx files look like they should be storybook stories

Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

EhabY added 3 commits February 4, 2026 11:05
Add TaskActionButton component with pause and resume actions
that allow users to stop and start task workspaces directly from the
tasks table.
@EhabY EhabY force-pushed the add-resume-pause-buttons-to-tasks branch from 399928b to caf8569 Compare February 4, 2026 08:05
@EhabY EhabY force-pushed the add-resume-pause-buttons-to-tasks branch from ca9ced7 to 9ed54ca Compare February 4, 2026 08:52
@EhabY EhabY force-pushed the add-resume-pause-buttons-to-tasks branch from 9ed54ca to ef995ad Compare February 4, 2026 08:58
@EhabY EhabY force-pushed the add-resume-pause-buttons-to-tasks branch from ef995ad to bb776a5 Compare February 4, 2026 09:16
@coder-tasks
Copy link
Contributor

coder-tasks bot commented Feb 4, 2026

Documentation Check

Updates Needed

  • docs/ai-coder/tasks.md - Add a brief section about managing tasks through the web UI, mentioning the pause/resume controls. The current documentation focuses entirely on setup and CLI, but doesn't explain how to interact with tasks in the UI.

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:

  • Brief section (2-3 sentences) under "Getting Started" or new "Managing Tasks" section
  • Mention that tasks can be paused to save resources and resumed later
  • Note that these actions control the underlying workspace lifecycle
  • Optional: Update the tasks-ui.png screenshot to show the new action buttons

Automated review via Coder Tasks

Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mafredri
Copy link
Member

mafredri commented Feb 4, 2026

@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?

@EhabY
Copy link
Contributor Author

EhabY commented Feb 4, 2026

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:

as this doesn't update the tasks view which is also part of the ticket

Do you mean the Tasks View details? I do not think this is part of this ticket 🤔

@mafredri
Copy link
Member

mafredri commented Feb 4, 2026

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:

as this doesn't update the tasks view which is also part of the ticket

Do you mean the Tasks View details? I do not think this is part of this ticket 🤔

Yeah, I mean pause/resume updates to Tasks view. From the ticket, there's e.g:

  • Task view (TaskPage.tsx): Add Pause/Resume buttons to action area

Apologies if it's unclear as this was from before the Figma updates, but AFAIK we don't have another ticket tracking this work.

Here's a few examples of current UI that need updating:

image image

@EhabY
Copy link
Contributor Author

EhabY commented Feb 4, 2026

Here's a few examples of current UI that need updating:

Ahhh I see the confusion now, I'll just merge this then and create another PR for that one!

@EhabY EhabY merged commit d5ae72d into main Feb 4, 2026
29 of 30 checks passed
@EhabY EhabY deleted the add-resume-pause-buttons-to-tasks branch February 4, 2026 19:30
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants