Skip to content

chore: merge PRs directly from right sidebar#1002

Merged
arnestrickmann merged 5 commits intomainfrom
emdash/merge-pr-buttonn-13b
Feb 20, 2026
Merged

chore: merge PRs directly from right sidebar#1002
arnestrickmann merged 5 commits intomainfrom
emdash/merge-pr-buttonn-13b

Conversation

@arnestrickmann
Copy link
Contributor

@arnestrickmann arnestrickmann commented Feb 20, 2026

PR description
Adds a “Merge Pull Request” section to the right sidebar (Checks tab) so PRs can be merged directly from
Emdash.

  • Renders a merge section below CI/CD checks and PR comments in the right sidebar
  • Supports merge methods (merge commit / squash / rebase) via a dropdown on the merge button
  • Adds an optional “Merge without waiting” toggle (uses gh pr merge --admin when enabled)
  • Shows merge state (ready/blocked/conflicts/draft/merged) and keeps the section visible after merging
  • Improves disabled UX: merge button stays styled and shows a tooltip explaining why it’s disabled
  • Adds a full-width info badge for merge-conflict state (“Resolve merge conflicts before merging”)
  • Fixes compatibility with gh by removing the unsupported --yes flag for gh pr merge

Implementation notes

  • New UI: src/renderer/components/MergePrSection.tsx
  • New IPC: git:merge-pr in src/main/ipc/gitIpc.ts + bridge in src/main/preload.ts + typings in src/renderer/
    types/electron-api.d.ts

Test plan

  • Open a workspace with an open PR
  • Go to right sidebar → Checks tab
  • Verify merge section appears and reflects status (Ready/Blocked/Conflicts/Draft/Merged)
  • Select merge method from dropdown and merge a test PR
  • Toggle “Merge without waiting” (if blocked) and verify it attempts admin merge
  • Create a PR with conflicts and confirm merge stays disabled + conflict badge shows
  • After merging, confirm section remains and shows “Merged” state

@vercel
Copy link

vercel bot commented Feb 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Feb 20, 2026 11:15pm

Request Review

@arnestrickmann arnestrickmann changed the title chore: update gitIpc chore: merge PRs directly from right sidebar Feb 20, 2026
@greptile-apps
Copy link

greptile-apps bot commented Feb 20, 2026

Greptile Summary

Adds a "Merge Pull Request" section to the right sidebar (Checks tab) that allows PRs to be merged directly from Emdash via the GitHub CLI.

  • New MergePrSection component renders merge UI with strategy dropdown (merge commit / squash / rebase) and optional admin override toggle
  • Backend IPC handler (git:merge-pr) executes gh pr merge with appropriate flags via execFileAsync for safe command execution
  • Merge state computed from PR status (CLEAN, DIRTY, BLOCKED, HAS_HOOKS, UNSTABLE) with appropriate UI feedback
  • Auto-refreshes PR status when CI checks complete using a ref to detect state transitions
  • Persists user preferences (merge strategy and admin override) to localStorage
  • Keeps merge section visible after merging, showing "Merged" state
  • Comprehensive error handling with user-friendly toast notifications

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation follows established patterns in the codebase (IPC handlers, component structure, error handling), uses secure command execution via execFileAsync, includes proper TypeScript types, handles edge cases comprehensively, and adds valuable UX improvements with proper state management
  • No files require special attention

Important Files Changed

Filename Overview
src/main/ipc/gitIpc.ts Added git:merge-pr IPC handler to merge PRs via GitHub CLI with configurable merge strategy and admin override support
src/renderer/components/FileChangesPanel.tsx Integrated MergePrSection component and added auto-refresh when CI checks complete
src/renderer/components/MergePrSection.tsx New component for merging PRs with merge strategy selection, admin override toggle, and comprehensive merge state handling

Sequence Diagram

sequenceDiagram
    participant User
    participant MergePrSection
    participant FileChangesPanel
    participant ElectronAPI
    participant GitIpc
    participant GH as GitHub CLI

    User->>MergePrSection: Click merge button
    MergePrSection->>MergePrSection: Check merge state & strategy
    MergePrSection->>ElectronAPI: mergePr(taskPath, prNumber, strategy, admin)
    ElectronAPI->>GitIpc: IPC: git:merge-pr
    GitIpc->>GitIpc: Verify git repo (git rev-parse)
    GitIpc->>GH: gh pr merge [prNumber] --merge/--squash/--rebase [--admin]
    GH-->>GitIpc: Merge result
    GitIpc-->>ElectronAPI: {success, output/error, code}
    ElectronAPI-->>MergePrSection: Merge result
    MergePrSection->>MergePrSection: Show toast notification
    MergePrSection->>FileChangesPanel: refreshPr()
    FileChangesPanel->>ElectronAPI: getPrStatus(taskPath)
    ElectronAPI-->>FileChangesPanel: Updated PR status
    FileChangesPanel->>MergePrSection: Pass updated PR data
    MergePrSection->>MergePrSection: Update UI to "Merged" state
Loading

Last reviewed commit: c504fcc

@arnestrickmann arnestrickmann merged commit b7703d7 into main Feb 20, 2026
4 checks passed
@arnestrickmann arnestrickmann deleted the emdash/merge-pr-buttonn-13b branch February 27, 2026 22:26
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