Skip to content

Commit e53b874

Browse files
authored
Align nested branch group titles with worktree row titles (#713)
The group header chevron reserved a 12pt slot while worktree rows use a 16pt icon, so group titles sat 4pt left of their children. Both now share a single leading-slot width.
1 parent efe06d6 commit e53b874

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

supacode/Features/Repositories/Views/SidebarItemView.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ import SwiftUI
77
enum SidebarNestLayout {
88
/// Pixel step a row indents per branch-nesting depth level.
99
static let indentStep: CGFloat = 14
10+
/// Width of a row's leading slot, so group chevrons and leaf icons put their
11+
/// titles on the same baseline.
12+
static let leadingSlotWidth: CGFloat = 16
13+
/// Width of a group header's disclosure chevron, narrower than the slot it
14+
/// sits in; the remainder is padded out after it.
15+
static let groupChevronWidth: CGFloat = 12
1016
}
1117

1218
/// Repo identity carried alongside a sidebar row so the highlight sections
@@ -468,7 +474,7 @@ private struct IconContent: View, Equatable {
468474
.opacity(isEmphasized ? 1 : 0.6)
469475
}
470476
}
471-
.frame(width: 16, height: 16)
477+
.frame(width: SidebarNestLayout.leadingSlotWidth, height: 16)
472478
.overlay(alignment: .bottomTrailing) {
473479
if let checkBadgeState, !isSystemImage {
474480
let badgeColor = AnyShapeStyle(checkBadgeState.color)

supacode/Features/Repositories/Views/SidebarItemsView.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,10 @@ private struct SidebarPathGroupHeaderRow: View {
280280
.foregroundStyle(.secondary)
281281
.rotationEffect(.degrees(isCollapsed ? 0 : 90))
282282
.animation(.easeInOut(duration: 0.15), value: isCollapsed)
283-
.frame(width: 12)
283+
.frame(width: SidebarNestLayout.groupChevronWidth)
284+
.padding(
285+
.trailing, SidebarNestLayout.leadingSlotWidth - SidebarNestLayout.groupChevronWidth
286+
)
284287
.accessibilityHidden(true)
285288
Text(label)
286289
.font(.body)

0 commit comments

Comments
 (0)