Skip to content

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

Description

@edenreich

Summary

Enhance the existing git branch label in the input box top border to also detect and display the associated GitHub PR number when one exists. Currently the input shows ⎇ <branch> (e.g., ⎇ fix/issue-785); it should also show ⎇ fix/issue-785 #792 when a PR exists for the current branch.

Motivation

When working on a branch that already has a PR open, it's useful to see the PR number at a glance without running gh pr view separately. This reduces context-switching and makes the TUI more informative.

Acceptance Criteria

  • The branch label in the input box top border shows ⎇ <branch> #<pr> when a PR exists for the current branch
  • Falls back to ⎇ <branch> when no PR exists (no regression)
  • PR detection uses gh pr view --json number --jq .number (or equivalent) with caching similar to the existing git branch cache (5s TTL)
  • The PR number is only fetched when git_branch indicator is enabled in config
  • A new config option git_pr (or similar) under chat.status_bar.indicators controls whether the PR number is shown (default: true)
  • The label is truncated gracefully when the box is narrow (existing spliceBranchIntoTopBorder handles this)
  • Unit tests for the PR detection and label formatting
  • The cache is invalidated on BashCommandCompletedEvent (same as git branch cache)

Activity

  1. added
    enhancement
    on Jul 8, 2026
  2. added theissue type on Jul 8, 2026
  3. moved this to Todo in 2026on Jul 8, 2026
  4. edenreich commented on Jul 8, 2026

    @edenreich
    ContributorAuthor

    @infer Can you work on this? use /go /go-concurrency /bubbles-v4 /bubbletea-v2 /ponytail or any other skills you need for the task.

  5. inference-gateway-maintainer commented on Jul 8, 2026

    @inference-gateway-maintainer
    Contributor

    Model: ollama_cloud/deepseek-v4-flash · View Job

    Todos

    • Explore codebase: understand current git branch label, config, and caching
    • Add git_pr config option under chat.status_bar.indicators
    • Implement PR number detection with caching (5s TTL)
    • Integrate PR number into branch label formatting
    • Add unit tests for PR detection and label formatting
    • Run pre-commit and push

    Pull Request

    #802

    ✅ Infer Result: Success

    All done. Here's a summary of the changes:

    Added PR number display alongside branch name in the input box top border (PR #802):

    • Config: Added GitPR field (default: true) to StatusBarIndicators under chat.status_bar.indicators in config/config.go
    • PR detection: Added getCurrentGitPR() method to InputView that runs gh pr view --json number --jq .number with a 5-second TTL cache, and InvalidateGitPRCache() to clear it
    • Label formatting: Modified buildGitBranchLabel() to append #<pr> when git_pr is enabled and a PR exists, falling back to the existing ⎇ <branch> format
    • Cache invalidation: PR cache is invalidated on BashCommandCompletedEvent alongside the git branch cache
    • Indicator control: Added git_pr case to shouldShowIndicator in InputStatusBar
    • Tests: Added 14 unit tests covering PR label formatting, config toggles, cache behavior, and cache invalidation

    Model: ollama_cloud/deepseek-v4-flash · Exit Code: 0 · Duration: 7m 24s

    Tokens: 6,687,120 in · 12,866 out · 6,699,986 total (46 requests)

    Tool calls: 54 total · 96% success rate

    ⚠️ 2 failed tool call(s)
    • Read: UNREADABLE_BINARY
    • Bash: exit status 201: �[32mtask: [precommit:run] pre-commit run --all-files
      �[0m"pre-commit": executable file not found in $PATH
      ::error title=Task 'precommit:run' failed::exit status 127
      �[31mtask: Failed to run task "precommit:run": exit status 127
      �[0m

    Triggered by edenreich · Infer Action

  6. moved this from Todo to In progress in 2026on Jul 8, 2026
  7. moved this from In progress to QA in 2026on Jul 9, 2026
  8. added a commit that references this issue on Jul 9, 2026
    186bba9
  9. moved this from QA to Done in 2026on Jul 9, 2026
  10. inference-gateway-releaser commented on Jul 9, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.140.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleased

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions