From d13f8ebe7b9ce53c4fe46cd9f55e99fa830f2de1 Mon Sep 17 00:00:00 2001 From: Alvie Stoddard Date: Fri, 24 Jul 2026 14:36:04 -0700 Subject: [PATCH 1/2] Fix Paste Bar card alignment --- Sources/Pesty/UI/BarView.swift | 50 ++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/Sources/Pesty/UI/BarView.swift b/Sources/Pesty/UI/BarView.swift index c37985b..9889ab4 100644 --- a/Sources/Pesty/UI/BarView.swift +++ b/Sources/Pesty/UI/BarView.swift @@ -1,6 +1,9 @@ import SwiftUI struct BarView: View { + private static let stripTopInset: CGFloat = 4 + private static let stripBottomInset: CGFloat = 18 + @Bindable private var store = ClipboardStore.shared @Bindable private var settings = Settings.shared @@ -87,31 +90,36 @@ struct BarView: View { } private var strip: some View { - ScrollViewReader { proxy in - ScrollView(.horizontal, showsIndicators: false) { - LazyHStack(spacing: Theme.cardSpacing) { - ForEach(Array(store.visibleItems.enumerated()), id: \.element.id) { index, item in - ClipCardView(item: item, - index: index, - selected: item.id == store.selectedID) - .id(item.id) - .transition(.asymmetric( - insertion: .scale(scale: 0.92).combined(with: .opacity), - removal: .opacity)) + GeometryReader { geometry in + let cardHeight = max(1, geometry.size.height - Self.stripTopInset - Self.stripBottomInset) + + ScrollViewReader { proxy in + ScrollView(.horizontal, showsIndicators: false) { + LazyHStack(alignment: .top, spacing: Theme.cardSpacing) { + ForEach(Array(store.visibleItems.enumerated()), id: \.element.id) { index, item in + ClipCardView(item: item, + index: index, + selected: item.id == store.selectedID) + .frame(height: cardHeight) + .id(item.id) + .transition(.asymmetric( + insertion: .scale(scale: 0.92).combined(with: .opacity), + removal: .opacity)) + } } + .padding(.horizontal, 18) + .padding(.top, Self.stripTopInset) + .padding(.bottom, Self.stripBottomInset) + .animation(.spring(response: 0.34, dampingFraction: 0.8), value: store.visibleItems.count) } - .padding(.horizontal, 18) - .padding(.top, 4) - .padding(.bottom, 18) - .animation(.spring(response: 0.34, dampingFraction: 0.8), value: store.visibleItems.count) - } - .onChange(of: store.selectedID) { _, id in - guard let id else { return } - withAnimation(.spring(response: 0.3, dampingFraction: 0.78)) { - proxy.scrollTo(id, anchor: .center) + .onChange(of: store.selectedID) { _, id in + guard let id else { return } + withAnimation(.spring(response: 0.3, dampingFraction: 0.78)) { + proxy.scrollTo(id, anchor: .center) + } } + .overlay { if store.visibleItems.isEmpty { emptyState } } } - .overlay { if store.visibleItems.isEmpty { emptyState } } } .frame(maxHeight: .infinity) } From 5c4b38e891693e17d852b3eab0d5cf79ca3421d2 Mon Sep 17 00:00:00 2001 From: Alvie Stoddard Date: Sat, 25 Jul 2026 06:46:41 -0700 Subject: [PATCH 2/2] Add breathing room below card strip --- Sources/Pesty/UI/BarView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Pesty/UI/BarView.swift b/Sources/Pesty/UI/BarView.swift index 9889ab4..11fb298 100644 --- a/Sources/Pesty/UI/BarView.swift +++ b/Sources/Pesty/UI/BarView.swift @@ -1,8 +1,8 @@ import SwiftUI struct BarView: View { - private static let stripTopInset: CGFloat = 4 - private static let stripBottomInset: CGFloat = 18 + private static let stripTopInset: CGFloat = 16 + private static let stripBottomInset: CGFloat = 26 @Bindable private var store = ClipboardStore.shared @Bindable private var settings = Settings.shared