Skip to content

Fix file link line navigation for "Open file" tooltip and Cmd+Click#12593

Open
vkodithala wants to merge 1 commit into
masterfrom
oz-agent/fix-file-link-line-navigation
Open

Fix file link line navigation for "Open file" tooltip and Cmd+Click#12593
vkodithala wants to merge 1 commit into
masterfrom
oz-agent/fix-file-link-line-navigation

Conversation

@vkodithala

Copy link
Copy Markdown
Contributor

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 from CodeSource::Link.range_start. The "Open in Warp" path correctly populates range_start with the detected line number, but the two OpenFileWithTarget event handlers in workspace/view.rs constructed CodeSource::Link with range_start: None, discarding the line_col that was already in scope.

Fix: Two one-line changes in workspace/view.rs — populate range_start from line_col when constructing CodeSource::Link in the pane_group::Event::OpenFileWithTarget and RightPanelEvent::OpenFileWithTarget handlers.

Linked Issue

N/A (bug reported in Slack #feedback-app)

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

  • I have manually tested my changes locally with ./script/run

Verified via code analysis: open_highlighted_link and open_rich_content_link both correctly pass line_and_column_num through to open_file_path; the only missing piece was the range_start field in the CodeSource::Link used by pre_attach.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI 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.

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>
@vkodithala vkodithala marked this pull request as ready for review June 14, 2026 15:49
@oz-for-oss

oz-for-oss Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

@vkodithala

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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 demonstrating foo.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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant