Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Jan 23, 2026

Closes #11060

Summary

image image

Adds a button in the task header that allows users to restore the workspace to its initial state when the task was created. This uses the baseHash checkpoint created during shadow git initialization. The button only appears when checkpoints are enabled in settings.

Changes

Backend

  • Add checkpointRestoreToBase(task) function in src/core/checkpoints/index.ts
  • Add restoreToTaskStart message handler in src/core/webview/webviewMessageHandler.ts
  • Add restoreToTaskStart message type to packages/types/src/vscode-extension-host.ts
  • Add 4 unit tests for the new checkpoint restore function
  • Add error message translations for all 17 locales

Frontend

  • Add RestoreTaskDialog confirmation dialog component
  • Add restore button (↺) to TaskActions (visible only when checkpoints enabled)
  • Add dialog translations for all 17 locales

User Experience

The button appears in the expanded task header. Clicking it shows a confirmation dialog:

Restore workspace to task start
This will reset all files in the workspace to their state when this task was created. Changes made by this task, by other tasks, or manually will all be reverted. This action cannot be undone.

Testing

  • All 29 checkpoint tests pass including 4 new tests for checkpointRestoreToBase
  • All 5104 total tests pass

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Enhancement New feature or request labels Jan 23, 2026
@roomote
Copy link
Contributor

roomote bot commented Jan 23, 2026

Oroocle Clock   See task on Roo Cloud

Review status: resolved. No new issues found since the last review.

  • Avoid triggering destructive restore action on any Enter keypress while dialog is open (limit to focused action button or remove global key listener).
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

hannesrudolph and others added 2 commits January 28, 2026 14:24
Adds a button in the task header that allows users to restore the workspace
to its initial state when the task was created. This uses the baseHash
checkpoint from the shadow git repository.

- Add checkpointRestoreToBase() function in checkpoints/index.ts
- Add restoreToTaskStart message handler in webviewMessageHandler.ts
- Add RestoreTaskDialog component with confirmation dialog
- Add restore button to TaskActions (visible when checkpoints enabled)
- Add translations for all 17 supported locales
- Add 4 unit tests for the new checkpoint restore function
@hannesrudolph hannesrudolph force-pushed the feat/restore-to-task-start branch from 4d077a3 to 61f49d7 Compare January 28, 2026 21:28
@hannesrudolph hannesrudolph changed the title feat: add restore to task start button feat: add restore to task header Jan 28, 2026
@hannesrudolph hannesrudolph changed the title feat: add restore to task header feat: add restore button to task header Jan 28, 2026
@mrubens
Copy link
Collaborator

mrubens commented Jan 29, 2026

What's the use case for this one?

@hannesrudolph
Copy link
Collaborator Author

What's the use case for this one?

I personally used it when I accidentally made changes and decided I wanted to undo them right back from the beginning of the task. Saved my bacon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

Add ability to restore workspace to initial task state

4 participants