diff --git a/Gaze/ContentView.swift b/Gaze/ContentView.swift index 826c5f1..b445173 100644 --- a/Gaze/ContentView.swift +++ b/Gaze/ContentView.swift @@ -19,6 +19,6 @@ struct ContentView: View { } } -#Preview { +#Preview("Content View") { ContentView() } diff --git a/Gaze/Views/Components/AnimatedFaceView.swift b/Gaze/Views/Components/AnimatedFaceView.swift index 58bb609..dde7a54 100644 --- a/Gaze/Views/Components/AnimatedFaceView.swift +++ b/Gaze/Views/Components/AnimatedFaceView.swift @@ -104,7 +104,7 @@ struct Arc: Shape { } } -#Preview { +#Preview("Animated Face") { AnimatedFaceView(size: 200) .frame(width: 400, height: 400) } diff --git a/Gaze/Views/MenuBar/MenuBarContentView.swift b/Gaze/Views/MenuBar/MenuBarContentView.swift index 47e0d7f..a16ad09 100644 --- a/Gaze/Views/MenuBar/MenuBarContentView.swift +++ b/Gaze/Views/MenuBar/MenuBarContentView.swift @@ -215,7 +215,7 @@ struct TimerStatusRow: View { } } -#Preview { +#Preview("Menu Bar Content") { let settingsManager = SettingsManager.shared let timerEngine = TimerEngine(settingsManager: settingsManager) MenuBarContentView( diff --git a/Gaze/Views/Onboarding/BlinkSetupView.swift b/Gaze/Views/Onboarding/BlinkSetupView.swift index 5d3aa1c..a9efbb6 100644 --- a/Gaze/Views/Onboarding/BlinkSetupView.swift +++ b/Gaze/Views/Onboarding/BlinkSetupView.swift @@ -48,7 +48,7 @@ struct BlinkSetupView: View { } } .padding() - .glassEffect(in: .rect(cornerRadius: 12)) + .glassEffect(.regular, in: .rect(cornerRadius: 12)) InfoBox(text: "We blink much less when focusing on screens. Regular blink reminders help prevent dry eyes") @@ -60,9 +60,16 @@ struct BlinkSetupView: View { } } -#Preview { +#Preview("Blink Setup - Enabled") { BlinkSetupView( enabled: .constant(true), intervalMinutes: .constant(5) ) } + +#Preview("Blink Setup - Disabled") { + BlinkSetupView( + enabled: .constant(false), + intervalMinutes: .constant(5) + ) +} diff --git a/Gaze/Views/Onboarding/CompletionView.swift b/Gaze/Views/Onboarding/CompletionView.swift index 513be02..ff397b7 100644 --- a/Gaze/Views/Onboarding/CompletionView.swift +++ b/Gaze/Views/Onboarding/CompletionView.swift @@ -58,7 +58,7 @@ struct CompletionView: View { .padding(.horizontal) } .padding() - .glassEffect(in: .rect(cornerRadius: 12)) + .glassEffect(.regular, in: .rect(cornerRadius: 12)) Spacer() } @@ -68,6 +68,6 @@ struct CompletionView: View { } } -#Preview { +#Preview("Completion View") { CompletionView() } diff --git a/Gaze/Views/Onboarding/LookAwaySetupView.swift b/Gaze/Views/Onboarding/LookAwaySetupView.swift index 442814f..67f5456 100644 --- a/Gaze/Views/Onboarding/LookAwaySetupView.swift +++ b/Gaze/Views/Onboarding/LookAwaySetupView.swift @@ -64,7 +64,7 @@ struct LookAwaySetupView: View { } } .padding() - .glassEffect(in: .rect(cornerRadius: 12)) + .glassEffect(.regular, in: .rect(cornerRadius: 12)) InfoBox(text: "Every \(intervalMinutes) minutes, look in the distance for \(countdownSeconds) seconds to reduce eye strain") @@ -92,10 +92,15 @@ struct InfoBox: View { } } -#Preview { +#Preview("Look Away Setup View") { LookAwaySetupView( enabled: .constant(true), intervalMinutes: .constant(20), countdownSeconds: .constant(20) ) } + +#Preview("Info Box") { + InfoBox(text: "This is an informational message that provides helpful context to the user.") + .padding() +} diff --git a/Gaze/Views/Onboarding/OnboardingContainerView.swift b/Gaze/Views/Onboarding/OnboardingContainerView.swift index 88774bf..8035261 100644 --- a/Gaze/Views/Onboarding/OnboardingContainerView.swift +++ b/Gaze/Views/Onboarding/OnboardingContainerView.swift @@ -104,7 +104,7 @@ struct OnboardingContainerView: View { ) .foregroundColor(.white) } - .glassEffect(.regular.interactive()) + .glassEffect(.regular.interactive(), in: .rect(cornerRadius: 10)) } Button(action: { @@ -126,7 +126,7 @@ struct OnboardingContainerView: View { ) .foregroundColor(.white) } - .glassEffect(.regular.tint(currentPage == 5 ? .green : .blue).interactive()) + .glassEffect(.regular.tint(currentPage == 5 ? .green : .blue).interactive(), in: .rect(cornerRadius: 10)) } .padding(.horizontal, 40) .padding(.bottom, 20) @@ -230,6 +230,6 @@ struct OnboardingContainerView: View { }) } } -#Preview { - OnboardingContainerView(s) +#Preview("Onboarding Container") { + OnboardingContainerView(settingsManager: SettingsManager.shared) } diff --git a/Gaze/Views/Onboarding/PostureSetupView.swift b/Gaze/Views/Onboarding/PostureSetupView.swift index c87b8d9..9a96fcd 100644 --- a/Gaze/Views/Onboarding/PostureSetupView.swift +++ b/Gaze/Views/Onboarding/PostureSetupView.swift @@ -48,7 +48,7 @@ struct PostureSetupView: View { } } .padding() - .glassEffect(in: .rect(cornerRadius: 12)) + .glassEffect(.regular, in: .rect(cornerRadius: 12)) InfoBox(text: "Regular posture checks help prevent back and neck pain from prolonged sitting") @@ -60,9 +60,16 @@ struct PostureSetupView: View { } } -#Preview { +#Preview("Posture Setup - Enabled") { PostureSetupView( enabled: .constant(true), intervalMinutes: .constant(30) ) } + +#Preview("Posture Setup - Disabled") { + PostureSetupView( + enabled: .constant(false), + intervalMinutes: .constant(30) + ) +} diff --git a/Gaze/Views/Onboarding/SettingsOnboardingView.swift b/Gaze/Views/Onboarding/SettingsOnboardingView.swift index 8fc0a9a..ff16dec 100644 --- a/Gaze/Views/Onboarding/SettingsOnboardingView.swift +++ b/Gaze/Views/Onboarding/SettingsOnboardingView.swift @@ -45,7 +45,7 @@ struct SettingsOnboardingView: View { } } .padding() - .glassEffect(in: .rect(cornerRadius: 12)) + .glassEffect(.regular, in: .rect(cornerRadius: 12)) // Links Section VStack(spacing: 12) { @@ -133,8 +133,14 @@ struct SettingsOnboardingView: View { } } -#Preview { +#Preview("Settings Onboarding - Launch Disabled") { SettingsOnboardingView( launchAtLogin: .constant(false) ) } + +#Preview("Settings Onboarding - Launch Enabled") { + SettingsOnboardingView( + launchAtLogin: .constant(true) + ) +} diff --git a/Gaze/Views/Onboarding/WelcomeView.swift b/Gaze/Views/Onboarding/WelcomeView.swift index 8d4f980..d61bdd5 100644 --- a/Gaze/Views/Onboarding/WelcomeView.swift +++ b/Gaze/Views/Onboarding/WelcomeView.swift @@ -29,7 +29,7 @@ struct WelcomeView: View { FeatureRow(icon: "figure.stand", title: "Maintain Good Posture", description: "Gentle reminders to sit up straight") } .padding() - .glassEffect(in: .rect(cornerRadius: 16)) + .glassEffect(.regular, in: .rect(cornerRadius: 12)) Spacer() } @@ -62,6 +62,15 @@ struct FeatureRow: View { } } -#Preview { +#Preview("Welcome View") { WelcomeView() } + +#Preview("Feature Row") { + FeatureRow( + icon: "eye.circle", + title: "Reduce Eye Strain", + description: "Regular breaks help prevent digital eye strain" + ) + .padding() +} diff --git a/Gaze/Views/Reminders/BlinkReminderView.swift b/Gaze/Views/Reminders/BlinkReminderView.swift index 72f6f1d..829a559 100644 --- a/Gaze/Views/Reminders/BlinkReminderView.swift +++ b/Gaze/Views/Reminders/BlinkReminderView.swift @@ -135,7 +135,7 @@ struct BlinkingFace: View { } } -#Preview { +#Preview("Blink Reminder") { BlinkReminderView(onDismiss: {}) .frame(width: 800, height: 600) } diff --git a/Gaze/Views/Reminders/LookAwayReminderView.swift b/Gaze/Views/Reminders/LookAwayReminderView.swift index 0e458d3..d78c395 100644 --- a/Gaze/Views/Reminders/LookAwayReminderView.swift +++ b/Gaze/Views/Reminders/LookAwayReminderView.swift @@ -113,6 +113,6 @@ struct LookAwayReminderView: View { } } -#Preview { +#Preview("Look Away Reminder") { LookAwayReminderView(countdownSeconds: 20, onDismiss: {}) } diff --git a/Gaze/Views/Reminders/PostureReminderView.swift b/Gaze/Views/Reminders/PostureReminderView.swift index 2f956bc..cca2dfe 100644 --- a/Gaze/Views/Reminders/PostureReminderView.swift +++ b/Gaze/Views/Reminders/PostureReminderView.swift @@ -63,7 +63,7 @@ struct PostureReminderView: View { } } -#Preview { +#Preview("Posture Reminder") { PostureReminderView(onDismiss: {}) .frame(width: 800, height: 600) } diff --git a/run b/run index a49edd4..ac29b68 100755 --- a/run +++ b/run @@ -77,7 +77,18 @@ elif [ "$ACTION" = "run" ]; then if [ $? -eq 0 ]; then echo "✅ Build succeeded!" - run_with_output "open -a \"Gaze\"" + # Get the actual build output directory from xcodebuild + BUILD_DIR="$(xcodebuild -project Gaze.xcodeproj -scheme Gaze -configuration Debug -showBuildSettings 2>/dev/null | grep -m 1 "BUILT_PRODUCTS_DIR" | sed 's/.*= //')" + APP_PATH="${BUILD_DIR}/Gaze.app" + + if [ -d "$APP_PATH" ]; then + echo "🚀 Launching: $APP_PATH" + open "$APP_PATH" + else + echo "⚠️ App not found at expected location, trying fallback..." + # Fallback to derived data location + open "$HOME/Library/Developer/Xcode/DerivedData/Gaze-*/Build/Products/Debug/Gaze.app" + fi else echo "❌ Build failed!" exit 1