Repository navigation
feat(ui): show PR number alongside branch name in input box label - #802
Merged
Merged
Conversation
Add git_pr config option (default: true) under chat.status_bar.indicators that controls whether the associated GitHub PR number is shown alongside the branch name in the input box top border. PR detection uses 'gh pr view --json number --jq .number' with a 5-second TTL cache, invalidated on BashCommandCompletedEvent alongside the git branch cache. Falls back to the existing branch-only label when no PR exists or git_pr is disabled.
8 tasks
edenreich
reviewed
Jul 9, 2026
edenreich
reviewed
Jul 9, 2026
Co-authored-by: Eden Reich <[email protected]>
The PR-number cache TTL was never initialized, so every keystroke's render executed a synchronous gh network call (~0.5s). Move the fetch into a tea.Cmd delivered as domain.GitPRResolvedEvent; Render now reads plain state. Refetch on startup, bash command completion, and Bash tool execution, and drop the stale PR number when the branch changes.
Contributor
|
🎉 This PR is included in version 0.140.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Resolves #796
Summary
Enhances the git branch label in the input box top border to also detect and display the associated GitHub PR number when one exists. The label now shows
⎇ <branch> #<pr>(e.g.,⎇ fix/issue-785 #792) when a PR exists for the current branch, falling back to⎇ <branch>when no PR exists.Changes
GitPRfield toStatusBarIndicatorsconfig struct (default:true) underchat.status_bar.indicatorsgit_prcase toshouldShowIndicatorinInputStatusBargetCurrentGitPR()method toInputViewthat shells out togh pr view --json number --jq .numberwith a 5-second TTL cacheInvalidateGitPRCache()method, called onBashCommandCompletedEventalongside the existing git branch cache invalidationbuildGitBranchLabel()to append#<pr>whengit_pris enabled and a PR exists