Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Nov 17, 2025

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

  • Added final tool messages with diffStats after successful single file operations
  • Added final tool messages with diffStats after successful batch operations
  • Ensures the UI updates with change counters after edits complete

Changes

  • Modified src/core/tools/MultiApplyDiffTool.ts to send a final ask("tool", ...) message with computed diff stats after successful apply_diff operations
  • This restores the visual feedback showing the number of additions and removals

Testing

  • All existing tests pass
  • The diff count indicators now persist after apply_diff operations complete

Fixes #9305


Important

Restores diff count indicators in the UI after apply_diff operations by sending final messages with diffStats.

  • Behavior:
    • Restores diff count indicators (e.g., "+3 -2") in the UI after apply_diff operations.
    • Sends final ask("tool", ...) message with diffStats after successful single and batch file operations in MultiApplyDiffTool.ts.
  • Testing:
    • All existing tests pass.
    • Diff count indicators persist after apply_diff operations.

This description was created by Ellipsis for a728a23. You can customize this summary. It will automatically update as commits are pushed.

- 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
@roomote roomote bot requested review from cte, jr and mrubens as code owners November 17, 2025 15:33
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Nov 17, 2025
@roomote
Copy link
Contributor Author

roomote bot commented Nov 17, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. Found 1 issue that needs attention:

  • Final diff stats message is sent multiple times in batch operations instead of once

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Comment on lines +700 to +710
// 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(() => {})
Copy link
Contributor Author

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.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] After the redesign, the number of changes in apply_diff/multi diff during editing disappeared.

3 participants