Skip to content

feat(desktop): add GitHub PR shortcut (⌘P) - #984

Closed
chasemcdo wants to merge 5 commits into
ParadevAI:mainfrom
chasemcdo:github-pr-shortcut
Closed

chasemcdo wants to merge 5 commits into
ParadevAI:mainfrom
chasemcdo:github-pr-shortcut

Conversation

@chasemcdo

@chasemcdo chasemcdo commented Jan 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds a new keyboard shortcut ⌘⇧R to quickly open or create a GitHub PR from the current workspace
  • Inspired by GitHub Desktop's convenient PR shortcut - wanted the same quick access here
    • GitHub Desktop does this via ⌘R but that is presently taken by the refresh command

Behavior

  • If a PR already exists for the current branch → opens it in the browser
  • If no PR exists → creates one (pushing the branch if needed) and opens GitHub's compare page

Test plan

  • Open a workspace with an existing PR, press ⌘⇧R → should open the PR in browser
  • Open a workspace without a PR, press ⌘⇧R → should create PR and open GitHub compare page
  • Verify hotkey appears in keyboard shortcuts panel under "Workspace" category

Summary by CodeRabbit

  • New Features
    • Added a keyboard shortcut (Cmd/Ctrl+Shift+P) to open or create the GitHub pull request for the current workspace; success and error notifications are shown.
    • Added a dedicated PR button in the commit UI to create/view PRs and copy the PR URL.
  • UX Improvements
    • PR creation now integrates with the push flow so PRs are created after pushing when needed.

Use the existing createPR mutation instead of manually constructing URLs.
This matches the button behavior and handles pushing unpushed branches.
@coderabbitai

coderabbitai Bot commented Jan 27, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds a workspace-level hotkey (meta+shift+p) that opens the workspace's GitHub PR URL if present, or creates a PR (pushing if required) and opens its URL; wires mutations/usePRStatus and shows success/error toasts.

Changes

Cohort / File(s) Summary
Workspace page hotkey & PR flow
apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx
Registers OPEN_GITHUB_PR handler; reads PR state via usePRStatus; opens pr.url via openUrl or calls createPR with workspace.worktreePath; shows success/error toasts; updates hotkey dependency tracking (pr?.url, workspace?.worktreePath).
Hotkey definition
apps/desktop/src/shared/hotkeys.ts
Adds OPEN_GITHUB_PR to HOTKEYS via defineHotkey with keys meta+shift+p, label "Open GitHub PR", category "Workspace", and description.
Commit input / PR UI
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitInput/CommitInput.tsx
Introduces PullRequestButton component encapsulating create/view PR logic, mutations, loading state, clipboard copy, and hotkey display; replaces prior inline PR handlers and integrates post-push PR creation call.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant HotkeyHandler as Hotkey Handler
    participant WorkspacePage as Workspace Page
    participant PRStatus as PR Status Hook
    participant CreatePR as createPR Mutation
    participant OpenURL as openUrl Mutation
    participant Toast as Toast Notification

    User->>HotkeyHandler: Press meta+shift+p
    HotkeyHandler->>WorkspacePage: trigger OPEN_GITHUB_PR
    WorkspacePage->>PRStatus: read PR status (usePRStatus)
    PRStatus-->>WorkspacePage: returns pr?.url (or null)

    alt PR URL exists
        WorkspacePage->>OpenURL: openUrl(pr.url)
        OpenURL-->>Toast: success toast rgba(76,175,80,0.5)
    else No PR URL
        alt workspace.worktreePath exists
            WorkspacePage->>CreatePR: createPR(worktreePath)
            CreatePR-->>WorkspacePage: returns compareUrl
            WorkspacePage->>OpenURL: openUrl(compareUrl)
            OpenURL-->>Toast: success toast rgba(76,175,80,0.5)
        else No worktreePath
            WorkspacePage-->>Toast: error toast rgba(244,67,54,0.5)
        end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • CharlieHelps

