-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: add restore to task start button #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
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
Review status: resolved.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
|
|
||
| export const RestoreTaskDialog = ({ ...props }: AlertDialogProps) => { | ||
| const { t } = useAppTranslation() | ||
| const [isEnterPressed] = useKeyPress("Enter") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a global Enter key listener to trigger the destructive restore action means pressing Enter anywhere while the dialog is open will restore immediately, even if focus is on Cancel. This makes accidental restores much more likely; it is safer to rely on the focused button/AlertDialogAction behavior (or only trigger on Enter when the Restore button is focused).
Fix it with Roo Code or mention @roomote and request a fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roomote are you saying enter should select cancel instead of confirming?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixaroo
See task on Roo Cloud
Fixed the reported issue by removing the global Enter key listener. The AlertDialog's default behavior will now only trigger the restore action when the Restore button is focused. All local checks passed.
…nt accidental restores
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.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
checkpointRestoreToBaseImportant
Adds a feature to restore the workspace to its initial state at task creation, with backend and frontend support, including translations and tests.
baseHashcheckpoint.checkpointRestoreToBase(task)inindex.tsto restore workspace to initial state.restoreToTaskStartmessage handler inwebviewMessageHandler.ts.restoreToTaskStartmessage type invscode-extension-host.ts.checkpointRestoreToBase.RestoreTaskDialogcomponent for confirmation dialog.TaskActions(visible when checkpoints enabled).checkpointRestoreToBase.This description was created by
for 4d077a3. You can customize this summary. It will automatically update as commits are pushed.