Skip to content

web: browse upcoming days' menus (foodpro date window) #72

Closed

Description

@TSVRN9

What to build

The menu API supports future dates and the official app exposes them; UDine only ever shows today. Documented + live-verified 2026-08-19 (see docs/apk-reverse-engineering.md, "Future dates" bullet): same foodpro-menu-ajax endpoint, date=MM/DD/YYYY, rolling window of today through roughly +13 days; past dates and beyond-window dates return [] (HTTP 200). @udine/shared's fetchMenu(hallTid, date) and the web /api/menu?tid&date=YYYY-MM-DD proxy already accept arbitrary dates — this is UI + loader wiring, not a new client.

Scope (web + shared only — mobile date nav is deferred until #65's restyle lands, note it on the epic when closing):

  • web/src/routes/halls/[slug]: date navigation — prev/next-day controls + a "Today" reset, date carried as ?date=YYYY-MM-DD URL state (shareable, back-button friendly, SSR-consistent). Show the browsed date clearly (the page already renders data.date).
  • Bounds: no past days (API has no history — disable/hide prev at today); forward navigation allowed past the data window, but an out-of-window day renders a proper empty state ("Menu not posted yet — UMass publishes about two weeks ahead"), NOT the generic no-menu-today copy and NOT an error page.
  • Logging from a future day's menu stays exactly as-is: entries record at loggedAt = now. No future-dated logging in v1 (decided — planning is browsing, not logging).
  • If any date math helper is needed beyond one-liners, put it in @udine/shared with red-first unit tests.

Constraints (standing policy)

  • Red-green TDD: every new spec red-first with pasted failure lines; existing halls-menu.spec.ts / vertical-slice.spec.ts must stay green unweakened — if modified, fresh red evidence per change. Mock /api/menu per-date in e2e (distinct payloads for today vs tomorrow proves the wiring; an []-shaped… note: the web proxy returns a parsed items array, so mock [] items for out-of-window).
  • Tokens/components only; PORT-isolated Playwright; anonymous-first (zero auth, zero Supabase).
  • Do not touch / (home) — PR web IA: Today-first home #69 (web IA: Today-first home #64) may land concurrently; if it merges first, rebase over it.

Acceptance criteria

  • Tomorrow's real menu browsable on the dev server (live verification against the real API, not just mocks)
  • Prev disabled at today; out-of-window day shows the publish-window empty state (e2e, red-first)
  • URL state round-trips (deep-link to ?date=… renders that day; e2e)
  • Log flow from a future menu records at now (spec proves it)
  • Full suite green, check clean, build clean, CI green

Activity

  1. TSVRN9 commented on Aug 19, 2026

    @TSVRN9
    OwnerAuthor

    PR: #76 (branch `feat/upcoming-menus`, not merged — left for review).

    Implemented prev/today/next date navigation on `/halls/[slug]`, carried as `?date=YYYY-MM-DD`. Prev disabled at today; Next never capped (window rolls, not hardcoded — a future day with nothing back just gets the distinct "not posted yet" empty state). Logging unchanged (`loggedAt = now` regardless of browsed date).

    Full per-criterion evidence, red/green log, and live-API verification output are in the PR description. Short version:

    • Red-first: reverted only the 3 impl files and reran `halls-menu.spec.ts` — exactly the 4 new tests failed, the 6 pre-existing ones stayed green.
    • Full suite green after re-applying (46/46), `check` clean, `build` clean.
    • Live-verified against the real API on `vite dev`: `?date=2026-08-20` (real tomorrow) rendered 3 real category cards with prev enabled; `?date=2026-09-08` (+20 days) rendered the publish-window empty state; today rendered prev `disabled`.
    • The "deep-link renders that day" AC is satisfied via that live verification rather than a Playwright mock — SvelteKit inlines the `load` fetch server-side during SSR, invisible to `page.route()`, so a literal `page.goto('?date=...')` can't be mocked (confirmed empirically). The e2e suite instead proves the URL-state/back-button contract via client-side nav + `goBack()`/`goForward()` across two consecutive day-hops.

    Mobile date nav is deferred to #65 as noted in the issue's scope — flagging here for the epic too.

  2. added a commit that references this issue on Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions