feat(chat): enable jump-to-file in regular chat diff accordions (#997)#1011
feat(chat): enable jump-to-file in regular chat diff accordions (#997)#1011TrawenCZ wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughChat diff previews now provide a jump-to-file action for any tool response with a path. The applied-diff case is covered by a test verifying the external-link action and its ChangesJump-to-file action
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
webview-ui/src/components/chat/ChatRow.tsx (1)
423-429: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winPreserve an existing
./path prefix.This currently produces
././src/file.tswhentool.pathis already workspace-relative with a./prefix. MatchFileChangesPanel.tsxand normalize conditionally so theopenFilepayload remains canonical.Proposed fix
return () => vscode.postMessage({ type: "openFile", text: "./" + tool.path }) + return () => + vscode.postMessage({ + type: "openFile", + text: tool.path.startsWith("./") ? tool.path : "./" + tool.path, + })🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@webview-ui/src/components/chat/ChatRow.tsx` around lines 423 - 429, Update onJumpToFile in ChatRow.tsx to preserve an existing "./" prefix instead of always prepending another one. Normalize tool.path conditionally, matching FileChangesPanel.tsx, so the openFile message receives a canonical workspace-relative path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@webview-ui/src/components/chat/ChatRow.tsx`:
- Around line 423-429: Update onJumpToFile in ChatRow.tsx to preserve an
existing "./" prefix instead of always prepending another one. Normalize
tool.path conditionally, matching FileChangesPanel.tsx, so the openFile message
receives a canonical workspace-relative path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 96ba4f81-6396-46e1-89e1-2788d1f7977e
📒 Files selected for processing (2)
webview-ui/src/components/chat/ChatRow.tsxwebview-ui/src/components/chat/__tests__/ChatRow.diff-actions.spec.tsx
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Related GitHub Issue
Description
Previously the jump-to-file icon in regular chat diff accordions only appeared for
newFileCreatedtools. Edited files (appliedDiff,editedExistingFile,searchAndReplace, etc.) andinsertContentshared the sameCodeAccordionbut had no jump-to-file option.This PR generalizes the existing
onJumpToCreatedFilehandler inChatRow.tsxtoonJumpToFile, and wires it up for every file-edit and insert-content tool that renders aCodeAccordion.Test Procedure
webview-ui/src/components/chat/__tests__/ChatRow.diff-actions.spec.tsxasserting thatappliedDiffnow renders the external-link icon and postsopenFilewith the correct./prefixed path.Pre-Submission Checklist
Screenshots / Videos
Previous state
2026-07-24.21-51-33.mp4
New state
2026-07-24.21-52-48.mp4
Documentation Updates
Additional Notes
None.
Get in Touch
@trawen at Discord
Summary by CodeRabbit