Show current branch name in the repository list#76
Show current branch name in the repository list#76pol-rivero merged 4 commits intopol-rivero:mainfrom
Conversation
Add a preference toggle (disabled by default) in the Appearance tab under "Repository list" to show the current branch name next to each repository name in the sidebar. The branch name appears with a git-branch icon in a secondary color with ellipsis for overflow. Resolves desktop#8158 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Hmmm, go ahead if you are convinced, but I am not going to lie; I am not onboard... The reason I wanted to add the branch next to the name is because I wanted to quickly identify the repo I am looking for. So I prefer my design because placing the branch name directly after the repository name allows for much faster identification. Keeping these two elements together creates a single logical unit, which avoids the need to follow a "long" horizontal line. In the second design, the gap between the name and the branch can be difficult to scan. Additionally, the inline layout handles long names and status icons more effectively. It is much clearer how to manage text truncation when the elements are adjacent, whereas the second design creates uncertainty about which part should be shortened first to avoid overlapping. The placement of the "has changes" and "pending push" indicators in the middle also feels disconnected; in the first design, these icons remain attached to the right, making the repository's state much easier to understand at a glance (always at the right side). Besides this... the rest is subjective, and the fork is yours, so your choice! 😅😂 |
|
I can see your point. |
|
Also, this is not related to the branch name indicator, but it seems that you need to work with several branches of the same repo simultaneously. In that case, have you considered git worktrees? We recently added support for them. |
|
Thanks for the suggestion! I have actually tried worktrees, but I didn't love them, and I saw more advantages by re-cloning the repos. The main dealbreaker is the branch restriction: you cannot have the exact same branch checked out in multiple worktrees simultaneously. I often need the same branch open in two places to create cherry picks, visualize the work of AI agents with different tasks, ... and separate clones give me total freedom for that. Besides, the cleanup is just an extra hassle. With a normal clone, I just delete the folder ( So yeah, isolated clones simply work better for my workflow 😅 |
|
Sure thing. Everyone has their preferred way of working :) |
Add a rounded pill background to the branch name indicator using a new --branch-pill-background-color CSS variable. The pill adapts to light/dark themes and selected/focused list item states, matching the existing badge styling conventions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The branch-name element was nested inside the .name div which has overflow:hidden, causing the pill's rounded corners to be clipped with a straight edge when text overflows. Moving it to a sibling flex item preserves the pill's border-radius during truncation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Looks good! |






Fixes desktop#8158
Summary
Motivation
This is a long-requested feature (see #8158, #5764, #7856, #15544, #16112, #17274, #17880) that addresses a common pain point: when users have multiple clones or worktrees of the same repository, the repository list shows identical names with no way to tell them apart without clicking through each one.
This is increasingly relevant with the rise of AI coding agents, where developers commonly maintain multiple clones of the same repo working on different branches simultaneously.
Implementation
The change is minimal and follows existing patterns in the codebase:
ILocalRepositoryState): Added optionalbranchNamefieldapp-store.ts): Populated fromstatus.currentBranchwhich is already fetched; added persisted preferenceshow-branch-name-in-repo-listgroup-repositories.ts,repositories-list.tsx): Passed through existing data pipeline, gated by the preferencerepository-list-item.tsx): Rendered inline with a branch icon, in secondary text color_repository-list.scss): Styled to be subtle and truncate gracefullyappearance.tsx): Checkbox under the "Repository list" section in the Appearance preferences tabNo new data fetching is required — the branch name is already available from the existing
git statuscalls.Enabling the feature
Users can enable this feature: