mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 20:15:40 +00:00
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.
This commit is contained in:
1 parent
74ea8ead6c
commit
d9bd5b6f86
1 file changed
+9
-10
@@ -226,7 +226,7 @@ struct BarMenuView: View {
|
|||||||
/// present, preserving the single "Accounts" header for a CLIProxy-only setup.
|
/// present, preserving the single "Accounts" header for a CLIProxy-only setup.
|
||||||
@ViewBuilder private var accountsSection: some View {
|
@ViewBuilder private var accountsSection: some View {
|
||||||
let parts = BarFormatting.partitionSubscriptions(viewModel.rows)
|
let parts = BarFormatting.partitionSubscriptions(viewModel.rows)
|
||||||
VStack(alignment: .leading, spacing: 8) {
|
VStack(alignment: .leading, spacing: 6) {
|
||||||
if let error = viewModel.lastError {
|
if let error = viewModel.lastError {
|
||||||
ErrorBanner(message: error)
|
ErrorBanner(message: error)
|
||||||
}
|
}
|
||||||
@@ -364,17 +364,16 @@ struct BarMenuView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Estimates the height of a single profile carousel so its frame does not
|
/// Height of the tallest single card in a carousel — only one card is visible
|
||||||
/// collapse. Only ONE card is visible at a time, so the height is the tallest
|
/// at a time, so the paged frame is sized to fit it WITHOUT reserving blank
|
||||||
/// single card in the carousel: a title row plus one bar per quota window, or a
|
/// space beneath. Card = vertical padding (16) + title row (~22) + one bar per
|
||||||
/// compact parked/empty card when there are no windows.
|
/// 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 {
|
private func carouselHeight(_ rows: [BarSummaryRow]) -> CGFloat {
|
||||||
let maxWindows = rows.map { $0.quotaWindows?.count ?? 0 }.max() ?? 0
|
let maxWindows = rows.map { $0.quotaWindows?.count ?? 0 }.max() ?? 0
|
||||||
if maxWindows == 0 {
|
if maxWindows == 0 { return 60 }
|
||||||
return 80 // parked / reauth card: title row + status line only.
|
let hasFootnote = rows.contains { $0.staleAsOf != nil }
|
||||||
}
|
return 40 + CGFloat(maxWindows) * 20 + (hasFootnote ? 16 : 0)
|
||||||
// ~34pt title row + ~28pt per window bar + vertical padding.
|
|
||||||
return 44 + CGFloat(maxWindows) * 30
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var header: some View {
|
private var header: some View {
|
||||||
|
|||||||
Reference in new issue
Block a user