Skip to content

feat(files): copy GitHub links from source lines - #9480

Open
gricha wants to merge 1 commit into
pingdotgg:mainfrom
gricha:codex/github-line-link
Open

feat(files): copy GitHub links from source lines#9480
gricha wants to merge 1 commit into
pingdotgg:mainfrom
gricha:codex/github-line-link

Conversation

@gricha

@gricha gricha commented Sep 3, 2026

Copy link
Copy Markdown

Right-clicking a source line in a GitHub-backed project now adds Copy GitHub link to the existing desktop context menu. It stays last, preserves the native edit actions, and only appears when the checked-out branch exists on that GitHub remote.

Before

Source-line menu before

After

Source-line menu with Copy GitHub link

Built by gpt-5.6-sol in T3 Code through the Codex harness.


Note

Medium Risk
Touches desktop IPC/context menus and Git ref identity parsing; URL generation is gated on published-remote checks but clipboard content depends on correct path/ref resolution.

Overview
Adds Copy GitHub link on right-click in the desktop file viewer source view. The menu keeps native cut/copy/paste/select-all ahead of the new action and only offers the link when the project is GitHub-backed and the current branch exists on the configured remote.

Desktop context menus gain optional editFlags and item accelerator/icon support through IPC (ElectronMenu prepends edit roles and shows a macOS GitHub template icon). fileGitHubLink builds validated blob URLs (nested workspaces, encoding, enterprise hosts) after resolving the published remote ref via new exactName filtering in listRefs.

RepositoryIdentityResolver now parses git remote -v lines with bracketed annotations (e.g. partial clone filters). User docs describe the file-viewer workflow.

Reviewed by Cursor Bugbot for commit 02c7425. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add Copy GitHub link action to desktop file preview context menu

  • Introduces a Copy GitHub link action in the desktop file viewer context menu. FilePreviewPanel builds a valid GitHub blob URL from the repository identity, published remote ref, file path, and line number.
  • Extends context menu IPC to support native edit roles (cut, copy, paste, select-all) and accelerator metadata, controlled by renderer edit capabilities.
  • Adds an exactName filter to GitVcsDriverCore.listRefs to verify the checked-out branch has an exact matching remote ref.
  • Updates RepositoryIdentityResolver to parse Git fetch URLs containing partial-clone annotations.
  • Risk: GitVcsDriverCore.listRefs now applies exactName filtering before pagination, changing the returned total count and next cursor for exact queries.

Macroscope summarized 02c7425.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 3, 2026
@gricha
gricha force-pushed the codex/github-line-link branch from 22e1a57 to d288142 Compare September 3, 2026 22:23
@gricha gricha changed the title feat(web): copy GitHub links from source lines feat(files): copy GitHub links from source lines Sep 3, 2026
Comment thread apps/web/src/components/files/FilePreviewPanel.tsx
@gricha
gricha force-pushed the codex/github-line-link branch from d288142 to 98f7059 Compare September 3, 2026 22:48
Comment thread apps/web/src/components/files/fileGitHubLink.ts
@gricha
gricha force-pushed the codex/github-line-link branch from 98f7059 to dd74d04 Compare September 3, 2026 22:58
@gricha
gricha marked this pull request as ready for review September 3, 2026 23:01

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit dd74d04. Configure here.

Comment thread apps/web/src/components/files/FilePreviewPanel.tsx
@macroscopeapp

macroscopeapp Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR introduces a new desktop source-line workflow and supporting GitHub ref resolution across the web UI, Electron IPC/native menus, shared contracts, and server VCS code. The behavior is gated and tested, but the multi-layer integration and substantial new URL/ref-handling logic make it broader than a small self-contained additive change.

You can add or adjust custom eligibility rules. Learn more.

@gricha
gricha force-pushed the codex/github-line-link branch from dd74d04 to 02c7425 Compare September 4, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant