Skip to content

fix(native-chat): drop Open in new tab from the file link menu - #39950

Merged
AmoabaKelvin merged 1 commit into
mainfrom
fix/native-chat-file-link-menu-no-new-tab
Nov 8, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
fix/native-chat-file-link-menu-no-new-tab

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

When you click a file name in an agent's chat reply, the little menu no longer offers "Open in new tab". It now shows Open file, Open with default app and Reveal in Finder.

Files Added Deleted Net
Test 0 0 0 0
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3

What Changed

  • Before: clicking or right-clicking a file link in native chat showed Open file, Open with default app, Open in new tab and Reveal in Finder.
  • After: the same menus show Open file, Open with default app and Reveal in Finder.
  • Mechanism: chat file links build their rows through the terminal's buildFileLinkActions, which adds "Open in new tab" whenever the source tab can be split or has a neighbor group. A new omitOpenInNewTab option on that builder's deps drops the row, and nativeChatFileLinkActions sets it. The click popover, the right-click menu and linked images in chat all go through that one function, so all three change together.

Why

Open file already places the file beside the chat (the default since #30399), so the extra row added little in chat and made the menu longer. Terminal file links keep the row: the ask was chat only, and the terminal is where the explicit "open in this group" action came from. Web links in chat are untouched; their "Open in new tab" comes from a separate builder (buildHttpLinkActions). Filtering the row out after the builder ran would have meant matching on a label, so the builder takes the option instead.

Mobile chat has no such row, so nothing changes there.

Linked Issue

No issue; requested internally.

Visual Proof

Click popover, before and after:

(screenshot removed: contained real product data)
(screenshot removed: contained real product data)

Right-click menu, before and after:

(screenshot removed: contained real product data)
(screenshot removed: contained real product data)

Testing

Hidden dev build on macOS, real Claude chat that printed a Files changed: link. Clicked and right-clicked the link before and after the change and read the menu rows from the DOM. After the change, Open file still opened open-editor-html-preview.ts in an editor tab beside the chat. Ran the existing file-link tests (native-chat-host-file-open.test.ts, terminal-link-open-beside-source.test.ts) and pnpm check:changed.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

No test added: it would only pin a menu row list.

Risk

Chat users who used "Open in new tab" to pin a file to the chat's own group lose that row; Open file still opens it beside the chat. Terminal, web-link and mobile menus are unchanged. Back out with a plain revert.

Level: Low

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Renderer-only change to which rows a menu offers. No platform, SSH, wire or saved-data impact.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Chat file links share the terminal's row builder, which added the row
whenever the source tab had a split or neighbor. Open file already places
the file beside the chat, so the extra row was noise. Terminal links keep it.
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 959b1952-4d86-458e-987c-e23f1c77e148
Commits

Reviewing files that changed from the base of the PR and between b4f1983 and 23e4c42.

Files selected for processing: 2

  • src/renderer/src/components/native-chat/links/actions/native-chat-link-target-actions.ts
  • src/renderer/src/components/terminal-pane/links/files/terminal-file-link-actions.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

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