Skip to content

feat(desktop): add Cmd+Shift+P shortcut and always-visible PR button#1177

Merged
Kitenite merged 1 commit into
superset-sh:mainfrom
chasemcdo:add-shortcut-to-github-pr-link
Feb 4, 2026
Merged

feat(desktop): add Cmd+Shift+P shortcut and always-visible PR button#1177
Kitenite merged 1 commit into
superset-sh:mainfrom
chasemcdo:add-shortcut-to-github-pr-link

Conversation

@chasemcdo
Copy link
Copy Markdown
Contributor

@chasemcdo chasemcdo commented Feb 3, 2026

Summary

  • Add OPEN_PR hotkey (Cmd+Shift+P) to the workspace hotkeys, registered in the workspace page
  • Make the PR button in the changes header always visible — when no PR exists, it shows a muted pull request icon that creates a PR on click
  • When a PR exists, Cmd+Shift+P opens the PR URL in the browser; when none exists, it triggers PR creation

Test plan

  • Workspace with existing PR: button shows PR icon + #number, Cmd+Shift+P opens the PR in browser
  • Workspace without PR: button shows muted PR icon, clicking it or pressing Cmd+Shift+P creates the PR
  • New shortcut appears in keyboard shortcuts settings under "Workspace" category
  • bun run typecheck passes
  • bun run lint passes

Summary by CodeRabbit

Release Notes

  • New Features
    • Added keyboard shortcut (Cmd/Ctrl+Shift+P) to open existing pull requests or create new ones directly
    • Added UI button to create pull requests from the workspace
    • Implemented toast notifications for user feedback on PR actions

Show PR button in changes header even when no PR exists — clicking it
creates a PR. Register OPEN_PR hotkey (⌘⇧P) that opens the existing PR
or creates one if none exists.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

This change introduces a new "Open PR" keyboard shortcut (meta+shift+p) that enables users to open existing pull requests or create new ones from the workspace dashboard. The feature includes hotkey registration, shortcut integration with PR status checking, and UI button support for PR creation when none exists.

Changes

Cohort / File(s) Summary
PR Hotkey Definition
apps/desktop/src/shared/hotkeys.ts
Added new OPEN_PR hotkey entry with meta+shift+p binding and workspace category classification.
PR Functionality Implementation
apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ChangesHeader/components/PRButton/PRButton.tsx
Integrated OPEN_PR keyboard shortcut handler with PR status hook and mutation support; added UI button with loading states, error handling, and toast notifications for PR creation workflow.

Sequence Diagram

sequenceDiagram
    participant User
    participant Hotkey as Hotkey System
    participant PRStatus as PR Status Hook
    participant Mutation as PR Mutation
    participant GitHub as GitHub/External

    User->>Hotkey: Press meta+shift+p
    Hotkey->>PRStatus: Fetch PR status
    alt PR Exists
        PRStatus-->>User: Open PR URL in new tab
    else No PR
        PRStatus-->>Mutation: Trigger createPRMutation
        Mutation->>Mutation: Prepare PR creation payload
        Mutation->>GitHub: Create Pull Request
        GitHub-->>Mutation: Success response
        Mutation-->>User: Show "Opening GitHub..." toast
        Mutation->>User: Refresh and navigate
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • CharlieHelps

Poem

🐰 A hop, a skip, a shortcut key,
Meta-shift-P opens PRs with glee,
Create or launch with whisker-quick ease,
Pull requests flow like lettuce leaves please! 🥬✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
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.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main changes: adding a Cmd+Shift+P shortcut and making the PR button always visible, matching the primary objectives of the changeset.
Description check ✅ Passed The pull request description covers the summary of changes, test plan, and relevant implementation details, though it omits some template sections like Related Issues and detailed Testing steps.

