Fix widget layout clipping and add comprehensive widget previews
- Fix LargeVotingView mood icons getting clipped at edges by using flexible HStack spacing with maxWidth: .infinity - Fix VotingView medium layout with smaller icons and even distribution - Add comprehensive #Preview macros for all widget states: - Vote widget: small/medium, voted/not voted, all mood states - Timeline widget: small/medium/large with various data states - Reduce icon sizes and padding to fit within widget bounds - Update accessibility labels and hints across views 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,7 @@ struct OnboardingCustomizeOne: View {
|
||||
.foregroundColor(Color(UIColor.darkText))
|
||||
.opacity(0.04)
|
||||
.scaleEffect(1.2, anchor: .trailing)
|
||||
.accessibilityHidden(true)
|
||||
Spacer()
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ struct OnboardingCustomizeTwo: View {
|
||||
.foregroundColor(Color(UIColor.darkText))
|
||||
.opacity(0.04)
|
||||
.scaleEffect(1.2, anchor: .trailing)
|
||||
.accessibilityHidden(true)
|
||||
Spacer()
|
||||
}
|
||||
|
||||
|
||||
@@ -44,21 +44,21 @@ struct OnboardingDay: View {
|
||||
.frame(width: 120, height: 120)
|
||||
|
||||
Image(systemName: "calendar")
|
||||
.font(.system(size: 44))
|
||||
.font(.largeTitle)
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
.padding(.bottom, 32)
|
||||
|
||||
// Title
|
||||
Text("Which day should\nyou rate?")
|
||||
.font(.system(size: 28, weight: .bold, design: .rounded))
|
||||
.font(.title.weight(.bold))
|
||||
.foregroundColor(.white)
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.bottom, 12)
|
||||
|
||||
// Subtitle
|
||||
Text("When you get your reminder, do you want to rate today or yesterday?")
|
||||
.font(.system(size: 16, weight: .medium))
|
||||
.font(.body.weight(.medium))
|
||||
.foregroundColor(.white.opacity(0.85))
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.horizontal, 40)
|
||||
@@ -92,11 +92,11 @@ struct OnboardingDay: View {
|
||||
// Tip
|
||||
HStack(spacing: 12) {
|
||||
Image(systemName: "lightbulb.fill")
|
||||
.font(.system(size: 18))
|
||||
.font(.headline)
|
||||
.foregroundColor(.yellow)
|
||||
|
||||
Text("Tip: \"Yesterday\" works great for evening reminders")
|
||||
.font(.system(size: 14, weight: .medium))
|
||||
.font(.subheadline.weight(.medium))
|
||||
.foregroundColor(.white.opacity(0.9))
|
||||
}
|
||||
.padding(.horizontal, 30)
|
||||
@@ -124,7 +124,7 @@ struct DayOptionCard: View {
|
||||
.frame(width: 46, height: 46)
|
||||
|
||||
Image(systemName: icon)
|
||||
.font(.system(size: 20))
|
||||
.font(.title3)
|
||||
.foregroundColor(isSelected ? Color(hex: "4facfe") : .white)
|
||||
}
|
||||
.accessibilityHidden(true)
|
||||
@@ -132,15 +132,15 @@ struct DayOptionCard: View {
|
||||
// Text
|
||||
VStack(alignment: .leading, spacing: 3) {
|
||||
Text(title)
|
||||
.font(.system(size: 17, weight: .semibold))
|
||||
.font(.body.weight(.semibold))
|
||||
.foregroundColor(isSelected ? Color(hex: "4facfe") : .white)
|
||||
|
||||
Text(subtitle)
|
||||
.font(.system(size: 13))
|
||||
.font(.caption)
|
||||
.foregroundColor(isSelected ? Color(hex: "4facfe").opacity(0.8) : .white.opacity(0.8))
|
||||
|
||||
Text(example)
|
||||
.font(.system(size: 11, weight: .medium))
|
||||
.font(.caption2.weight(.medium))
|
||||
.foregroundColor(isSelected ? Color(hex: "4facfe").opacity(0.6) : .white.opacity(0.6))
|
||||
.lineLimit(1)
|
||||
.minimumScaleFactor(0.8)
|
||||
@@ -151,7 +151,7 @@ struct DayOptionCard: View {
|
||||
// Checkmark
|
||||
if isSelected {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.font(.system(size: 22))
|
||||
.font(.title3)
|
||||
.foregroundColor(Color(hex: "4facfe"))
|
||||
.accessibilityHidden(true)
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ struct OnboardingStyle: View {
|
||||
.frame(width: 100, height: 100)
|
||||
|
||||
Image(systemName: "paintpalette.fill")
|
||||
.font(.system(size: 40))
|
||||
.font(.largeTitle)
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
.padding(.top, 40)
|
||||
@@ -39,13 +39,13 @@ struct OnboardingStyle: View {
|
||||
|
||||
// Title
|
||||
Text("Make it yours")
|
||||
.font(.system(size: 28, weight: .bold, design: .rounded))
|
||||
.font(.title.weight(.bold))
|
||||
.foregroundColor(.white)
|
||||
.padding(.bottom, 8)
|
||||
|
||||
// Subtitle
|
||||
Text("Choose your favorite style")
|
||||
.font(.system(size: 16, weight: .medium))
|
||||
.font(.body.weight(.medium))
|
||||
.foregroundColor(.white.opacity(0.85))
|
||||
.padding(.bottom, 20)
|
||||
|
||||
@@ -57,7 +57,7 @@ struct OnboardingStyle: View {
|
||||
// Icon Style Section
|
||||
VStack(alignment: .leading, spacing: 10) {
|
||||
Text("Icon Style")
|
||||
.font(.system(size: 14, weight: .semibold))
|
||||
.font(.subheadline.weight(.semibold))
|
||||
.foregroundColor(.white.opacity(0.9))
|
||||
.padding(.horizontal, 24)
|
||||
|
||||
@@ -82,7 +82,7 @@ struct OnboardingStyle: View {
|
||||
// Color Theme Section
|
||||
VStack(alignment: .leading, spacing: 10) {
|
||||
Text("Mood Colors")
|
||||
.font(.system(size: 14, weight: .semibold))
|
||||
.font(.subheadline.weight(.semibold))
|
||||
.foregroundColor(.white.opacity(0.9))
|
||||
.padding(.horizontal, 24)
|
||||
|
||||
@@ -105,9 +105,9 @@ struct OnboardingStyle: View {
|
||||
// Hint
|
||||
HStack(spacing: 8) {
|
||||
Image(systemName: "arrow.left.arrow.right")
|
||||
.font(.system(size: 14))
|
||||
.font(.subheadline)
|
||||
Text("You can change these anytime in Customize")
|
||||
.font(.system(size: 13, weight: .medium))
|
||||
.font(.caption.weight(.medium))
|
||||
}
|
||||
.foregroundColor(.white.opacity(0.7))
|
||||
.padding(.top, 20)
|
||||
@@ -130,14 +130,15 @@ struct OnboardingStylePreview: View {
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 44, height: 44)
|
||||
.foregroundColor(moodTint.color(forMood: .good))
|
||||
.accessibilityLabel(Mood.good.strValue)
|
||||
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text("Wednesday - 10th")
|
||||
.font(.system(size: 17, weight: .semibold))
|
||||
.font(.body.weight(.semibold))
|
||||
.foregroundColor(.white)
|
||||
|
||||
Text(Mood.good.strValue)
|
||||
.font(.system(size: 14))
|
||||
.font(.subheadline)
|
||||
.foregroundColor(.white.opacity(0.8))
|
||||
}
|
||||
|
||||
@@ -167,6 +168,7 @@ struct OnboardingIconPackOption: View {
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 24, height: 24)
|
||||
.foregroundColor(moodTint.color(forMood: mood))
|
||||
.accessibilityLabel(mood.strValue)
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 16)
|
||||
|
||||
@@ -34,14 +34,14 @@ struct OnboardingSubscription: View {
|
||||
.frame(width: 120, height: 120)
|
||||
|
||||
Image(systemName: "crown.fill")
|
||||
.font(.system(size: 48))
|
||||
.font(.largeTitle)
|
||||
.foregroundColor(.yellow)
|
||||
}
|
||||
.padding(.bottom, 24)
|
||||
|
||||
// Title
|
||||
Text("Unlock the Full\nExperience")
|
||||
.font(.system(size: 28, weight: .bold, design: .rounded))
|
||||
.font(.title.weight(.bold))
|
||||
.foregroundColor(.white)
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.bottom, 8)
|
||||
@@ -101,10 +101,10 @@ struct OnboardingSubscription: View {
|
||||
}) {
|
||||
HStack {
|
||||
Image(systemName: "sparkles")
|
||||
.font(.system(size: 18, weight: .semibold))
|
||||
.font(.headline.weight(.semibold))
|
||||
|
||||
Text("Get Personal Insights")
|
||||
.font(.system(size: 18, weight: .bold))
|
||||
.font(.headline.weight(.bold))
|
||||
}
|
||||
.foregroundColor(Color(hex: "11998e"))
|
||||
.frame(maxWidth: .infinity)
|
||||
@@ -125,7 +125,7 @@ struct OnboardingSubscription: View {
|
||||
completionClosure(onboardingData)
|
||||
}) {
|
||||
Text("Maybe Later")
|
||||
.font(.system(size: 16, weight: .medium))
|
||||
.font(.body.weight(.medium))
|
||||
.foregroundColor(.white.opacity(0.8))
|
||||
}
|
||||
.accessibilityLabel(String(localized: "Maybe Later"))
|
||||
@@ -154,18 +154,18 @@ struct BenefitRow: View {
|
||||
var body: some View {
|
||||
HStack(spacing: 16) {
|
||||
Image(systemName: icon)
|
||||
.font(.system(size: 22))
|
||||
.font(.title3)
|
||||
.foregroundColor(.white)
|
||||
.frame(width: 40)
|
||||
.accessibilityHidden(true)
|
||||
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text(title)
|
||||
.font(.system(size: 16, weight: .semibold))
|
||||
.font(.body.weight(.semibold))
|
||||
.foregroundColor(.white)
|
||||
|
||||
Text(description)
|
||||
.font(.system(size: 13))
|
||||
.font(.caption)
|
||||
.foregroundColor(.white.opacity(0.8))
|
||||
}
|
||||
|
||||
|
||||
@@ -36,21 +36,21 @@ struct OnboardingTime: View {
|
||||
.frame(width: 120, height: 120)
|
||||
|
||||
Image(systemName: "bell.fill")
|
||||
.font(.system(size: 44))
|
||||
.font(.largeTitle)
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
.padding(.bottom, 32)
|
||||
|
||||
// Title
|
||||
Text("When should we\nremind you?")
|
||||
.font(.system(size: 28, weight: .bold, design: .rounded))
|
||||
.font(.title.weight(.bold))
|
||||
.foregroundColor(.white)
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.bottom, 12)
|
||||
|
||||
// Subtitle
|
||||
Text("Pick a time that works for your daily check-in")
|
||||
.font(.system(size: 16, weight: .medium))
|
||||
.font(.body.weight(.medium))
|
||||
.foregroundColor(.white.opacity(0.85))
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.horizontal, 40)
|
||||
@@ -80,12 +80,12 @@ struct OnboardingTime: View {
|
||||
// Info text
|
||||
HStack(spacing: 12) {
|
||||
Image(systemName: "info.circle.fill")
|
||||
.font(.system(size: 20))
|
||||
.font(.title3)
|
||||
.foregroundColor(.white.opacity(0.8))
|
||||
.accessibilityHidden(true)
|
||||
|
||||
Text("You'll get a gentle reminder at \(formatter.string(from: onboardingData.date)) every day")
|
||||
.font(.system(size: 14, weight: .medium))
|
||||
.font(.subheadline.weight(.medium))
|
||||
.foregroundColor(.white.opacity(0.9))
|
||||
}
|
||||
.padding(.horizontal, 30)
|
||||
|
||||
@@ -23,6 +23,7 @@ struct OnboardingTitle: View {
|
||||
.opacity(0.04)
|
||||
.scaleEffect(1.2)
|
||||
.padding(.bottom, 55)
|
||||
.accessibilityHidden(true)
|
||||
|
||||
ScrollView {
|
||||
VStack{
|
||||
@@ -37,8 +38,7 @@ struct OnboardingTitle: View {
|
||||
// onboardingData.title = option
|
||||
}, label: {
|
||||
Text(option)
|
||||
.font(.system(size: 15))
|
||||
.fontWeight(.bold)
|
||||
.font(.subheadline.weight(.bold))
|
||||
.foregroundColor(.white)
|
||||
.padding(10)
|
||||
.background(RoundedRectangle(cornerRadius: 10).stroke().foregroundColor(Color.white))
|
||||
|
||||
@@ -32,20 +32,20 @@ struct OnboardingWelcome: View {
|
||||
.frame(width: 120, height: 120)
|
||||
|
||||
Image(systemName: "heart.fill")
|
||||
.font(.system(size: 50))
|
||||
.font(.largeTitle)
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
.padding(.bottom, 40)
|
||||
|
||||
// Title
|
||||
Text("Welcome to Feels")
|
||||
.font(.system(size: 34, weight: .bold, design: .rounded))
|
||||
.font(.largeTitle.weight(.bold))
|
||||
.foregroundColor(.white)
|
||||
.padding(.bottom, 12)
|
||||
|
||||
// Subtitle
|
||||
Text("Track your mood, discover patterns,\nand understand yourself better.")
|
||||
.font(.system(size: 18, weight: .medium))
|
||||
.font(.headline.weight(.medium))
|
||||
.foregroundColor(.white.opacity(0.9))
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.horizontal, 40)
|
||||
@@ -91,18 +91,18 @@ struct FeatureRow: View {
|
||||
.frame(width: 50, height: 50)
|
||||
|
||||
Image(systemName: icon)
|
||||
.font(.system(size: 22))
|
||||
.font(.title3)
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
.accessibilityHidden(true)
|
||||
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text(title)
|
||||
.font(.system(size: 16, weight: .semibold))
|
||||
.font(.body.weight(.semibold))
|
||||
.foregroundColor(.white)
|
||||
|
||||
Text(description)
|
||||
.font(.system(size: 14))
|
||||
.font(.subheadline)
|
||||
.foregroundColor(.white.opacity(0.8))
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ struct OnboardingWrapup: View {
|
||||
.foregroundColor(Color(UIColor.darkText))
|
||||
.opacity(0.04)
|
||||
.scaleEffect(1.2, anchor: .trailing)
|
||||
.accessibilityHidden(true)
|
||||
Spacer()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user