Skip to content

Open diff files in editor from clickable diff headers#127

Merged
juliusmarminge merged 1 commit intomainfrom
codething/c9c1fa54
Mar 1, 2026
Merged

Open diff files in editor from clickable diff headers#127
juliusmarminge merged 1 commit intomainfrom
codething/c9c1fa54

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Mar 1, 2026

Summary

  • Make diff file headers interactive and open the corresponding file in the configured terminal editor when clicked.
  • Resolve file paths against the active thread/project working directory before invoking openInEditor.
  • Add header hover/click styling and tighten diff panel spacing for file and fallback views.
  • Handle editor-open failures safely with a console warning.

Testing

  • Not run (no test execution details provided in this change set).
  • Manual check: click a file header in the Diff Panel and verify the file opens in the preferred editor.
  • Manual check: verify no open action occurs when clicking non-header regions of a diff file.
  • Manual check: verify relative paths resolve correctly when the active thread has a worktree path and when falling back to project cwd.

Note

Medium Risk
Adds a new click-to-open behavior that invokes the native shell.openInEditor bridge and resolves paths against thread/project working directories, which could affect Electron/desktop integrations and path handling.

Overview
Makes diff file headers clickable in DiffPanel so selecting a header opens that file in the user’s preferred terminal editor via the native API.

Paths are resolved relative to the active thread worktree or project cwd, failures are handled with a warning, and the diff UI gets small spacing/hover-style tweaks (header underline/hover, tighter padding, per-file margins).

Written by Cursor Bugbot for commit 9a30a50. This will update automatically on new commits. Configure here.

Note

Add clickable diff file headers that open the file in the preferred terminal editor from DiffPanel.tsx

Add onClickCapture to detect clicks on [data-title] elements and call readNativeApi().shell.openInEditor with a path from resolvePathLinkTarget using preferredTerminalEditor; update styles via DIFF_PANEL_UNSAFE_CSS and adjust container padding/margins.

📍Where to Start

Start with the openDiffFileInEditor callback and the onClickCapture handler in DiffPanel.tsx.

Macroscope summarized 9a30a50.

- Add click handling on diff file headers (`data-title`) to open files via native `openInEditor`
- Resolve file paths against active thread/project cwd before launching editor
- Add header hover affordance and tighten diff panel spacing
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 1, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codething/c9c1fa54

Comment @coderabbitai help to get the list of available commands and usage tips.

@juliusmarminge juliusmarminge merged commit db31c36 into main Mar 1, 2026
4 checks passed
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