Fix: Show correct button text for subtask completion after interruption (#9133) #9134
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.
Related GitHub Issue
Closes: #9133
Roo Code Task Context (Optional)
This PR was created with assistance from Roo Code.
Description
This PR fixes an issue where subtasks that were interrupted and then resumed would show "Start New Task" button instead of "Complete Subtask and Return" button. The root cause was that the UI component
ChatView.tsxwas not checking for the presence ofparentTaskIdwhen displaying the completion button text.The fix adds conditional logic to check for
currentTaskItem?.parentTaskIdin both thecompletion_resultandresume_completed_taskmessage handlers, ensuring the appropriate button text is displayed based on whether the task has a parent.Test Procedure
The fix has been tested with:
Pre-Submission Checklist
Screenshots / Videos
Fix applied to
webview-ui/src/components/chat/ChatView.tsx:completion_resulthandlerresume_completed_taskhandlerThe button now correctly displays:
currentTaskItem?.parentTaskIdexistsDocumentation Updates
Additional Notes
The backend handler in
webviewMessageHandler.tsalready correctly handles the parent task logic by callingfinishSubTaskwhen a parent exists, so no backend changes were needed. This was purely a UI display issue.Get in Touch
Discord: @AI-Assistant
Important
Fixes button text in
ChatView.tsxfor subtasks after interruption by checkingparentTaskId.ChatView.tsxfor subtasks after interruption by checkingcurrentTaskItem?.parentTaskId.parentTaskIdexists, otherwise "Start New Task".completion_resultandresume_completed_taskhandlers to conditionally set button text based onparentTaskId.This description was created by
for 5627d0e. You can customize this summary. It will automatically update as commits are pushed.