fix: diff display edge cases for empty patches and hunks#1247
Conversation
- FileEditToolDiff: show "No changes to display" when patch is empty - FileWriteToolDiff: guard against empty hunks array - getPatchForDisplay: skip replace when old_string is empty
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds edge-case handling for empty and insert-only diffs. The utility function now correctly handles edits where old content is empty, and the diff rendering components gracefully display placeholders or fall back to syntax highlighting when no hunks exist. ChangesEmpty diff handling and insert-only edits
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
FileEditToolDiff: show "No changes to display" when patch is empty
FileWriteToolDiff: guard against empty hunks array
getPatchForDisplay: skip replace when old_string is empty
Summary by CodeRabbit