浏览代码

Guard SwiftUI previews behind DEBUG for release stability.

This prevents Release builds from depending on preview macro expansion in restricted CLI environments while preserving design-time previews in Debug.

Made-with: Cursor
Hussain Afzal 3 月之前
父节点
当前提交
8eda16a522

+ 2 - 0
google_apps/CreateAppSheetView.swift

@@ -181,7 +181,9 @@ struct CreateAppSheetView: View {
     }
 }
 
+#if DEBUG
 #Preview {
     CreateAppSheetView { _ in }
         .frame(width: 800, height: 390)
 }
+#endif

+ 2 - 0
google_apps/LauncherRootView.swift

@@ -1386,7 +1386,9 @@ private struct HideMenuIndicatorIfAvailable: ViewModifier {
     }
 }
 
+#if DEBUG
 #Preview {
     LauncherRootView()
         .environmentObject(PremiumStore.shared)
 }
+#endif

+ 2 - 0
google_apps/PremiumFeaturesView.swift

@@ -382,8 +382,10 @@ struct PremiumFeaturesView: View {
     }
 }
 
+#if DEBUG
 #Preview {
     PremiumFeaturesView()
         .environmentObject(PremiumStore.shared)
         .frame(width: 560, height: 690)
 }
+#endif

+ 2 - 0
google_apps/Widgets/WidgetPreviewCard.swift

@@ -39,6 +39,7 @@ struct WidgetPreviewCard: View {
     }
 }
 
+#if DEBUG
 #Preview {
     ZStack {
         Color.black
@@ -50,4 +51,5 @@ struct WidgetPreviewCard: View {
             .padding()
     }
 }
+#endif
 

+ 2 - 0
google_apps/Widgets/WidgetsRootView.swift

@@ -455,6 +455,7 @@ private func encodeUUIDSet(_ set: Set<UUID>) -> String {
     }
 }
 
+#if DEBUG
 #Preview {
     ZStack {
         Color.black
@@ -467,3 +468,4 @@ private func encodeUUIDSet(_ set: Set<UUID>) -> String {
         .padding()
     }
 }
+#endif