Skip to content

feat: add HEAD option to branch selector dropdown#919

Open
TomKalina wants to merge 1 commit intomhutchie:developfrom
TomKalina:feat/head-branch-selector
Open

feat: add HEAD option to branch selector dropdown#919
TomKalina wants to merge 1 commit intomhutchie:developfrom
TomKalina:feat/head-branch-selector

Conversation

@TomKalina
Copy link
Copy Markdown

Summary

  • Adds a dynamic HEAD (branch-name) option to the branch selector dropdown
  • Automatically resolves to the currently checked-out branch when loading commits
  • Persists across branch switches — the graph always follows the current HEAD without manual reselection

Changes

  • web/utils.ts: Added HEAD_BRANCH constant
  • web/main.ts:
    • getBranchOptions(): Adds "HEAD (branch-name)" option when HEAD is available
    • resolveHeadBranches(): Resolves HEAD to actual branch name before sending to backend
    • loadRepoInfo(): Preserves HEAD selection when filtering stale branches

Test plan

  • Open Git Graph, verify "HEAD (branch-name)" appears in the branch dropdown
  • Select HEAD, verify the graph shows commits for the current branch
  • Switch branches via git checkout, reload graph, verify HEAD follows the new branch
  • Select HEAD alongside other branches, verify both are shown

🤖 Generated with Claude Code

Adds a dynamic "HEAD (branch-name)" option to the branch dropdown that
automatically resolves to the currently checked-out branch. When the user
switches branches, the selection follows HEAD without manual reselection.

Closes #1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TomKalina TomKalina requested a review from mhutchie as a code owner April 1, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant