Open a pull request from the TUI#256
Merged
Merged
Conversation
Wire the existing github.Client.CreatePR into the GitHub panel. Pressing n on the Pull Requests tab starts a multi-step form: head branch (prefilled with the current local branch), base branch (prefilled with the repo default branch), a required title, and an optional body. On submit the PR is created, the list refreshes, and the new PR is selected. Guards: no-op without a GitHub client, warn when there is no current branch or the branch is not pushed, reject head equal to base, and reject an empty title. API failures surface as an error notification. Register the n binding in keybindings.json and regenerate docs/keybindings.md. Add unit tests covering prefill, the guard cases, the create-then-refresh flow, request contents, and error paths using the existing GitHub client mock. Closes #249 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
# Conflicts: # docs/keybindings.md # internal/keybindings/keybindings.json # internal/panels/gitinfo/gitinfo.go # internal/panels/gitinfo/gitinfo_github.go # internal/panels/gitinfo/gitinfo_modal_handlers.go # internal/panels/gitinfo/gitinfo_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #249
What changed
Wires the existing
github.Client.CreatePRinto the GitHub panel so you can open a pull request without leaving grut.Pressing
non the Pull Requests tab starts a multi-step form:On submit the PR is created through
CreatePR, the list refreshes, and the new PR is selected. The filter resets to All so the new PR is guaranteed visible, and it is inserted optimistically for instant feedback ahead of the server refresh.Guards
The current branch is read from the existing git client branch list, which carries local branches even while the panel is in GitHub mode. Base falls back to
mainwhen the default branch is unknown.Keybindings and docs
nbinding to the github section ofinternal/keybindings/keybindings.json.docs/keybindings.md. The help overlay reads the JSON directly.How tested
go build ./...after every change, all clean.go test ./...: full suite passes, including 16 new tests ininternal/panels/gitinfo/gitinfo_test.gocovering prefill, default-branch fallback, the no-branch/unpushed/nil-client guards, empty-title and head-equals-base rejection, the full create-then-refresh flow with request-content assertions, empty-body omission, error propagation, cancel reset, pending-reselect consumption, and thenkey entry point. Tests use the existingmockGHClientFull.go vet ./...: clean.gofmt: clean.No new dependencies. Single panel touched (
internal/panels/gitinfo/) plus the keybinding registry and generated docs.