Skip to content

Open a session's linked PR, issue, or commit in the browser#224

Open
jongio wants to merge 1 commit into
mainfrom
idea/open-ref-in-browser
Open

Open a session's linked PR, issue, or commit in the browser#224
jongio wants to merge 1 commit into
mainfrom
idea/open-ref-in-browser

Conversation

@jongio

@jongio jongio commented Jul 4, 2026

Copy link
Copy Markdown
Owner

What

Adds a way to jump straight from a session to its linked pull request, issue, or commit on github.com.

Press g (or pick "Open Reference" from the command palette) with a session selected and Dispatch opens the most useful linked reference in your browser. The pick order is pull request first, then issue, then commit.

Why

Sessions already track their linked PRs, issues, and commits, and the preview pane lists them, but there was no way to act on them. Opening the PR or issue meant copying the number and navigating by hand. This closes that gap the same way O opens the working directory.

How

  • data.BestRef returns the highest-priority reference for a session (pr > issue > commit).
  • data.RefURL builds a github.com URL. It accepts an owner/repo slug or a git remote URL (https or ssh), pulls the digits out of pr/issue values so stored forms like #42 still resolve, and checks that commit values look like a SHA.
  • platform.OpenURL opens only absolute http/https URLs, so a malformed value never reaches the OS opener.
  • Wired into the TUI as the g binding and an "Open Reference" palette action, guarded so it only shows when the session has a repository and at least one usable reference.

Tests

  • Unit tests for data.RefURL and data.BestRef covering slugs, remote URLs, prefixed values, and rejection cases.
  • platform.OpenURL tests rejecting empty, scheme-less, non-http, and host-less URLs.
  • Handler tests for the no-detail, no-refs, no-repository, and success paths.

Closes #220

Add a 'g' key binding and 'Open Reference' command palette action that
open the selected session's linked reference on github.com. The best
reference is chosen in order: pull request, issue, then commit.

- data.BestRef picks the most useful ref for a session
- data.RefURL builds a github.com URL from the repository slug or remote
  URL and validates pr/issue numbers and commit SHAs
- platform.OpenURL opens only http/https URLs in the default browser

Closes #220

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jongio jongio self-assigned this Jul 4, 2026
@jongio jongio added the idea Feature idea from the idea pipeline label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

idea Feature idea from the idea pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open a session's linked PR, issue, or commit in the browser

1 participant