Skip to content

feat(ui): show PR number alongside branch name in input box label - #802

Merged
edenreich merged 5 commits into
mainfrom
fix/issue-796
Jul 9, 2026
Merged

edenreich merged 5 commits into
mainfrom
fix/issue-796

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

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

  • Added GitPR field to StatusBarIndicators config struct (default: true) under chat.status_bar.indicators
  • Added git_pr case to shouldShowIndicator in InputStatusBar
  • Added getCurrentGitPR() method to InputView that shells out to gh pr view --json number --jq .number with a 5-second TTL cache
  • Added InvalidateGitPRCache() method, called on BashCommandCompletedEvent alongside the existing git branch cache invalidation
  • Modified buildGitBranchLabel() to append #<pr> when git_pr is enabled and a PR exists
  • Added 14 unit tests covering PR label formatting, config toggles, cache behavior, and cache invalidation

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.
Comment thread internal/ui/components/input_view.go Resolved
edenreich added 4 commits July 9, 2026 02:06
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.
@edenreich
edenreich marked this pull request as ready for review July 9, 2026 00:41
@edenreich
edenreich requested a review from a team as a code owner July 9, 2026 00:41
@edenreich
edenreich merged commit 186bba9 into main Jul 9, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-796 branch July 9, 2026 00:41
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.140.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Show PR number alongside branch name in input box label

1 participant