StoDevX / AAO-React-Native

The St. Olaf community, now in pocket size.
GNU Affero General Public License v3.0
42 stars 16 forks source link

ensure items with dietary data are only shown when a diet is enabled #7083

Closed drewvolz closed 9 months ago

drewvolz commented 9 months ago

When filtering by diets in the menu screen, items without dietary data are appearing which could lead to inaccurate results being shown. We don't want to show meat dishes as vegetarian when they aren't explicitly marked as (v) or (vg).

Following the pattern we have for checking whether specials are enabled, this adds a check to see if dietary filtering is enabled. When grouping items to render, if we are filtering diets, we can exclude items that do not state their dietary data. This should be okay performance-wise.

Bonus performance addition: this also opts FancyMenu's section list into largeListProps. Local testing shows this resolves the larger list struggling to keep up while scrolling (the one without specials enabled).

Before After
Simulator Screen Shot - iPhone 14 Pro - 2023-10-08 at 20 49 33 Simulator Screen Shot - iPhone 14 Pro - 2023-10-08 at 20 49 49
codecov[bot] commented 9 months ago

Codecov Report

Merging #7083 (2812b11) into master (7296c40) will decrease coverage by 0.02%. The diff coverage is 0.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #7083 +/- ## ========================================= - Coverage 8.48% 8.46% -0.02% ========================================= Files 304 304 Lines 5117 5125 +8 Branches 1373 1376 +3 ========================================= Hits 434 434 - Misses 4655 4663 +8 Partials 28 28 ```