Remove branch icons from Branches list

The only information that this carries is whether an entry is a real branch or a
detached head. Detached heads can only be at the top, and they are easy to tell
apart from the other branches by their name, so the icon is not really very
useful.

We are going to show PR icons in this column.
This commit is contained in:
Stefan Haller 2026-03-23 15:47:14 +01:00
parent 968c44b02f
commit 649679c33a
2 changed files with 3 additions and 10 deletions

View file

@ -63,9 +63,6 @@ func getBranchDisplayStrings(
if len(divergence) > 0 {
availableWidth -= utils.StringWidth(divergence) + 1
}
if icons.IsIconEnabled() {
availableWidth -= 2 // one for the icon, one for the space
}
if showCommitHash {
availableWidth -= utils.COMMIT_HASH_SHORT_SIZE + 1
}
@ -136,10 +133,6 @@ func getBranchDisplayStrings(
res := make([]string, 0, 6)
res = append(res, recencyColor.Sprint(b.Recency))
if icons.IsIconEnabled() {
res = append(res, nameTextStyle.Sprint(icons.IconForBranch(b)))
}
if showCommitHash {
res = append(res, utils.ShortHash(b.CommitHash))
}

View file

@ -72,7 +72,7 @@ func Test_getBranchDisplayStrings(t *testing.T) {
useIcons: true,
checkedOutByWorktree: true,
showDivergenceCfg: "none",
expected: []string{"1m", "󰘬", "branch_name (󰌹 other-worktree)"},
expected: []string{"1m", "branch_name (󰌹 other-worktree)"},
},
{
branch: &models.Branch{
@ -219,11 +219,11 @@ func Test_getBranchDisplayStrings(t *testing.T) {
branch: &models.Branch{Name: "branch_name", Recency: "1m"},
itemOperation: types.ItemOperationNone,
fullDescription: false,
viewWidth: 14,
viewWidth: 12,
useIcons: true,
checkedOutByWorktree: true,
showDivergenceCfg: "none",
expected: []string{"1m", "󰘬", "branc… 󰌹"},
expected: []string{"1m", "branc… 󰌹"},
},
{
branch: &models.Branch{