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:
@@ -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) {
|
ToolbarItem(placement: .navigationBarTrailing) {
|
||||||
HStack(spacing: 10) {
|
HStack(spacing: 10) {
|
||||||
if let settings = settings,
|
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
|
@ViewBuilder
|
||||||
private func mainContent(plan: WeekPlan, settings: AppSettings) -> some View {
|
private func mainContent(plan: WeekPlan, settings: AppSettings) -> some View {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
|
weekSwitcher(settings: settings)
|
||||||
|
|
||||||
if showWeekLimitUpsell && !settings.isPremium {
|
if showWeekLimitUpsell && !settings.isPremium {
|
||||||
PremiumUpsellBanner(
|
PremiumUpsellBanner(
|
||||||
messageKey: "premium_limit_future_weeks",
|
messageKey: "premium_limit_future_weeks",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.1.1</string>
|
<string>2.1.1</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>84</string>
|
<string>85</string>
|
||||||
<key>NSExtension</key>
|
<key>NSExtension</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSExtensionPointIdentifier</key>
|
<key>NSExtensionPointIdentifier</key>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.1.1</string>
|
<string>2.1.1</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>84</string>
|
<string>85</string>
|
||||||
<key>NSExtension</key>
|
<key>NSExtension</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSExtensionPointIdentifier</key>
|
<key>NSExtensionPointIdentifier</key>
|
||||||
|
|||||||
Reference in New Issue
Block a user