Skip to content

Open a pull request from the TUI #249

Description

@jongio

Problem

grut can list and merge pull requests, but there is no way to open a new PR from the current branch without switching to the browser or gh pr create. The client already implements CreatePR (internal/github/client.go), and it has no callers in the UI.

Proposed solution

Add a create-PR action to the Pull Requests tab.

  • Press n on the PRs tab to open a form prefilled with the current branch as head and the repository default branch as base, plus editable Title and Body fields.
  • On submit, call CreatePR, refresh the PRs list, and select the new PR.
  • Guard obvious errors: block when head equals base, and show a clear message when the current branch has no matching remote branch yet.
  • Title is required; Escape cancels. Failures surface as a notification.

Acceptance criteria

  • n on the PRs tab opens a form with head prefilled to the current branch and base to the default branch, both editable.
  • Submitting creates the PR via CreatePR and it appears in the refreshed list.
  • Empty title rejected; head equal to base rejected with a message; Escape cancels.
  • API failures show a clear error notification.
  • Unit tests cover prefill, validation, and the create-then-refresh flow with the GitHub client mock.
  • Keybinding documented in the help overlay and internal/keybindings/keybindings.json.

Notes

  • Touches the GitHub panel under internal/panels/gitinfo/ and reuses internal/github CreatePR. The current branch comes from the existing git client.
  • Single PR, no new dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions