feat(zsh): handle draft PRs in ghsq/ghrb and compact the picker preview#335
Merged
Conversation
Draft PRs report mergeable=MERGEABLE (that field tracks conflicts, not draft state), so the sequential-merge poll loop never caught them and `gh pr merge` failed with a generic "merge failed" line. `_gh_poll_merge` now detects `isDraft` up front and prompts per draft: mark ready & merge (`gh pr ready`) or skip. Also surface drafts in the fzf pickers and tidy the preview: - `_gh_paint` colours the state column — draft → bold magenta, ready → dim — so drafts pop. Space-delimited match avoids painting "ready" inside a title word like "already". - PR-picker preview drops the 100-line raw diff for a compact `git apply --stat` filestat (same two API calls, rendered locally), narrows to 60% width, and scrolls by half-page on ^d/^u. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017P6zLTE5zek8KnDJtBp9ig
Contributor
|
| Status | Count |
|---|---|
| 🔍 Total | 170 |
| ✅ Successful | 160 |
| ⏳ Timeouts | 0 |
| 🔀 Redirected | 0 |
| 👻 Excluded | 9 |
| ❓ Unknown | 0 |
| 🚫 Errors | 1 |
Errors per input
Errors in exact_dot_claude/docs/prds/daily-catchup.PRD.md
- [404] https://docs.anthropic.com/claude-code/commands | Failed: Network error: Not Found
Full Github Actions output
Please fix the broken links before merging.
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.
What
Fixes
ghsq/ghrbstumbling on draft PRs, surfaces drafts in the fzf pickers, and tidies the PR-picker preview.Why
A draft PR reports
mergeable=MERGEABLE— that GraphQL field tracks merge conflicts, not draft state — so the sequential-merge poll loop (_gh_poll_merge) never noticed the draft and handed it straight togh pr merge, which GitHub rejects. The user saw a generic "merge failed" with no indication that draftness was the cause, and nothing in the picker flagged which PRs were drafts.How
_gh_poll_merge) — detectisDraftup front and prompt per draft:r=gh pr readythen merge,s= skip. (Chosen behaviour: prompt per draft, for max control without silently flipping PR state.)_gh_paint) — colour the state column: draft → bold magenta, ready → dim, so drafts pop. Space-delimited match avoids paintingreadyinside a title word like already.git apply --statfilestat (rendered locally from the samegh pr diffcall — no extra API request), narrow the window to 60%, and scroll by half-page on^d/^ufor smoother reading.Verification
zsh -non the rendered~/.zshrc: clean.draft/readystate column plus a title containing both Already and a trailing ready? — only the state column colourises.git apply --statconfirmed to render a diffstat fromgh pr diffoutput with no repo/tool dependency.chezmoi apply ~/.zshrc;chezmoi statusclean.🤖 Generated with Claude Code