From d9bd5b6f8683bc279979156b76935fe09da5288b Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Tue, 23 Jun 2026 23:36:06 -0400 Subject: [PATCH] fix(bar): tighten subscription carousel spacing The per-provider carousel reserved more height than a card needs, leaving blank space between each card and its page dots. Size the paged frame to the tallest card (title + one bar per window + optional stale footnote) instead of a generous estimate, and trim the subscriptions section spacing from 8 to 6. --- macos-bar/Sources/CCSBarApp/BarMenuView.swift | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/macos-bar/Sources/CCSBarApp/BarMenuView.swift b/macos-bar/Sources/CCSBarApp/BarMenuView.swift index 4c14e1fd..8c400d89 100644 --- a/macos-bar/Sources/CCSBarApp/BarMenuView.swift +++ b/macos-bar/Sources/CCSBarApp/BarMenuView.swift @@ -226,7 +226,7 @@ struct BarMenuView: View { /// present, preserving the single "Accounts" header for a CLIProxy-only setup. @ViewBuilder private var accountsSection: some View { let parts = BarFormatting.partitionSubscriptions(viewModel.rows) - VStack(alignment: .leading, spacing: 8) { + VStack(alignment: .leading, spacing: 6) { if let error = viewModel.lastError { ErrorBanner(message: error) } @@ -364,17 +364,16 @@ struct BarMenuView: View { } } - /// Estimates the height of a single profile carousel so its frame does not - /// collapse. Only ONE card is visible at a time, so the height is the tallest - /// single card in the carousel: a title row plus one bar per quota window, or a - /// compact parked/empty card when there are no windows. + /// Height of the tallest single card in a carousel — only one card is visible + /// at a time, so the paged frame is sized to fit it WITHOUT reserving blank + /// space beneath. Card = vertical padding (16) + title row (~22) + one bar per + /// quota window (~20) + an optional stale footnote (~16); a parked/reauth card + /// is just the title row plus a one-line status. private func carouselHeight(_ rows: [BarSummaryRow]) -> CGFloat { let maxWindows = rows.map { $0.quotaWindows?.count ?? 0 }.max() ?? 0 - if maxWindows == 0 { - return 80 // parked / reauth card: title row + status line only. - } - // ~34pt title row + ~28pt per window bar + vertical padding. - return 44 + CGFloat(maxWindows) * 30 + if maxWindows == 0 { return 60 } + let hasFootnote = rows.contains { $0.staleAsOf != nil } + return 40 + CGFloat(maxWindows) * 20 + (hasFootnote ? 16 : 0) } private var header: some View {