-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: add restore button to task header #10908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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
|
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. |
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