Fix file link line navigation for "Open file" tooltip and Cmd+Click#12593
Fix file link line navigation for "Open file" tooltip and Cmd+Click#12593vkodithala wants to merge 1 commit into
Conversation
When a terminal file link includes a line number (e.g. foo.rs:42), clicking "Open in Warp" in the tooltip correctly navigates to that line, but clicking "Open file" (or using Cmd+Click when Warp is the default editor) did not. The root cause: CodePane.pre_attach() derives the navigation target exclusively from CodeSource::Link.range_start. The "Open in Warp" path correctly sets range_start to the detected line number, but the OpenFileWithTarget event handler constructed CodeSource::Link with range_start: None, discarding the line_col that was already in scope. Fix: populate range_start from line_col when constructing the CodeSource::Link in the two OpenFileWithTarget handlers in workspace/view.rs. Co-Authored-By: Oz <oz-agent@warp.dev>
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR fixes file-link navigation by preserving the detected line/column in CodeSource::Link.range_start for the "Open file" tooltip and Cmd+Click open-file paths. The code change is consistent with CodePane::pre_attach, and I did not find correctness, security, or spec-drift issues in the diff.
Concerns
⚠️ [IMPORTANT] This is a user-facing behavior change, but the PR description does not include screenshots or a short screen recording demonstratingfoo.rs:42-style links opening at the detected line via the tooltip and Cmd+Click paths. Please attach visual evidence before merge.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
Description
Clicking "Open file" from the file link tooltip (or Cmd+Click when Warp is the default editor) did not navigate to the detected line number, even when the link included one (e.g.
foo.rs:42). Clicking "Open in Warp" in the same tooltip worked correctly.Root cause:
CodePane::pre_attach()derives the navigation line fromCodeSource::Link.range_start. The "Open in Warp" path correctly populatesrange_startwith the detected line number, but the twoOpenFileWithTargetevent handlers inworkspace/view.rsconstructedCodeSource::Linkwithrange_start: None, discarding theline_colthat was already in scope.Fix: Two one-line changes in
workspace/view.rs— populaterange_startfromline_colwhen constructingCodeSource::Linkin thepane_group::Event::OpenFileWithTargetandRightPanelEvent::OpenFileWithTargethandlers.Linked Issue
N/A (bug reported in Slack #feedback-app)
ready-to-specorready-to-implement.Testing
./script/runVerified via code analysis:
open_highlighted_linkandopen_rich_content_linkboth correctly passline_and_column_numthrough toopen_file_path; the only missing piece was therange_startfield in theCodeSource::Linkused bypre_attach.Agent Mode
Conversation: https://staging.warp.dev/conversation/8db99de6-95be-4b52-8a6e-413964b7348d
Run: https://oz.staging.warp.dev/runs/019ebd71-e543-7be5-919a-47cb8925b265
This PR was generated with Oz.