Skip to content

feat(menu): display the next 7 days starting from today#1816

Merged
pedroafmonteiro merged 3 commits intodevelopfrom
feat/next_weeks_menu
Apr 2, 2026
Merged

feat(menu): display the next 7 days starting from today#1816
pedroafmonteiro merged 3 commits intodevelopfrom
feat/next_weeks_menu

Conversation

@SIMAOMARTA
Copy link
Copy Markdown
Contributor

Closes #1809

Review checklist

  • Terms and conditions reflect the changes

View Changes

  • Description has screenshots of the UI changes.
  • Tested both in light and dark mode.
  • New text is both in portuguese (PT) and english (EN).
  • Works in different text zoom levels.
  • Works in different screen sizes.

Performance

  • No helper functions to return widgets are added. New widgets are created instead.
  • Used ListView.builder for Long Lists.
  • Controllers (TextEditingController, ...) are beeing disposed of in dispose() method.

@SIMAOMARTA
Copy link
Copy Markdown
Contributor Author

SIMAOMARTA commented Mar 11, 2026

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 7%. Comparing base (7268a4c) to head (022a653).
⚠️ Report is 6 commits behind head on develop.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SIMAOMARTA SIMAOMARTA self-assigned this Mar 11, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 DayOfWeek and filters meals by meal.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 actual selectedDate (year/month/day) to filter meals (e.g., compare meal.date with selectedDate by date-only), and consider adding a getMealsOfDate(DateTime) helper on Restaurant so 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.

Copy link
Copy Markdown
Member

@pedroafmonteiro pedroafmonteiro left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀 🚀

Copy link
Copy Markdown
Contributor

@AugustoVSoares AugustoVSoares left a comment

Choose a reason for hiding this comment

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

LGTM! 💯 🔥

@pedroafmonteiro pedroafmonteiro merged commit 3523c22 into develop Apr 2, 2026
6 checks passed
@pedroafmonteiro pedroafmonteiro deleted the feat/next_weeks_menu branch April 2, 2026 12:55
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.

chore: add support for next week meals on the restaurant page

4 participants