Commit Graph

1190 Commits

Author SHA1 Message Date
Roland Geider
dcebb3a2e7 Add script to check language lists stay in sync
This is also run on commits, so we get alerted when we forget to add new locales
2026-05-18 10:27:25 +02:00
Roland Geider
475442e779 Consolidate locale handling logic 2026-05-18 09:40:12 +02:00
Pawel Haracz
822cedf9a4 feat(settings): add in-app language switcher
Adds a per-user language override in Settings that takes precedence over
the system locale, fixing #439. Selecting "System default" clears the
override and falls back to the existing localeListResolutionCallback.

Also declares CFBundleLocalizations in the iOS Info.plist so iOS 16+ users
get the native per-app language picker (Settings → wger → Language) as an
alternative entry point.

Implementation mirrors the existing themeMode flow on UserProvider, with
the selected locale persisted in SharedPreferences under PREFS_USER_LOCALE
and matched against AppLocalizations.supportedLocales on load to preserve
script-bearing locales (zh_Hant, pt_BR, ...).
2026-05-16 15:31:34 +02:00
Roland Geider
39eaf9abe0 Make the linter happy 2026-05-07 21:42:23 +02:00
Roland Geider
bfc1ee92a2 Put control body in new line 2026-05-07 21:30:36 +02:00
Roland Geider
ca18f34d4c Update calls from deprecated APIs 2026-05-07 17:47:40 +02:00
Roland Geider
8e05d3ab10 Fix linting problems 2026-05-07 17:38:23 +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
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
22af0ef9ff Show vegetarian and nutriscore badge in the ingredient autocompleter 2026-04-14 00:11:03 +02:00
Roland Geider
435a7c6f85 Cleanup 2026-04-13 18:02:30 +02:00
Roland Geider
44af2ecaf2 Merge branch 'feature/exercise-variations' into feature/version-2.5
# Conflicts:
#	lib/models/exercises/exercise_submission.dart
#	lib/providers/add_exercise.dart
2026-04-13 16:37:07 +02:00
Roland Geider
1a7b6bc559 Cleanup 2026-04-13 15:31:54 +02:00
Roland Geider
40dbe842cd Move the variation to a field in the exercise 2026-04-13 12:58:17 +02:00
Roland Geider
9f41695e65 Merge branch 'feature/nutrition-units' into feature/version-2.5
# Conflicts:
#	test/nutrition/goldens/nutritional_plan_2_one_meal_with_ingredients.png
#	test/nutrition/goldens/nutritional_plan_3_both_meals_with_ingredients.png
2026-04-10 10:38:31 +02:00
Roland Geider
bdc5e541e2 Merge branch 'feature/markdown-exercises' into feature/version-2.5 2026-04-10 10:35:34 +02:00
Roland Geider
301c2e42ce Merge branch 'feature/add-warmup-type' into feature/version-2.5
# Conflicts:
#	test/core/validators_test.mocks.dart
2026-04-10 10:35:10 +02:00
Roland Geider
6e76cf6d66 Merge branch 'master' into fork/sg172003/feature/measurement-datetime-field 2026-04-09 23:49:13 +02:00
Roland Geider
8a19e398b0 Add time information to test measurement entries, update tests 2026-04-09 23:45:57 +02:00
Roland Geider
ed8203de09 Expose units in the nutritional plan 2026-03-31 11:46:38 +02:00
Roland Geider
85b261fad7 Group slots in the UI with the same exercise
This allows the user to add different slots (sets) to an exercise, like
10 x 10kg, 8 x 12kg, 6 x 15kg. Also note that this is purely a UI change,
as it was already possible to simply add the same exercise again.
2026-03-29 20:46:13 +02:00
Sarthak
f7f864da8a fix(measurements): add time picker to measurement entry form 2026-03-29 21:12:40 +05:30
Sarthak
733a880280 fix(measurements): restore complete forms.dart with only selectableDayPredicate removed 2026-03-22 16:05:55 +05:30
Sarthak
a4ea771985 feat(measurements): remove date restriction to allow multiple entries per day 2026-03-18 22:55:37 +05:30
Madhav
3fd0de3257 Apply dart format 2026-03-12 22:48:21 +05:30
Roland Geider
885d88180b Refactor ingredient filter provider
No need to hard code the preferences in main
2026-03-11 15:39:38 +01:00
Saraswathi
efeeea85ab enhancement:persist-ingredient-filters in nutrition 2026-03-05 16:48:52 +05:30
Roland Geider
51b65664cb Refactor language handling when searching ingredients
While this has technically nothing to do with the vegan flags, we can refactor the
language handling while we're at it. This should make the behaviour more transparent
to the user and could be expanded in the future if needed (manually selecting other
languages, etc.).
2026-02-27 12:31:52 +01:00
Roland Geider
81430ff7bc Cleanup 2026-02-27 11:37:00 +01:00
Roland Geider
92a43c6ca7 Add vegan and vegetarian fields and filters to the ingredient 2026-02-26 23:07:13 +01:00
Roland Geider
ef649ad439 Merge pull request #1122 from alexisbirling-boop/improve-product-not-found-dialog
Improve product not found dialog
2026-02-24 21:14:08 +01:00
Roland Geider
dee6c12cea Fixed i18n
and added a max allowed weight as well (but this should probably be done everywhere)
2026-02-24 21:08:37 +01:00
Roland Geider
34403b462a Merge branch 'master' into fork/dhituval/issue721/fix-ingredient-weight 2026-02-24 20:53:11 +01:00
alexisbirling-boop
1ba38b7cf4 Merge branch 'wger-project:master' into improve-product-not-found-dialog 2026-02-24 14:50:41 -05:00
AlexisBirling3
da4c0e7af3 Puts the dialog in a new column and changes style to default 2026-02-24 14:40:55 -05:00
Roland Geider
86ce2fc9d6 Split up the widgets in log_page.dart file 2026-02-20 11:58:47 +01:00
AlexisBirling3
bcbcd1a2dc apply dart format 2026-02-17 15:27:18 -05:00
AlexisBirling3
f40d572fae improves the pop up after a scan gives no result 2026-02-12 10:48:12 -05:00
Roland Geider
9815e51e59 value can't be null here 2026-02-11 13:37:33 +01:00
Roland Geider
54c6ce0175 Refactor the log entry form in the gym mode.
Previously due to rebuilds the form would e.g. not stay open after
selecting a new unit (which would also not change)
2026-02-11 13:37:33 +01:00
Roland Geider
a367678b91 Properly filter dayData entries
This is needed when the "needs logs to advance" toggle is active

See https://github.com/wger-project/wger/issues/2164
2026-02-09 22:49:30 +01:00
Roland Geider
88168dc352 Some polishing, add simple test 2026-02-08 14:54:26 +01:00
Roland Geider
04be95634b Start adding markdown editor for exercise descriptions 2026-02-08 13:49:58 +01:00
cryptbrn
6317cc7fe9 fix add time when log meal and nutrition 2026-01-31 12:28:11 +07:00
Roland Geider
332cc3ddf8 Extract language code as variable 2026-01-29 18:08:44 +01:00