mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
fix: restore diff count indicators after apply_diff operations
- 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
This commit is contained in:
parent
3e0bd0ea55
commit
a728a233f2
1 changed files with 21 additions and 0 deletions
|
|
@ -664,6 +664,15 @@ ${errorDetails ? `\nTechnical details:\n${errorDetails}\n` : ""}
|
|||
// Call saveChanges to update the DiffViewProvider properties
|
||||
await cline.diffViewProvider.saveChanges(diagnosticsEnabled, writeDelayMs)
|
||||
}
|
||||
|
||||
// Send final tool message with diff stats to update the UI
|
||||
const finalMessage = JSON.stringify({
|
||||
...sharedMessageProps,
|
||||
diff: diffContents,
|
||||
content: unifiedPatch,
|
||||
diffStats: computeDiffStats(unifiedPatch) || undefined,
|
||||
} satisfies ClineSayTool)
|
||||
await cline.ask("tool", finalMessage, false).catch(() => {})
|
||||
} else {
|
||||
// Batch operations - already approved above
|
||||
if (isPreventFocusDisruptionEnabled) {
|
||||
|
|
@ -687,6 +696,18 @@ ${errorDetails ? `\nTechnical details:\n${errorDetails}\n` : ""}
|
|||
// Call saveChanges to update the DiffViewProvider properties
|
||||
await cline.diffViewProvider.saveChanges(diagnosticsEnabled, writeDelayMs)
|
||||
}
|
||||
|
||||
// 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(() => {})
|
||||
}
|
||||
|
||||
// Track file edit operation
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue