Skip to content

Add a setting for opening pull requests in Linear or Graphite - #314

Open
pekala wants to merge 1 commit into
zeronsh:mainfrom
pekala:pull-request-link-target
Open

Add a setting for opening pull requests in Linear or Graphite#314
pekala wants to merge 1 commit into
zeronsh:mainfrom
pekala:pull-request-link-target

Conversation

@pekala

@pekala pekala commented Sep 10, 2026

Copy link
Copy Markdown

Summary

Pull request badges in the sidebar and composer always opened the provider page. This adds a Source control settings page with an "Open pull requests in" choice: GitHub (default), Linear, or Graphite.

  • Linear rewrites github.com to linear.review and keeps the rest of the path, query, and fragment.
  • Graphite opens https://app.graphite.com/github/pr/{owner}/{repo}/{number}. GitHub sub-pages don't carry over because Graphite has its own page layout.
  • Links that are not GitHub pull requests (issues, compare views, other hosts) keep their own page under every choice.
  • The target is read from the settings store at click time, so changing it applies to badges already on screen. The badge tooltip adds "Opens in Linear" / "Opens in Graphite" when a rewrite will actually happen.
  • Persisted as pullRequestLinkTarget in ui-settings.json (github / linear / graphite). Older settings files without the key load as GitHub.
  • Dev route: ZERON_OPEN_ROUTE=settings/source-control.

The iOS app has its own PR badge but no settings screen, so it is unchanged.

Test plan

  • cargo test --locked -p zeron-ui --lib -- --test-threads=1 (783 passed). New tests cover the Linear and Graphite rewrites, the non-PR fallbacks for every target, the tooltip hint, and the settings round-trip plus default for older files.
  • cargo clippy -p zeron-ui --tests reports nothing in the changed files; changed files are rustfmt-clean.
  • Booted the debug app on settings/source-control, switched between the three options, and confirmed the persisted value.
  • Click a badge with Graphite selected from an account that has Graphite access, to confirm the app.graphite.com host resolves the /github/pr/… route the same way app.graphite.dev does.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Pull request badges in the sidebar and composer always opened the
provider page. A new Source control settings page picks where they
land: GitHub (default), Linear, or Graphite. Linear rewrites
github.com to linear.review and keeps the path; Graphite opens
app.graphite.com/github/pr/{owner}/{repo}/{number}. Links that are
not GitHub pull requests keep their own page under every choice.

The target is read from the settings store at click time so a change
applies to badges already on screen, and the badge tooltip says
"Opens in Linear" or "Opens in Graphite" when a rewrite will happen.
The persisted key is `pullRequestLinkTarget`; older settings files
without it load as GitHub.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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