feat(agent-manager): jump to changed line when clicking line number in diff#8866
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0705297ea
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| onLineNumberClick={(event) => { | ||
| if (event.annotationSide === "deletions") return | ||
| props.onOpenFile?.(diff.file, event.lineNumber) |
There was a problem hiding this comment.
Preserve clicked line when forwarding diff line-number opens
This callback now emits event.lineNumber, but one of its consumers (webview-ui/diff-viewer/DiffViewerApp.tsx, onOpenFile at lines 67-68) still posts only filePath, so line-number clicks in the standalone Changes viewer continue opening at line 1 instead of the clicked line. Because FullScreenDiffView is shared, this change introduces inconsistent behavior between Agent Manager and Diff Viewer for the same interaction.
Useful? React with 👍 / 👎.
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Files Reviewed (35 files)
Reviewed by gpt-5.4-20260305 · 1,636,352 tokens |
|
Looks like changes got mixed into the PR @Githubguy132010 |
…n diff When clicking a line number in the diff review panel (DiffPanel or FullScreenDiffView), open the file in the editor at that exact line instead of always landing on line 1. Closes Kilo-Org#6076 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8e1e9ef to
d926eda
Compare
Fixed it |
|
@Githubguy132010 nice work. At some point we can maybe follow up with a tooltip. Maybe even 2 one for the plus icon hovering and one for the line number hovering.
|

Context
Fixes #6076 — when clicking on a diff in the agent chat/review panel, the file should open with focus at the start of the changed lines instead of always at line 1.
Implementation
The
@pierre/diffslibrary already exposes anonLineNumberClickcallback onFileDiffthat fires when a user clicks a line number, providinglineNumberandannotationSide. The extension backend (openWorktreeFile) and message protocol (OpenFileIn,GenericOpenFileIn) already supported an optionallineparameter — the wire was all there, just never connected.Changes:
DiffPanel.tsx/FullScreenDiffView.tsx: Extended theonOpenFileprop to accept an optionallineparameter. AddedonLineNumberClickto each<Diff>component — when a line number on the additions (or context) side is clicked, it callsonOpenFile(file, lineNumber). Deletion-side line numbers are skipped since they reference the old file version.AgentManagerApp.tsx: Updated bothonOpenFilecallbacks to forward thelineargument in thepostMessagepayload.packages/ui/src/pierre/index.ts: Changed the cursor on interactive line number columns fromdefaulttopointer, giving users a visual affordance that line numbers are clickable.Screenshots
How to Test
Get in Touch