2.0: dictado de platos/ingredientes + calendario más alto en iPad/Mac
- Dictado por voz (Speech/SFSpeechRecognizer, on-device) en el nombre de plato y en ingredientes, con transcripción en vivo. - Un solo texto dictado se separa en ingredientes individuales vía Apple Foundation Models on-device (IngredientParser), con fallback heurístico. - Permisos de micrófono y reconocimiento de voz en Info.plist. - Cadenas de dictado en los 6 idiomas. - iPad/Mac: el calendario reclama ~50% de la altura disponible en lugar de quedar fijo a ~240px; iPhone (compact) sin cambios. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A3HaWmmtTQ1vdTERtSYU6p
This commit is contained in:
@@ -95,16 +95,16 @@ struct WeekCalendarView: View {
|
||||
let spacing: CGFloat = 10
|
||||
let rowLabelWidth: CGFloat = 86
|
||||
let headerHeight: CGFloat = 26
|
||||
let slotRowHeight: CGFloat = 96
|
||||
let verticalInset: CGFloat = 2
|
||||
let rowCount = CGFloat(max(mealTypes.count, 1))
|
||||
let interRowDividers = CGFloat(max(0, mealTypes.count - 1))
|
||||
let contentWidth = proxy.size.width - rowLabelWidth - (dayCount * spacing)
|
||||
let dayWidth = max(92, contentWidth / max(dayCount, 1))
|
||||
let totalHeight =
|
||||
(verticalInset * 2) +
|
||||
headerHeight +
|
||||
1 +
|
||||
(CGFloat(mealTypes.count) * slotRowHeight) +
|
||||
CGFloat(max(0, mealTypes.count - 1))
|
||||
// Distribute the available height across the meal rows so the calendar
|
||||
// grows to fill its container on iPad/Mac instead of staying tiny.
|
||||
let chromeHeight = (verticalInset * 2) + headerHeight + 1 + interRowDividers
|
||||
let availableForRows = proxy.size.height - chromeHeight
|
||||
let slotRowHeight = max(96, availableForRows / rowCount)
|
||||
|
||||
VStack(spacing: 0) {
|
||||
HStack(spacing: 0) {
|
||||
@@ -144,9 +144,8 @@ struct WeekCalendarView: View {
|
||||
}
|
||||
.padding(.horizontal, 16)
|
||||
.padding(.vertical, verticalInset)
|
||||
.frame(height: totalHeight, alignment: .top)
|
||||
.frame(height: proxy.size.height, alignment: .top)
|
||||
}
|
||||
.frame(height: CGFloat(mealTypes.count) * 98 + 44)
|
||||
}
|
||||
|
||||
private func calendarDivider(height: CGFloat? = nil) -> some View {
|
||||
|
||||
Reference in New Issue
Block a user