You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Users must choose an exact mensa during onboarding before finishing; the same selection can be changed later in Settings.
47
+
- Karlsruhe keeps the existing Studierendenwerk Karlsruhe scraper/model path (`Mensa Erzbergerstrasse`); non-Karlsruhe supported locations currently use the OpenMensa path.
48
+
- The active mensa is stored as a single selected-location cache; widgets/background refresh follow that active selection.
46
49
- Scraping/parsing offloads heavy parsing to isolate path in service layer.
47
50
- UI is day-based with visible-content-day bounds (recent fixes prevent invalid swipe pages/overscroll edge issues).
- Week calculation uses ISO week numbers (see `_isoWeekNumber()` in `CanteenScraper`).
33
+
- Other currently supported locations use OpenMensa day endpoints through `OpenMensaCanteenSource`.
34
+
- Settings can change the selected mensa later; switching locations clears the active cached meal table and repopulates it for the newly selected location.
32
35
33
36
## Parsing Rules
34
37
- Days are read from `#canteen_day_nav_1..5` using their `rel` date attribute.
@@ -65,6 +68,7 @@ To avoid frame drops while loading a new week:
65
68
- The UI shows animated skeleton cards while a week is loading.
66
69
- The day list switches from skeleton to real content using a short fade.
67
70
- Chips are not rendered in the list (notes are shown as a lightweight text row).
71
+
- The selected mensa remains the single active cache source for the page, widget, and background updater.
68
72
69
73
### Filters
70
74
The filter dropdown (top-right) uses `CanteenFilter` to filter the list in-memory, without re-querying the network or database.
The app could not support exact mensa selection end to end. Onboarding had no required mensa step, Settings could not reconfigure the canteen source, and the canteen backend was still hardcoded to Karlsruhe.
20
+
21
+
## Root Cause
22
+
The canteen stack only had one implicit source: the Karlsruhe scraper path. There was no persisted selected-location concept, so onboarding and Settings could not drive the runtime provider or widget/background cache behavior.
23
+
24
+
## Solution
25
+
- Added a persisted selected canteen location via `PreferencesProvider` and `CanteenLocationService`.
26
+
- Added a required onboarding mensa step that intentionally matches the schedule setup page structure.
27
+
- Added a Settings dialog to reselect the exact mensa later.
28
+
- Kept Karlsruhe on the existing scraper/model path exactly as before.
29
+
- Added an OpenMensa-backed source for the newly supported non-Karlsruhe locations.
30
+
- Kept the SQLite/widget cache model minimal by treating the selected mensa as the single active canteen cache and clearing cached meals when the selection changes.
31
+
32
+
## Test Coverage
33
+
-`required canteen step cannot be skipped when invalid`
34
+
-`refreshWeek uses OpenMensa for non-Karlsruhe locations`
35
+
- existing canteen page bounds, visible-days, and startup loading policy suites updated for the new location service path
36
+
37
+
## Commands run
38
+
```bash
39
+
flutter test test/canteen/business/canteen_provider_refresh_policy_test.dart test/canteen/ui/viewmodels/canteen_visible_days_test.dart test/canteen/ui/viewmodels/canteen_startup_loading_policy_test.dart test/canteen/ui/canteen_page_bounds_test.dart test/ui/onboarding/onboarding_required_canteen_step_test.dart
0 commit comments