c0b485387d
- Target MealMoodWatch (watchOS 10, SwiftUI): vista de hoy y de la semana en TabView vertical; recibe el snapshot del iPhone por WatchConnectivity (updateApplicationContext) y lo guarda en su app group para la complicacion - Target MealMoodWatchWidget: complicacion accessoryRectangular/ Circular/Inline con las comidas de hoy (heuristica comida/cena por hora); icono del watch generado desde el logo - WatchWeekPayload compartido entre iOS app, widget iOS, watch app y complicacion — llega ya localizado desde el iPhone - Widget iOS nuevo "Semana" (systemMedium/Large) con los 7 dias; el widget de hoy pasa a WidgetBundle - Targets creados via gema xcodeproj (sin abrir Xcode); embed del watch antes del script de Crashlytics para evitar ciclo de build Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013H6bXqGX1ygwib1Dm3n3UG
38 lines
1.5 KiB
Swift
38 lines
1.5 KiB
Swift
import SwiftUI
|
|
|
|
struct WeekView: View {
|
|
@EnvironmentObject private var store: WatchWeekStore
|
|
|
|
var body: some View {
|
|
Group {
|
|
if let payload = store.payload {
|
|
List {
|
|
Section(payload.weekTitle) {
|
|
ForEach(payload.days, id: \.dayOfWeek) { day in
|
|
VStack(alignment: .leading, spacing: 3) {
|
|
Text(day.title)
|
|
.font(.caption.weight(.semibold))
|
|
.foregroundStyle(day.isToday
|
|
? Color(red: 1.0, green: 0.45, blue: 0.35)
|
|
: .primary)
|
|
ForEach(Array(day.meals.enumerated()), id: \.offset) { _, meal in
|
|
HStack(spacing: 4) {
|
|
Image(systemName: WatchWeekPayload.icon(for: meal.type))
|
|
.font(.system(size: 10))
|
|
.foregroundStyle(.secondary)
|
|
Text(meal.name ?? "—")
|
|
.font(.caption2)
|
|
.lineLimit(1)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
EmptySyncView()
|
|
}
|
|
}
|
|
}
|
|
}
|