Repository navigation
Fix hall swipe jump and add closed-day empty state on Home - #43
Open
aleczzhang wants to merge 4 commits into
Open
aleczzhang wants to merge 4 commits into
aleczzhang wants to merge 4 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.selectedHallIdnow reconciles the meal in the same mutation, so the empty frame never renders.Blank menu on closed days
HomeMenuStatedecides 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").MenuEmptyStateViewwith a "Check dining hours" link and one quick action ("See 251 North", "Show Dinner" or "Back to Today").closedReasonparameter is the hook for live hours (feature/live-hours) to supply text like "Closed for fall break".Notes
feature/live-hours;HomeView.swiftchanges don't conflict.Testing
HomeMenuStateTests, plus aHomeViewModelTestsregression that fails without the swipe fix); full app suite passed (31 tests).