Commit Graph

1275 Commits

Author SHA1 Message Date
Roland Geider
c39c418d37 Merge master 2026-05-03 19:15:21 +02:00
Roland Geider
390dadcdf0 Cleanup 2026-05-03 18:21:54 +02:00
AlexisBirling3
7fb64b2925 shortens the displayed error message and adds link to doc 2026-05-03 18:12:33 +02:00
AlexisBirling3
67f1569148 adds i18n for the new widget 2026-05-03 18:12:33 +02:00
AlexisBirling3
7d2b842f1a adds a helper class to check sanity and implements widget to display sanity after auth 2026-05-03 18:12:33 +02:00
Roland Geider
164d553fde Improve the exercise search autocompleter
Closes #1182
Co-authored-by: Pankaj Basnet <165250380+pankaj-basnet@users.noreply.github.com>
2026-05-03 17:54:07 +02:00
Roland Geider
0fb660dcd2 Move access to nutritional plans to the nutrition state 2026-05-03 12:37:06 +02:00
Roland Geider
1ec921faf3 Consistent usage of uuid IDs
Now these fields are always nullable on the model and get a value once they
are persisted to the (local) database.
2026-05-03 12:17:23 +02:00
Roland Geider
c1dccbd822 Make the "impression" in workout session an enum
This is cleaner and simplifies a handful of places
2026-05-03 12:17:23 +02:00
pankaj-basnet
1a9ab581a5 refactor: improve image error handling with pattern matching and URI parsing 2026-05-03 02:26:58 +05:45
Roland Geider
d6affe4036 Sync the rest of the nutrition tables with powersync 2026-05-02 12:36:08 +02:00
Roland Geider
cf13af1740 Sync the rest of the nutrition tables to powersync 2026-05-01 20:24:26 +02:00
Roland Geider
2cb40612b1 Cleanup providers and use consistent naming 2026-05-01 16:58:08 +02:00
Roland Geider
5d30a1ca79 Cleanup providers and use consistent naming 2026-05-01 16:50:15 +02:00
Roland Geider
209ab7cbbe Add gallery sync tables 2026-05-01 15:25:31 +02:00
Roland Geider
35404372f9 Refactor exercise repository online/offline search
This behaves now similarly to what the ingredients do as well
2026-05-01 13:22:47 +02:00
Roland Geider
9226b06454 Rename for more consistency 2026-05-01 13:10:39 +02:00
Roland Geider
9f365f8069 Consolidate ingredient search methods into the ingredient repo 2026-05-01 12:27:49 +02:00
Roland Geider
5fea670ba3 Merge master 2026-04-30 19:41:17 +02:00
Roland Geider
d1f6fc2dfe Sync nutritional logs 2026-04-30 18:10:02 +02:00
Roland Geider
a1722f18f8 Open ingredient info dialog from the nutritional plan list 2026-04-30 15:54:38 +02:00
Roland Geider
97c4a5b07e Refactor ingredient weight unit handling and remove unused methods 2026-04-30 14:33:32 +02:00
Roland Geider
d152031633 Refactor ingredient weight unit handling and remove unused methods 2026-04-30 14:11:56 +02:00
Roland Geider
a9644ab383 Refactor ingredient handling to use direct object references 2026-04-30 12:58:35 +02:00
Roland Geider
4751b2ddc3 Delete old images from the device older than approx. 3 months 2026-04-30 10:48:57 +02:00
Roland Geider
d135e81d4f Cache ingredient and exercise images on device 2026-04-30 10:48:20 +02:00
Roland Geider
271d9f9835 Refactor unit selection for repetitions and weight
This is now done inline with a suffix icon, instead of having an extra
toggle that showed an explicit dropdown. Existing logs can now be edited
in the routine log overview page.
2026-04-29 16:56:06 +02:00
Roland Geider
40c3bbc95c Use the workout session and logs from the current routine in summary.dart
This data is now always current from powersync
2026-04-29 12:59:34 +02:00
Roland Geider
733fe24fa7 Remove fetchAndSetRoutineFull from future
This was only used to fetch current workout logs and sessions, which is not
needed anymore
2026-04-29 11:05:58 +02:00
Roland Geider
680127e139 Sync the base Routine and Nutritional plan entries via powersync
This makes sure the lists is always kept current and allows the user to edit
them offline as well. Note that we still kepp the backend's ID here, so no
creation is possible.
2026-04-29 10:03:59 +02:00
Roland Geider
4b581173d8 Show more sync information to the user 2026-04-24 14:44:04 +02:00
Roland Geider
72ef83e1a2 Translate the sync status in the main icon 2026-04-24 13:15:24 +02:00
Roland Geider
e2d650fdb5 Use the AsyncValueWidget when handling Stream-Provider data 2026-04-24 12:52:41 +02:00
Roland Geider
b6923d1a6c Refactor exercise providers
The exercise provider now returns an ExerciseState, which exposes some filter
methods on the exercises
2026-04-24 12:26:43 +02:00
Roland Geider
c1d2fbe67b Show loading spinner for the routine widget in the dashboard 2026-04-23 15:38:21 +02:00
Roland Geider
f5ab4ca390 Handle HTTP errors
If the indetify the error as having HTML (e.g. during development, a wrongly configured
reverse proxy, etc.) render the HTML instead
2026-04-23 13:33:10 +02:00
Roland Geider
f7458f86f5 Add unreachable server screen and related error handling 2026-04-23 12:41:37 +02:00
Roland Geider
e0892c42d4 Refactor calendar widget
This is less brittle (the dreaded context async gap) and should be easier to
understand in the future
2026-04-20 17:04:50 +02:00
Roland Geider
7f6803646b Invalidate data providers after successful login/logout
This is specially necessary for the powersync ones, since they can hold data
from other users
2026-04-20 17:04:09 +02:00
kiranannadatha8
b7f7e43fa3 refactor(nutrition): collapse Nutri-Score toggle into single slider
Mirrors the React refactor in wger-project/react#1237 addressing
Roland's review — the SwitchListTile + conditional Slider pair
expressed one semantic decision ("what grade ceiling?") through two
controls. Folded "Off" into the slider itself:

