fix: run fixed, click action fixed

This commit is contained in:
Michael Freno
2026-01-08 12:23:19 -05:00
parent c417398116
commit 6c6e1679a9
14 changed files with 68 additions and 23 deletions

View File

@@ -19,6 +19,6 @@ struct ContentView: View {
} }
} }
#Preview { #Preview("Content View") {
ContentView() ContentView()
} }

View File

@@ -104,7 +104,7 @@ struct Arc: Shape {
} }
} }
#Preview { #Preview("Animated Face") {
AnimatedFaceView(size: 200) AnimatedFaceView(size: 200)
.frame(width: 400, height: 400) .frame(width: 400, height: 400)
} }

View File

@@ -215,7 +215,7 @@ struct TimerStatusRow: View {
} }
} }
#Preview { #Preview("Menu Bar Content") {
let settingsManager = SettingsManager.shared let settingsManager = SettingsManager.shared
let timerEngine = TimerEngine(settingsManager: settingsManager) let timerEngine = TimerEngine(settingsManager: settingsManager)
MenuBarContentView( MenuBarContentView(

View File

@@ -48,7 +48,7 @@ struct BlinkSetupView: View {
} }
} }
.padding() .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") 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( BlinkSetupView(
enabled: .constant(true), enabled: .constant(true),
intervalMinutes: .constant(5) intervalMinutes: .constant(5)
) )
} }
#Preview("Blink Setup - Disabled") {
BlinkSetupView(
enabled: .constant(false),
intervalMinutes: .constant(5)
)
}

View File

@@ -58,7 +58,7 @@ struct CompletionView: View {
.padding(.horizontal) .padding(.horizontal)
} }
.padding() .padding()
.glassEffect(in: .rect(cornerRadius: 12)) .glassEffect(.regular, in: .rect(cornerRadius: 12))
Spacer() Spacer()
} }
@@ -68,6 +68,6 @@ struct CompletionView: View {
} }
} }
#Preview { #Preview("Completion View") {
CompletionView() CompletionView()
} }

View File

@@ -64,7 +64,7 @@ struct LookAwaySetupView: View {
} }
} }
.padding() .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") 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( LookAwaySetupView(
enabled: .constant(true), enabled: .constant(true),
intervalMinutes: .constant(20), intervalMinutes: .constant(20),
countdownSeconds: .constant(20) countdownSeconds: .constant(20)
) )
} }
#Preview("Info Box") {
InfoBox(text: "This is an informational message that provides helpful context to the user.")
.padding()
}

View File

@@ -104,7 +104,7 @@ struct OnboardingContainerView: View {
) )
.foregroundColor(.white) .foregroundColor(.white)
} }
.glassEffect(.regular.interactive()) .glassEffect(.regular.interactive(), in: .rect(cornerRadius: 10))
} }
Button(action: { Button(action: {
@@ -126,7 +126,7 @@ struct OnboardingContainerView: View {
) )
.foregroundColor(.white) .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(.horizontal, 40)
.padding(.bottom, 20) .padding(.bottom, 20)
@@ -230,6 +230,6 @@ struct OnboardingContainerView: View {
}) })
} }
} }
#Preview { #Preview("Onboarding Container") {
OnboardingContainerView(s) OnboardingContainerView(settingsManager: SettingsManager.shared)
} }

View File

@@ -48,7 +48,7 @@ struct PostureSetupView: View {
} }
} }
.padding() .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") 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( PostureSetupView(
enabled: .constant(true), enabled: .constant(true),
intervalMinutes: .constant(30) intervalMinutes: .constant(30)
) )
} }
#Preview("Posture Setup - Disabled") {
PostureSetupView(
enabled: .constant(false),
intervalMinutes: .constant(30)
)
}

View File

@@ -45,7 +45,7 @@ struct SettingsOnboardingView: View {
} }
} }
.padding() .padding()
.glassEffect(in: .rect(cornerRadius: 12)) .glassEffect(.regular, in: .rect(cornerRadius: 12))
// Links Section // Links Section
VStack(spacing: 12) { VStack(spacing: 12) {
@@ -133,8 +133,14 @@ struct SettingsOnboardingView: View {
} }
} }
#Preview { #Preview("Settings Onboarding - Launch Disabled") {
SettingsOnboardingView( SettingsOnboardingView(
launchAtLogin: .constant(false) launchAtLogin: .constant(false)
) )
} }
#Preview("Settings Onboarding - Launch Enabled") {
SettingsOnboardingView(
launchAtLogin: .constant(true)
)
}

View File

@@ -29,7 +29,7 @@ struct WelcomeView: View {
FeatureRow(icon: "figure.stand", title: "Maintain Good Posture", description: "Gentle reminders to sit up straight") FeatureRow(icon: "figure.stand", title: "Maintain Good Posture", description: "Gentle reminders to sit up straight")
} }
.padding() .padding()
.glassEffect(in: .rect(cornerRadius: 16)) .glassEffect(.regular, in: .rect(cornerRadius: 12))
Spacer() Spacer()
} }
@@ -62,6 +62,15 @@ struct FeatureRow: View {
} }
} }
#Preview { #Preview("Welcome View") {
WelcomeView() WelcomeView()
} }
#Preview("Feature Row") {
FeatureRow(
icon: "eye.circle",
title: "Reduce Eye Strain",
description: "Regular breaks help prevent digital eye strain"
)
.padding()
}

View File

@@ -135,7 +135,7 @@ struct BlinkingFace: View {
} }
} }
#Preview { #Preview("Blink Reminder") {
BlinkReminderView(onDismiss: {}) BlinkReminderView(onDismiss: {})
.frame(width: 800, height: 600) .frame(width: 800, height: 600)
} }

View File

@@ -113,6 +113,6 @@ struct LookAwayReminderView: View {
} }
} }
#Preview { #Preview("Look Away Reminder") {
LookAwayReminderView(countdownSeconds: 20, onDismiss: {}) LookAwayReminderView(countdownSeconds: 20, onDismiss: {})
} }

View File

@@ -63,7 +63,7 @@ struct PostureReminderView: View {
} }
} }
#Preview { #Preview("Posture Reminder") {
PostureReminderView(onDismiss: {}) PostureReminderView(onDismiss: {})
.frame(width: 800, height: 600) .frame(width: 800, height: 600)
} }

13
run
View File

@@ -77,7 +77,18 @@ elif [ "$ACTION" = "run" ]; then
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "✅ Build succeeded!" 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 else
echo "❌ Build failed!" echo "❌ Build failed!"
exit 1 exit 1