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:
Trey t
2025-12-24 09:53:40 -06:00
parent 5f7d909d62
commit be84825aba
33 changed files with 10467 additions and 9725 deletions

View File

@@ -28,7 +28,7 @@ struct SettingsTabView: View {
VStack(spacing: 0) {
// Header
Text("Settings")
.font(.system(size: 28, weight: .bold, design: .rounded))
.font(.title.weight(.bold))
.foregroundColor(textColor)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.horizontal, 16)
@@ -92,14 +92,14 @@ struct UpgradeBannerView: View {
// Countdown timer
HStack(spacing: 6) {
Image(systemName: "clock")
.font(.system(size: 14, weight: .medium))
.font(.subheadline.weight(.medium))
.foregroundColor(.orange)
if let expirationDate = trialExpirationDate {
Text("\(Text("Trial expires in ").font(.system(size: 14, weight: .medium)).foregroundColor(textColor.opacity(0.8)))\(Text(expirationDate, style: .relative).font(.system(size: 14, weight: .bold)).foregroundColor(.orange))")
Text("\(Text("Trial expires in ").font(.subheadline.weight(.medium)).foregroundColor(textColor.opacity(0.8)))\(Text(expirationDate, style: .relative).font(.subheadline.weight(.bold)).foregroundColor(.orange))")
} else {
Text("Trial expired")
.font(.system(size: 14, weight: .medium))
.font(.subheadline.weight(.medium))
.foregroundColor(.orange)
}
}
@@ -111,7 +111,7 @@ struct UpgradeBannerView: View {
showWhyUpgrade = true
} label: {
Text("Why Upgrade?")
.font(.system(size: 14, weight: .semibold))
.font(.subheadline.weight(.semibold))
.foregroundColor(.accentColor)
.frame(maxWidth: .infinity)
.padding(.vertical, 10)
@@ -126,7 +126,7 @@ struct UpgradeBannerView: View {
showSubscriptionStore = true
} label: {
Text("Subscribe")
.font(.system(size: 14, weight: .semibold))
.font(.subheadline.weight(.semibold))
.foregroundColor(.white)
.frame(maxWidth: .infinity)
.padding(.vertical, 10)
@@ -157,7 +157,7 @@ struct WhyUpgradeView: View {
// Header
VStack(spacing: 12) {
Image(systemName: "star.fill")
.font(.system(size: 50))
.font(.largeTitle)
.foregroundStyle(
LinearGradient(
colors: [.orange, .pink],
@@ -167,7 +167,7 @@ struct WhyUpgradeView: View {
)
Text("Unlock Premium")
.font(.system(size: 28, weight: .bold))
.font(.title.weight(.bold))
Text("Get the most out of your mood tracking journey")
.font(.body)
@@ -262,7 +262,7 @@ struct PremiumBenefitRow: View {
var body: some View {
HStack(alignment: .top, spacing: 14) {
Image(systemName: icon)
.font(.system(size: 22))
.font(.title3)
.foregroundColor(iconColor)
.frame(width: 44, height: 44)
.background(
@@ -272,10 +272,10 @@ struct PremiumBenefitRow: View {
VStack(alignment: .leading, spacing: 4) {
Text(title)
.font(.system(size: 16, weight: .semibold))
.font(.body.weight(.semibold))
Text(description)
.font(.system(size: 14))
.font(.subheadline)
.foregroundColor(.secondary)
}