Skip to content

feat(meal): meal plan dashboard page with calendar-aware timing#20

Open
the-mrinal wants to merge 1 commit into
mainfrom
feat/meal-plan-screen
Open

feat(meal): meal plan dashboard page with calendar-aware timing#20
the-mrinal wants to merge 1 commit into
mainfrom
feat/meal-plan-screen

Conversation

@the-mrinal

Copy link
Copy Markdown
Owner

Summary

  • Adds a fifth dashboard tab (Meals) that fetches a JSON meal plan from a user-configured URL and displays today's plan on a cream-paper layout.
  • Picks the day's "Up next" meal by cross-referencing the calendar event timeline, with countdown updates ("in 1h 23m") and a "happening now" state.
  • Page lives in its own visual world: hides the global Unsplash wallpaper + credit while active, and ships its own Fraunces/Newsreader typography.

What's in the box

  • New screen + binder (MealScreenBinder, screen_meal.xml, item_meal_row.xml, item_meal_prep.xml).
  • Plan pipeline: MealPlanFetcherMealPlanParserMealPlanRepositoryMealPlanCenterMealPlanPoller, with stale-cache banner + parse-error empty state.
  • MealEventTimeline picks the active/next meal based on calendar events (unit-tested in MealEventTimelineTest).
  • Settings entry: Meal plan → Meal plan JSON URL (leave blank to hide the tab); editing the URL re-publishes immediately.
  • D-pad up/down scrolls the meal list, matching the calendar page UX.
  • usesCleartextTraffic=true added to manifest so HTTP-hosted plans work alongside HTTPS.

Test plan

  • Open Settings → Meal plan, paste a meal-plan.json URL, return to dashboard — Meals tab populates.
  • Clear the URL — Meals tab shows the empty-state pointing back to settings.
  • Point the URL at unreachable host — fetch-error state appears; recovers after URL fix.
  • Point at malformed JSON — parse-error state appears.
  • Have a calendar event scheduled, verify "Up next" countdown updates and flips to "happening now".
  • Navigate to Meals page — Unsplash wallpaper + credit hidden; navigate away — they restore.
  • D-pad up/down scrolls the meal list on the Meals page.
  • ./gradlew testMealEventTimelineTest passes.

🤖 Generated with Claude Code

Adds a fifth dashboard tab that fetches a JSON meal plan from a configurable
URL, picks the day's "Up next" entry based on calendar events, and renders it
on a cream-paper layout with its own Fraunces/Newsreader typography. Hides
the global Unsplash wallpaper + credit when active so the page reads as its
own world.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant