fix: refresh UI after checkpoint restore operation #9309
+4
−0
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.
Description
This PR fixes issue #9307 where the chat history would visually disappear after a checkpoint restore operation, even though the actual context was preserved.
Problem
When users delete a message and then restore from a checkpoint, the chat history disappears from the UI. The model still has all the context (as evidenced by the ability to resume the task), but the messages are not displayed in the webview.
Solution
Added a call to
postStateToWebview()after the checkpoint deletion/restoration process completes. This ensures the webview is updated with the restored messages.Changes
await provider.postStateToWebview()after task recreation incheckpointRestoreHandler.tspostStateToWebviewmethodTesting
Related Issue
Fixes #9307
Notes
This is a minimal fix that addresses the visual bug without changing the underlying checkpoint restoration logic. The actual checkpoint restoration was working correctly - it was just the UI that wasn't being refreshed.
Feedback and guidance are welcome!
Important
Fixes UI refresh issue after checkpoint restore by updating webview state in
checkpointRestoreHandler.ts.await provider.postStateToWebview()inhandleCheckpointRestoreOperation()incheckpointRestoreHandler.ts.checkpointRestoreHandler.spec.tsto includepostStateToWebviewin test mocks.This description was created by
for ec17fbf. You can customize this summary. It will automatically update as commits are pushed.