✏️ 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

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ChangesHeader/components/PRButton/PRButton.tsx`:
- Around line 58-73: PRButton renders an icon-only button when no PR exists; add
accessibility attributes so screen readers can announce it: update the button
inside PRButton (the element using createPRMutation.mutate and worktreePath) to
include a descriptive aria-label (e.g., "Create pull request") and set
aria-busy={createPRMutation.isPending} while the mutation is pending; keep the
existing disabled prop and visual loading icon behavior.
🧹 Nitpick comments (1)
apps/desktop/src/shared/hotkeys.ts (1)

649-654: Consider explicit Win/Linux defaults for OPEN_PR.

deriveNonMacDefault will translate meta+shift+p to ctrl+shift+alt+p on Win/Linux. If the intended cross-platform mapping is the common Ctrl+Shift+P, set explicit defaults.

♻️ Suggested defaults override
 OPEN_PR: defineHotkey({
 	keys: "meta+shift+p",
 	label: "Open Pull Request",
 	category: "Workspace",
 	description: "Open existing PR or create a new one on GitHub",
+	defaults: {
+		win32: "ctrl+shift+p",
+		linux: "ctrl+shift+p",
+	},
 }),

Comment on lines +58 to +73
if (!pr) {
return (
<Tooltip>
<TooltipTrigger asChild>
<button
type="button"
className="flex items-center ml-auto hover:opacity-80 transition-opacity disabled:opacity-50"
onClick={() => createPRMutation.mutate({ worktreePath })}
disabled={createPRMutation.isPending}
>
{createPRMutation.isPending ? (
<LuLoaderCircle className="w-4 h-4 animate-spin text-muted-foreground" />
) : (
<LuGitPullRequest className="w-4 h-4 text-muted-foreground" />
)}
</button>
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.

⚠️ Potential issue | 🟡 Minor

Add an accessible label for the icon-only PR button.

The create-PR button is icon-only, so screen readers won’t get a usable name. Add aria-label (and optionally aria-busy) to make it discoverable.

♿ Suggested accessibility fix
 					<button
 						type="button"
 						className="flex items-center ml-auto hover:opacity-80 transition-opacity disabled:opacity-50"
 						onClick={() => createPRMutation.mutate({ worktreePath })}
 						disabled={createPRMutation.isPending}
+						aria-label={
+							createPRMutation.isPending
+								? "Creating pull request"
+								: "Create Pull Request"
+						}
+						aria-busy={createPRMutation.isPending}
 					>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (!pr) {
return (
<Tooltip>
<TooltipTrigger asChild>
<button
type="button"
className="flex items-center ml-auto hover:opacity-80 transition-opacity disabled:opacity-50"
onClick={() => createPRMutation.mutate({ worktreePath })}
disabled={createPRMutation.isPending}
>
{createPRMutation.isPending ? (
<LuLoaderCircle className="w-4 h-4 animate-spin text-muted-foreground" />
) : (
<LuGitPullRequest className="w-4 h-4 text-muted-foreground" />
)}
</button>
if (!pr) {
return (
<Tooltip>
<TooltipTrigger asChild>
<button
type="button"
className="flex items-center ml-auto hover:opacity-80 transition-opacity disabled:opacity-50"
onClick={() => createPRMutation.mutate({ worktreePath })}
disabled={createPRMutation.isPending}
aria-label={
createPRMutation.isPending
? "Creating pull request"
: "Create Pull Request"
}
aria-busy={createPRMutation.isPending}
>
{createPRMutation.isPending ? (
<LuLoaderCircle className="w-4 h-4 animate-spin text-muted-foreground" />
) : (
<LuGitPullRequest className="w-4 h-4 text-muted-foreground" />
)}
</button>
🤖 Prompt for AI Agents
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ChangesHeader/components/PRButton/PRButton.tsx`
around lines 58 - 73, PRButton renders an icon-only button when no PR exists;
add accessibility attributes so screen readers can announce it: update the
button inside PRButton (the element using createPRMutation.mutate and
worktreePath) to include a descriptive aria-label (e.g., "Create pull request")
and set aria-busy={createPRMutation.isPending} while the mutation is pending;
keep the existing disabled prop and visual loading icon behavior.

@chasemcdo
Copy link
Copy Markdown
Contributor Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

@Kitenite
Copy link
Copy Markdown
Collaborator

Kitenite commented Feb 4, 2026

This works for me. Keeping in mind there might be a command palette at some point which will take precedence for CMD+P. At that time I will move the default hotkeys and let you know

@Kitenite Kitenite merged commit 2aac827 into superset-sh:main Feb 4, 2026
3 of 5 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.

2 participants