瀏覽代碼

Improve history list spacing and make title variants apply on row tap.

Prevent history cards from overlapping filter chips on hover, and let clicking any title suggestion select it and update the title field immediately.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 1 月之前
父節點
當前提交
af66bcbbe1

+ 2 - 0
Reddit App/Views/AIHistoryView.swift

@@ -100,6 +100,7 @@ struct AIHistoryView: View {
             .padding(.horizontal, Layout.horizontalPadding)
             .padding(.vertical, 12)
         }
+        .zIndex(1)
     }
 
     private func filterChip(_ filter: AIHistoryFilter) -> some View {
@@ -143,6 +144,7 @@ struct AIHistoryView: View {
                 }
             }
             .padding(.horizontal, Layout.horizontalPadding)
+            .padding(.top, 12)
             .padding(.bottom, 24)
         }
     }

+ 3 - 2
Reddit App/Views/Components/TitleOptimizerComponents.swift

@@ -214,12 +214,11 @@ struct TitleScoreBadge: View {
 struct TitleVariantRow: View {
     let variant: TitleVariant
     let isSelected: Bool
-    let onSelect: () -> Void
     let onApply: () -> Void
 
     var body: some View {
         HStack(alignment: .top, spacing: 12) {
-            Button(action: onSelect) {
+            Button(action: onApply) {
                 Circle()
                     .stroke(isSelected ? AppTheme.accentBlue : AppTheme.cardBorder, lineWidth: 2)
                     .frame(width: 16, height: 16)
@@ -283,6 +282,8 @@ struct TitleVariantRow: View {
                 )
         )
         .hoverCard(cornerRadius: 8, isSelected: isSelected)
+        .hoverCursor()
+        .onTapGesture(perform: onApply)
     }
 }
 

+ 1 - 2
Reddit App/Views/TitleOptimizerView.swift

@@ -314,7 +314,6 @@ struct TitleOptimizerView: View {
                         TitleVariantRow(
                             variant: variant,
                             isSelected: viewModel.selectedVariantID == variant.id,
-                            onSelect: { viewModel.selectVariant(variant) },
                             onApply: { viewModel.applyVariant(variant) }
                         )
                     }
@@ -401,7 +400,7 @@ struct TitleOptimizerView: View {
                         isSelected: viewModel.selectedVariantID == variant.id
                     )
                     .onTapGesture {
-                        viewModel.selectVariant(variant)
+                        viewModel.applyVariant(variant)
                     }
                 }
             }