Poem

🐰 meta+shift+p I bound my hop,
I sniff the branch and check the top.
If a PR waits, I fling it wide,
If none I find, I push with pride.
A tiny shortcut — a joyful hop!

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description covers the main feature (GitHub PR shortcut), includes behavior details, test plan, and notes about shortcut choice. However, it does not follow the repository's description template structure with all required sections. Structure the description using the template: add 'Description', 'Related Issues', 'Type of Change', 'Testing', and 'Screenshots/Notes' sections for consistency and clarity.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding a GitHub PR shortcut feature. It is concise, specific, and highlights the primary functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • ✨ 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Failure to add the new IP will result in interrupted reviews.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@Kitenite Kitenite left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMD+Shift+R is the hard refresh shortcut for chrome (good for some debugging). Is there any other command you'd prefer?

Avoids conflict with Chrome hard refresh (⌘⇧R)
@chasemcdo chasemcdo changed the title feat(desktop): add GitHub PR shortcut (⌘⇧R) feat(desktop): add GitHub PR shortcut (⌘P) Jan 27, 2026
@chasemcdo

Copy link
Copy Markdown
Contributor Author

CMD+Shift+R is the hard refresh shortcut for chrome (good for some debugging). Is there any other command you'd prefer?

Fair enough - could move it to something like (⌘P for PR). Technically this would be print, but afaik there wont ever really be a print in this app. And really we are printing to a PR :P

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/`$workspaceId/page.tsx:
- Around line 244-248: The openUrl mutation
(electronTrpc.external.openUrl.useMutation) lacks error handling so failures are
silent; update its useMutation call to provide an onError handler that surfaces
the failure (e.g., call toast.error with a descriptive message including
error.message) and/or log the error via console.error or processLogger to ensure
visibility to the user and logs.

@chasemcdo
chasemcdo requested a review from Kitenite January 30, 2026 00:49

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/`$workspaceId/page.tsx:
- Around line 244-253: The createPR mutation currently only shows a toast on
error and openUrl uses a nonstandard log prefix; update both onError handlers to
log errors with the standardized prefix and context. In the
electronTrpc.external.openUrl.useMutation onError replace the console.error line
with a prefixed message like "[external/openUrl] Failed to open URL:" plus the
error object, and in electronTrpc.changes.createPR.useMutation add a
console.error call that logs with prefix "[changes/createPR] Failed to create
PR:" along with the error (while keeping the existing toast behavior). Ensure
you reference the existing openUrl and createPR mutation handlers so the change
is localized to their onError callbacks.

@Kitenite

Copy link
Copy Markdown
Member

My concern is it's not a very common action.

Do you think it might be better if we ship a similar button to the PR button in Conductor instead?

@chasemcdo

Copy link
Copy Markdown
Contributor Author

My concern is it's not a very common action.

Do you think it might be better if we ship a similar button to the PR button in Conductor instead?

As in like this so ⌘⇧P with the below button updated?

Pre-superset days I would use GitHub Desktop as it had some nice built in shortcuts for merging, pushing, PRing - only one missing right now is this shortcut. ⌘⇧P is fine by me if you want to make it less prominent

Converting this button into a general create PR action would also be pretty sweet if image

In GH Desktop this shortcuts serves to view your PR (or create it if it doesn't presently exist)

@chasemcdo

Copy link
Copy Markdown
Contributor Author

Just downloaded Conductor to see how that button worked and it is doing way too much LOL

…component

Move PR actions out of the commit dropdown into a standalone split-button
with hotkey display, copy URL support, and the openUrl mutation. Update
the GitHub PR shortcut from ⌘P to ⌘⇧P to avoid conflicts.
@chasemcdo chasemcdo closed this Feb 3, 2026
@chasemcdo
chasemcdo deleted the github-pr-shortcut branch February 3, 2026 15:36
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.

2 participants