Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add PR buttons to branch cards#76

Merged
wesbillman merged 3 commits intomainfrom
matt2e/pr2
Feb 12, 2026
Merged

feat: add PR buttons to branch cards#76
wesbillman merged 3 commits intomainfrom
matt2e/pr2

Conversation

@matt2e
Copy link
Contributor

@matt2e matt2e commented Feb 12, 2026

Screenshot 2026-02-12 at 12 52 42 pm Screenshot 2026-02-12 at 12 52 38 pm Screenshot 2026-02-12 at 12 56 50 pm

Summary

  • PR creation from branch card: Add a "Create PR" button to the branch card that kicks off an agent session to push the branch and create a PR via gh. Includes backend Tauri commands (create_pr, update_branch_pr) and store support for persisting PR numbers.

Changes

  • staged/src-tauri/src/lib.rs — New create_pr and update_branch_pr Tauri commands
  • staged/src-tauri/src/store/branches.rsupdate_branch_pr_number store method
  • staged/src/lib/BranchCard.svelte — PR button UI with state machine (idle/creating/error/created), explicit New note/New commit buttons
  • staged/src/lib/NewSessionModal.svelte — Simplified header, removed mode toggle pill UI
  • staged/src/lib/commands.tscreatePr and updateBranchPr TypeScript bindings

Add a PR button to the bottom-left of the branch card with full
lifecycle management:

Backend:
- Add create_pr Tauri command that kicks off an agent session to push
  the branch and create a PR via `gh` CLI with conventional commit
  title styling
- Add update_branch_pr command to persist PR number to storage
- Add update_branch_pr_number method to branch store

Frontend:
- Add PR button with four states: idle, creating (spinner), error
  (alert icon), and created (view PR link)
- On create: uses the most recent agent provider from preferences to
  start a session that pushes to remote and creates the PR
- On completion: parses session messages for PR URL, extracts PR
  number, saves to storage via update_branch_pr
- On error: clicking shows a dialog with the error message, retry
  and close buttons
- On created: button becomes 'View PR #N' which opens the PR in the
  user's browser via open_url
- Add createPr and updateBranchPr frontend command wrappers
Use getPreferredAgent with location-aware agent lists instead of
blindly picking the first recent agent. For remote branches, filter
against REMOTE_AGENTS; for local branches, filter against discovered
local providers (agentState.providers). This matches the pattern
already used by NewSessionModal.
@matt2e matt2e marked this pull request as draft February 12, 2026 20:48
@matt2e matt2e changed the title feat: add PR creation button and replace long-press picker with explicit action buttons feat: add PR buttons to branch cards Feb 12, 2026
@matt2e matt2e marked this pull request as ready for review February 12, 2026 20:56
@wesbillman wesbillman merged commit b2caa91 into main Feb 12, 2026
3 checks passed
@wesbillman wesbillman deleted the matt2e/pr2 branch February 12, 2026 20:59
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