home: el selector de semana sale de la toolbar a su propia barra

En premium la barra de navegacion lleva cuatro botones a la izquierda y
mas a la derecha; el ToolbarItem(.principal) se comprimia y iOS
recortaba las flechas, dejando solo el titulo — por eso no aparecian en
el iPhone del usuario aunque en el simulador (modo free, dos botones) se
vieran bien. Ahora el selector es una barra propia bajo la navegacion:
flechas en circulo blanco con borde coral y el rango de semana con
chevron.down al centro. Verificado con captura forzando los botones
premium.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013H6bXqGX1ygwib1Dm3n3UG
This commit is contained in:
alexandrev-tibco
2026-09-10 20:53:12 +02:00
parent 3a4314d6ce
commit 4894c8b6eb
3 changed files with 70 additions and 62 deletions
+68 -60
View File
@@ -153,66 +153,6 @@ struct HomeView: View {
}
}
}
ToolbarItem(placement: .principal) {
// Bold circled arrows: the previous thin chevrons were so
// subtle that users couldn't find how to change week.
HStack(spacing: 8) {
if let settings = settings {
Button {
viewModel.goToPreviousWeek()
showWeekLimitUpsell = false
} label: {
Image(systemName: "chevron.left")
.font(.system(size: 13, weight: .bold))
.foregroundColor(.mealMoodCoral)
.frame(width: 30, height: 30)
.background(Circle().fill(Color.white.opacity(0.75)))
}
.buttonStyle(.plain)
.accessibilityLabel(Text("home_previous"))
Button {
weekPickerDate = viewModel.currentWeekStart
showWeekPicker = true
} label: {
HStack(spacing: 4) {
Text(viewModel.weekRangeText)
.font(.mealMoodH2)
.foregroundColor(.mealMoodTextPrimary)
.lineLimit(1)
.minimumScaleFactor(0.7)
Image(systemName: "chevron.down")
.font(.system(size: 10, weight: .bold))
.foregroundColor(.mealMoodTextSecondary)
}
}
.buttonStyle(.plain)
.accessibilityLabel(Text("home_select_week"))
Button {
if canNavigateToNextWeek(settings: settings) {
viewModel.goToNextWeek()
showWeekLimitUpsell = false
} else {
withAnimation(.easeInOut(duration: 0.2)) {
showWeekLimitUpsell = true
}
AnalyticsService.logWeekLimitHit()
paywallPresentation = PaywallPresentation(source: "week_limit")
HapticManager.shared.notification(type: .warning)
}
} label: {
Image(systemName: "chevron.right")
.font(.system(size: 13, weight: .bold))
.foregroundColor(.mealMoodCoral)
.frame(width: 30, height: 30)
.background(Circle().fill(Color.white.opacity(0.75)))
}
.buttonStyle(.plain)
.accessibilityLabel(Text("home_next"))
}
}
}
ToolbarItem(placement: .navigationBarTrailing) {
HStack(spacing: 10) {
if let settings = settings,
@@ -311,9 +251,77 @@ struct HomeView: View {
}
}
/// Week switcher. It used to live in the navigation bar's principal slot,
/// where a premium user's four leading buttons squeezed it until the arrows
/// were clipped away leaving no visible way to change week.
private func weekSwitcher(settings: AppSettings) -> some View {
HStack(spacing: 12) {
Button {
viewModel.goToPreviousWeek()
showWeekLimitUpsell = false
} label: {
Image(systemName: "chevron.left")
.font(.system(size: 15, weight: .bold))
.foregroundColor(.mealMoodCoral)
.frame(width: 36, height: 36)
.background(Circle().fill(Color.white))
.overlay(Circle().stroke(Color.mealMoodCoral.opacity(0.35), lineWidth: 1))
}
.buttonStyle(.plain)
.accessibilityLabel(Text("home_previous"))
Button {
weekPickerDate = viewModel.currentWeekStart
showWeekPicker = true
} label: {
HStack(spacing: 5) {
Text(viewModel.weekRangeText)
.font(.mealMoodH2)
.foregroundColor(.mealMoodTextPrimary)
.lineLimit(1)
.minimumScaleFactor(0.7)
Image(systemName: "chevron.down")
.font(.system(size: 11, weight: .bold))
.foregroundColor(.mealMoodTextSecondary)
}
.frame(maxWidth: .infinity)
}
.buttonStyle(.plain)
.accessibilityLabel(Text("home_select_week"))
Button {
if canNavigateToNextWeek(settings: settings) {
viewModel.goToNextWeek()
showWeekLimitUpsell = false
} else {
withAnimation(.easeInOut(duration: 0.2)) {
showWeekLimitUpsell = true
}
AnalyticsService.logWeekLimitHit()
paywallPresentation = PaywallPresentation(source: "week_limit")
HapticManager.shared.notification(type: .warning)
}
} label: {
Image(systemName: "chevron.right")
.font(.system(size: 15, weight: .bold))
.foregroundColor(.mealMoodCoral)
.frame(width: 36, height: 36)
.background(Circle().fill(Color.white))
.overlay(Circle().stroke(Color.mealMoodCoral.opacity(0.35), lineWidth: 1))
}
.buttonStyle(.plain)
.accessibilityLabel(Text("home_next"))
}
.padding(.horizontal, 16)
.padding(.top, 6)
.padding(.bottom, 10)
}
@ViewBuilder
private func mainContent(plan: WeekPlan, settings: AppSettings) -> some View {
VStack(spacing: 0) {
weekSwitcher(settings: settings)
if showWeekLimitUpsell && !settings.isPremium {
PremiumUpsellBanner(
messageKey: "premium_limit_future_weeks",
+1 -1
View File
@@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key>
<string>2.1.1</string>
<key>CFBundleVersion</key>
<string>84</string>
<string>85</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
+1 -1
View File
@@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key>
<string>2.1.1</string>
<key>CFBundleVersion</key>
<string>84</string>
<string>85</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>