- Slider stops are now Off | A | B | C | D | E (was A..E, gated by
  a SwitchListTile).
- Off position sends no `nutriscoreMax`; A..E map as before.
- Heading changed from "Filter by Nutri-Score" to "Nutri-Score
  filter", with a dynamic helper ("No filter" / "<grade> or better").
- Model: `IngredientFilters.nutriscoreMax` is now nullable; removed
  `filterNutriscore`. `copyWith` takes a `clearNutriscoreMax` flag
  because Dart's `??` cannot distinguish "no argument" from "null".
- Storage collapsed: `saveIngredientNutriscoreMax(null)` removes the
  key; `getIngredientNutriscoreMax()` returns `null` when absent.
- Riverpod notifier: removed `toggleNutriscore`; `chooseNutriscoreMax`
  now takes `NutriScore?`.
- l10n: removed `filterNutriscoreMax`; added `filterNutriscoreOff`,
  `filterNutriscoreNoFilter`, `filterNutriscoreOrBetter` (placeholder).

Tests updated: 61/61 pass.
2026-04-20 10:33:08 -04:00
kiranannadatha8
a5114851fe feat(nutrition): filter ingredient search by Nutri-Score
Adds a "Filter by Nutri-Score" switch and an A–E discrete slider to
the ingredient search filter popover. The worst acceptable grade is
sent to the backend as `nutriscore__lte=<a|b|c|d|e>`, matching the
new filter exposed by wger-project/wger#2295.

- Extend `IngredientFilters` with `filterNutriscore` + `nutriscoreMax`
- Persist both settings through `PreferenceHelper`
- Expose `toggleNutriscore` and `chooseNutriscoreMax` on the riverpod
  notifier
- Propagate `nutriscoreMax` through `NutritionPlansProvider.searchIngredient`
- Add English strings `filterNutriscore` / `filterNutriscoreMax`
- Widget tests cover: slider hidden until switch flipped, query emitted
  with/without the filter
- Update stale generated Mockito overrides across the four test files
  that mock `NutritionPlansProvider` so the new named arg lines up

Refs wger-project/wger#2295
2026-04-19 01:44:59 -04:00
Roland Geider
1258382957 Use common widget to render AsyncValues (errors, loading, etc.) 2026-04-18 23:02:17 +02:00
Roland Geider
d70c43e893 Properly gate the parts of the application that need network connectivity 2026-04-18 21:43:16 +02:00
Roland Geider
9a4fec8bf3 Refactor the workout session provider
The logs are read in the session repository, the logs one is only used
for CRUD operations
2026-04-18 18:19:31 +02:00
Roland Geider
af378dfdb3 Make the routines provider async
This makes the behaviour consistent with the others
2026-04-18 17:40:45 +02:00
Roland Geider
0afb1026a9 Further refactor how the new providers fetch data 2026-04-18 17:06:44 +02:00
Roland Geider
8252dcdd74 Properly check if the userprofile was correctly loaded 2026-04-18 16:21:41 +02:00
Roland Geider
c1a733b423 Clear the powersync database when a user logs out 2026-04-17 22:48:14 +02:00
Roland Geider
d7088606f3 Migrate the contribute provider to riverpod and remove the old provider package 2026-04-17 21:38:36 +02:00
Roland Geider
97dee19368 Migrate the gallery provider to riverpod 2026-04-17 21:12:34 +02:00