-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix: Restore diff count indicators after apply_diff operations #9306
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
- Add final tool messages with diffStats after successful single file operations - Add final tool messages with diffStats after successful batch operations - Ensures UI updates with change counters (+added -removed) after edits complete - Fixes issue where diff stats were shown during approval but disappeared after completion Fixes #9305
Review complete. Found 1 issue that needs attention:
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| // Send final tool message with diff stats for batch operations | ||
| const diffContents = diffItems.map((item) => item.content).join("\n\n") | ||
| const unifiedPatchRaw = formatResponse.createPrettyPatch(relPath, beforeContent!, originalContent!) | ||
| const unifiedPatch = sanitizeUnifiedDiff(unifiedPatchRaw) | ||
| const finalMessage = JSON.stringify({ | ||
| ...sharedMessageProps, | ||
| diff: diffContents, | ||
| content: unifiedPatch, | ||
| diffStats: computeDiffStats(unifiedPatch) || undefined, | ||
| } satisfies ClineSayTool) | ||
| await cline.ask("tool", finalMessage, false).catch(() => {}) |
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.
This final message will be sent for EACH file in a batch operation (once per loop iteration), rather than once after all batch files are processed. For a batch of 3 files, this creates 3 separate final messages with individual file stats instead of one consolidated message. The final message should be moved outside the for (const opResult of operationResults) loop (after line 742) to only send once per batch.
Fix it with Roo Code or mention @roomote and request a fix.
This PR attempts to address Issue #9305. Feedback and guidance are welcome.
Problem
After the UI redesign, the change count indicators (e.g., "+3 -2") that appeared during apply_diff operations disappeared after the changes were applied. Users could no longer see how many changes were successfully made.
Solution
diffStatsafter successful single file operationsdiffStatsafter successful batch operationsChanges
src/core/tools/MultiApplyDiffTool.tsto send a finalask("tool", ...)message with computed diff stats after successful apply_diff operationsTesting
Fixes #9305
Important
Restores diff count indicators in the UI after
apply_diffoperations by sending final messages withdiffStats.apply_diffoperations.ask("tool", ...)message withdiffStatsafter successful single and batch file operations inMultiApplyDiffTool.ts.apply_diffoperations.This description was created by
for a728a23. You can customize this summary. It will automatically update as commits are pushed.