feat(menu): display the next 7 days starting from today#1816
Merged
pedroafmonteiro merged 3 commits intodevelopfrom Apr 2, 2026
Merged
feat(menu): display the next 7 days starting from today#1816pedroafmonteiro merged 3 commits intodevelopfrom
pedroafmonteiro merged 3 commits intodevelopfrom
Conversation
Contributor
Author
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1816 +/- ##
=======================================
Coverage 7% 7%
=======================================
Files 38 38
Lines 1842 1842
=======================================
Hits 125 125
Misses 1717 1717 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the restaurant menu UI to show a rolling 7-day window starting from today (instead of the current calendar week), aligning with issue #1809.
Changes:
- Update the weekday tab bar to render the next 7 consecutive dates starting from today.
- Adjust the initial selected tab index to match the new “day offset from today” model (today vs. tomorrow).
- Update restaurant page logic to derive the selected day from
DateTime.now() + selectedTabIndex.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/uni_app/lib/view/restaurant/widgets/days_of_week_tab_bar.dart | Switch tab generation from “current week” to “today + next 6 days”. |
| packages/uni_app/lib/view/restaurant/tab_controller_provider.dart | Simplify initial tab selection for the new day-offset tab model. |
| packages/uni_app/lib/view/restaurant/restaurant_page_view.dart | Compute selected date/day from the new tab index semantics. |
Comments suppressed due to low confidence (1)
packages/uni_app/lib/view/restaurant/restaurant_page_view.dart:220
- The selected tab now represents a date offset (today + N), but the page still converts that date to
DayOfWeekand filters meals bymeal.dayOfWeek. This loses week/year context, so when the 7-day range crosses into next week (or if the backend starts returning multiple weeks), menus for e.g. next Monday will be mixed with/replace this week’s Monday. Use the actualselectedDate(year/month/day) to filter meals (e.g., comparemeal.datewithselectedDateby date-only), and consider adding agetMealsOfDate(DateTime)helper onRestaurantso both the restaurant filtering and menu item building use the same date-based selection.
final selectedDate = DateTime.now().add(Duration(days: selectedTabIndex));
final selectedDayOfWeek = parseDateTime(selectedDate);
final restaurantsWidgets =
restaurants
// Remove restaurants with no meals
.where((restaurant) {
return restaurant.meals.any(
(meal) => meal.dayOfWeek == selectedDayOfWeek,
);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.

Closes #1809
Review checklist
View Changes
Performance