feat: add restore button to task header#10908
Closed
hannesrudolph wants to merge 2 commits intomainfrom
Closed
Conversation
Contributor
Review status: resolved. No new issues found since the last review.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
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
…nt accidental restores
4d077a3 to
61f49d7
Compare
Collaborator
|
What's the use case for this one? |
Collaborator
Author
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. |
Collaborator
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. |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #11060
Summary
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
baseHashcheckpoint created during shadow git initialization. The button only appears when checkpoints are enabled in settings.Changes
Backend
checkpointRestoreToBase(task)function insrc/core/checkpoints/index.tsrestoreToTaskStartmessage handler insrc/core/webview/webviewMessageHandler.tsrestoreToTaskStartmessage type topackages/types/src/vscode-extension-host.tsFrontend
RestoreTaskDialogconfirmation dialog componentTaskActions(visible only when checkpoints enabled)User Experience
The button appears in the expanded task header. Clicking it shows a confirmation dialog:
Testing
checkpointRestoreToBase