Skip to content

[feature] Repositories panel: Show current branch per repo and auto-refresh on external branch changes #17

@justinkumpe

Description

@justinkumpe

Summary

Update the Repositories section to display the active branch name for each repository and keep it in sync whenever branches change, including manual branch switches from terminal commands.

Problem

The Repositories section does not reliably surface per-repo branch context in real time. Users can change branches outside Git QuickOps (for example from terminal), which can leave the UI stale and potentially misleading.

User Story

As a developer using Git QuickOps, I want the Repositories section to show the current branch name for each repository and automatically update when branch changes occur, so I always have accurate context without manually refreshing.

Acceptance Criteria

  • Repositories section displays the active branch name for each repository.
  • Works in both single-repo and multi-repo workspaces.
  • Branch changes triggered by Git QuickOps commands update the UI immediately.
  • Branch changes made outside the extension (for example git switch, git checkout in terminal) are reflected automatically without reloading the extension.
  • Detached HEAD or unreadable branch state is shown with a safe fallback label (for example detached or unknown) without breaking the UI.
  • Refresh/update behavior does not introduce noticeable performance degradation.

Implementation Notes

  • Use repository-aware branch detection for each listed repo.
  • Hook refresh logic to:
    • internal command flows that can change branch
    • external Git state changes (file watchers, Git API events, or periodic lightweight refresh fallback)
  • Ensure refresh triggers update only necessary UI state to avoid unnecessary redraws.

Test Checklist

  • Single repository: switch branches via extension and verify immediate update.
  • Single repository: switch branches via terminal and verify automatic update.
  • Multi-repository workspace: validate each repo shows correct branch independently.
  • Detached HEAD scenario: verify fallback label renders cleanly.
  • Invalid/unavailable repo state: verify graceful handling and no crashes.
  • Smoke test panel responsiveness after repeated branch switches.

Definition of Done

  • Branch names are visible in Repositories entries.
  • UI stays accurate for both internal and external branch changes.
  • Behavior validated in single and multi-repo setups.
  • Feature documented in README changelog/feature notes.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions