Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

feat: add restore button to task header - #10908

Closed
hannesrudolph wants to merge 2 commits into
mainfrom
feat/restore-to-task-start
Closed

feat: add restore button to task header#10908
hannesrudolph wants to merge 2 commits into
mainfrom
feat/restore-to-task-start

Conversation

@hannesrudolph

@hannesrudolph hannesrudolph commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

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

ghost commented Jan 23, 2026

Copy link
Copy Markdown

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.

Comment thread webview-ui/src/components/chat/RestoreTaskDialog.tsx Outdated
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

mrubens commented Jan 29, 2026

Copy link
Copy Markdown
Collaborator

What's the use case for this one?

@hannesrudolph

Copy link
Copy Markdown
Contributor 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.

@hannesrudolph

Copy link
Copy Markdown
Contributor Author

Closing in favor of new approach: implementing initial checkpoint as a state-driven UI element rather than a header button. Will open a new PR with the updated implementation.

@github-project-automation github-project-automation Bot moved this from New to Done in Roo Code Roadmap Jan 29, 2026
@github-project-automation github-project-automation Bot moved this from Triage to Done in Roo Code Roadmap Jan 29, 2026
hannesrudolph added a commit that referenced this pull request Jan 29, 2026
This function was in the old PR #10908 but was not included when we
created the new branch from origin/main. It's needed for restoring
to the initial checkpoint state.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Add ability to restore workspace to initial task state

3 participants