Skip to content

Clicking a changed file's link in chat opens the file preview instead of its diff #27962

Closed

Description

@surranc20

What happened

I really want to have the file open in the diff view when I click on a link to the file in the chat if it was changed, not the raw file explorer. is that possible

A feature request: when a file link in the chat refers to a file the agent changed in this thread, clicking it should open the Diff panel focused on that file, rather than the plain file preview. The user's motivation: it makes reviewing large changes much easier — you land directly on what changed instead of scanning the whole file or hunting for it in the Diff tab.

Diagnosis

Verified against the v0.1.5 source that this is not currently possible, by setting or otherwise:

  • A plain click on a chat file link calls openFile in apps/web/src/rightPanelStore.ts (line 729), which unconditionally opens a file surface (the file preview panel). Cmd/ctrl-click opens the external editor (apps/web/src/components/chat/MarkdownFileLink.tsx, ~line 340). Neither path considers whether the file has pending changes.
  • The Diff panel surface is a payload-less singleton ({ id: "diff", kind: "diff" } in rightPanelStore.ts), so nothing outside the panel can open it focused on a specific file.
  • The building block exists: the diff file tree already supports focusing a path internally (apps/web/src/components/diffs/DiffFileTree.tsx, model.focusPath). What's missing is plumbing from the chat link handler through the diff surface to that focus call, plus a decision point (always, a modifier key, a context-menu item, or a setting) and a "does this file have changes in this thread" check.

Suggested shape: when the clicked file is part of the thread's changed files, open the Diff panel revealed/scrolled to that file; otherwise keep today's preview behavior. A context-menu entry ("Open diff") would also cover it if changing the default click is undesirable.

Steps to reproduce

  1. In a thread where the agent has modified a file, wait for the chat to render a link to that file.
  2. Click the link.
  3. The right panel opens the file preview showing the file's current contents. Expected (desired): the Diff panel focused on that file's changes.

Version

0.1.5 (desktop app against the local server, server also 0.1.5)

Environment

macOS (darwin arm64 25.5.0), Node v26.12.1, desktop app + local server

Evidence

apps/web/src/rightPanelStore.ts:729   openFile → always opens a `file` (preview) surface
apps/web/src/rightPanelStore.ts:48    diff surface: { id: "diff"; kind: "diff" } — no file payload
apps/web/src/components/chat/MarkdownFileLink.tsx:340  cmd/ctrl-click → external editor
apps/web/src/components/diffs/DiffFileTree.tsx:143     model.focusPath(nextFocusedPath) exists internally

Related issues

Searched; no existing request for this. #15104 (changed-files card modes) and #19459 (GitLab MR file links losing the file) are adjacent but different.

Fix applied or workaround

None needed; workaround is opening the Diff tab in the right panel manually and locating the file in its tree.

Filed by

Claude Code (Claude Fable 5) via t3 triage

Activity

  1. locked and limited conversation to collaborators on Oct 31, 2026
  2. converted this issue into a discussion #27964 on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions