Back to Blocks
TimeSlider
Claude Terminal
Loading...
PXL-864Done
Urgent
📅 Show meal timing editor on all days
Estimate3 points
b2-heraui/ux
You can see and adjust your meal schedule on any day, not just today. This makes it easy to plan meals for tomorrow or review how you ate yesterday.
> Technical Details
The meal timing feature consists of these key files:
Core Files
- ●
MealTimingSummaryCell.swift(NutriKit/Refactor Inbox/UIKit/) - UIKit table view cell that hosts the SwiftUI timing view - ●
MealTimingSummaryView.swift(NutriKit/Refactor Inbox/Views/Components/) - SwiftUI view showing the "NOW" header and timeline - ●
TimeSlider.swift(Packages/UI/Sources/UI/Components/Views/) - The actual timeline slider component withliveModetoggle - ●
MealTimeSlotsStore.swift(NutriKit/Refactor Inbox/Views/Components/) - Observable store managing time slot state - ●
DayViewController.swift(NutriKit/Refactor Inbox/UIKit/) - ContainsshouldShowTimingSummarylogic that restricts to today only
Key Gating Logic (lines 82-101 in DayViewController.swift)
private var shouldShowTimingSummary: Bool {
let currentDate = Date()
let calendar = Calendar.current
let isPageToday = calendar.isDate(date, inSameDayAs: currentDate)
// Wee hours handling (12 AM - 5:59 AM)
let hour = calendar.component(.hour, from: currentDate)
let isWeeHours = hour >= 0 && hour < 6
if isWeeHours {
let yesterday = calendar.date(byAdding: .day, value: -1, to: currentDate)!
let isPageYesterday = calendar.isDate(date, inSameDayAs: yesterday)
return isPageToday || isPageYesterday
}
return isPageToday
}
TimeSlider liveMode Property
The TimeSlider component already supports two modes:
- ●
liveMode: true- Shows live updating time with "NOW" indicator (current behavior for today) - ●
liveMode: false- Interactive mode without live time updates (used in meal editing)
MealTimingSummaryView Header (lines 72-98)
Currently always shows "Now" text when not dragging:
if isDragging {
Text(L10n.MealTiming.createNewMealAt)
} else {
Text(L10n.MealTiming.now) // "Now" - needs to be conditional
}
- ●Modify
shouldShowTimingSummaryto always returntrue(or refactor to always show timing cell) - ●Add
isTodayparameter toMealTimingSummaryViewto:- ●Conditionally hide the "Now" header text on non-current days
- ●Pass
liveMode: isTodaytoTimeSlider - ●Show a different header label like "Meal Timeline" for historical/future days
- ●Update
configureTimingSummaryCellto pass the date context so the view knows whether to show live mode - ●Ensure drag-to-create works - The existing
onCreateMealcallback andTimeSliderdrag logic should work unchanged - ●Handle edge cases:
- ●During "wee hours" (12 AM - 5:59 AM), the cell shows on both yesterday and today with appropriate modes
- ●Future days should clearly indicate they're for planning
- ●Display the meal timing cell at the bottom of the day view for ALL days (past, present, and future)
- ●For non-current days: do NOT show the "NOW" time indicator (since "now" only applies to today)
- ●Display the meal spread visualization showing existing meals for that day
- ●Enable drag-to-create functionality so users can create new meals by dragging on the timeline
- ●Ensure the UI clearly indicates this is the meal timing interface without the "now" indicator causing confusion
- ●The cell should be visually consistent with the current day's version, but adapted to show historical/future context
- ●Allows users to plan future meals by visualizing and creating meal entries in advance
- ●Enables reviewing and editing past meal timing patterns
- ●Provides consistent UI/UX across all days in the app
- ● Meal timing cell appears on ALL day views (past, present, future)
- ● "Now" indicator and live time ONLY shows when viewing today
- ● Non-today days show a static header (e.g., "Meal Timeline" or date)
- ● Drag-to-create meal works on all days
- ● Existing meals display correctly on the timeline for all days
- ● Wee hours edge case: Yesterday's cell shows meal timeline (not "Now"), today's shows "Now"
- ● No regressions to current today functionality
Build instruction: Use -destination 'platform=iOS Simulator,name=iPhone 17 Pro' when building this project
Created Jan 6, 2026, 12:30 PM | Updated Jan 30, 2026, 12:31 PM