Skip to content

Fix hall swipe jump and add closed-day empty state on Home - #43

Open
aleczzhang wants to merge 4 commits into
mainfrom
fix/empty-state-swipe-dining-hall-jump
Open

aleczzhang wants to merge 4 commits into
mainfrom
fix/empty-state-swipe-dining-hall-jump

Conversation

@aleczzhang

@aleczzhang aleczzhang commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes two Home bugs.

Jumpy swipe between Yahentamitsi and 251 North
Root cause: when the selected meal (e.g. Dinner) didn't exist at the hall you swiped to (e.g. a Brunch-only day), the meal was only corrected later inside the async loadMenus(). For one frame the menu was empty, and an empty menu swapped out the whole scroll view, including the paged hall card, so it was rebuilt without animation. South Campus ↔ 251 North never jumped because both serve dinner.

  • selectedHallId now reconciles the meal in the same mutation, so the empty frame never renders.
  • The scroll view and hall card stay mounted in every state; only the area below the card switches between loading, error, empty and menu.
  • The meal-tab row keeps its height when a hall has no tabs.
  • The feed scrolls to the top only on meal-tab taps, not when a swipe changes the meal.

Blank menu on closed days

  • New HomeMenuState decides between loading, error, menu and three empty cases: hall not serving ("Yahentamitsi isn't serving today"), no menus posted, or meal not served ("No lunch today · Dinner starts at 4 PM").
  • Never shows "closed" while a fetch is in flight or before the first load; with filters on it doesn't claim the hall is closed.
  • New MenuEmptyStateView with a "Check dining hours" link and one quick action ("See 251 North", "Show Dinner" or "Back to Today").
  • closedReason parameter is the hook for live hours (feature/live-hours) to supply text like "Closed for fall break".

Notes

  • The hall card's "OPEN NOW" badge and "Dinner starts at…" times still use the hardcoded schedule until live hours is wired in after both PRs merge.
  • Merge after feature/live-hours; HomeView.swift changes don't conflict.

Testing

  • 18 new tests (HomeMenuStateTests, plus a HomeViewModelTests regression that fails without the swipe fix); full app suite passed (31 tests).
  • The swipe smoothness itself was verified by code reasoning, not by touch on a device — worth a quick swipe check.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 14:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Also restore scroll-to-top on date change, drop the Back to Today
action, share schedule window selection, build feed rows once per
render and back the filter badge with the view model.
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.

2 participants