Commit Graph

844 Commits

Author SHA1 Message Date
Roland Geider
ae2c6939fb Use leftOuterJoin in the nutrition sql 2026-06-03 15:26:14 +02:00
Roland Geider
f86ee0838e Add tests for the powersync transaction process logic 2026-06-03 15:03:46 +02:00
Roland Geider
8a626ae2bf Handle (transient) case where an exercise has no translations 2026-06-03 13:06:10 +02:00
Roland Geider
137ad197e4 Properly handle "." and "," for numerical inputs 2026-06-03 12:51:00 +02:00
Roland Geider
fb74e255d4 Remove dependency on wgerBaseProvider
This was causing some circular dependency problems
2026-06-02 19:46:33 +02:00
Roland Geider
14abce70d5 Suppress drift's multiple databases warning
This is only relevant for tests (and only in linux?) and wasn't surfacing any real problems
anyway, so we can safely ignore it.
2026-05-27 12:50:46 +02:00
Roland Geider
759b39379f Updated goldens 2026-05-27 12:15:12 +02:00
Roland Geider
ed757d2171 Slight refactor of appVersion handling 2026-05-27 12:11:37 +02:00
Roland Geider
4deab80e87 Configure shared preferences for the test 2026-05-27 11:39:44 +02:00
Roland Geider
b2250fa8c5 Merge remote-tracking branch 'origin/master' into feature/offline-mode
# Conflicts:
#	lib/widgets/nutrition/ingredient_dialogs.dart
#	lib/widgets/nutrition/widgets.dart
2026-05-27 11:08:31 +02:00
Roland Geider
f4df847511 Extract some logic into their own files
This makes the (still) quite large auth_notifier.dart, a bit more clear and easy
to understand
2026-05-25 23:32:38 +02:00
Roland Geider
9003b46002 Add migration path from old permanent token to JWT
This is needed to allow users coming from an old version of the app to remain
logged-in.
2026-05-25 23:13:40 +02:00
Roland Geider
1009477553 Fix behaviour on logout
We were previously dropping the local db on logout, which could also happen when
the user was too long offline to fetch a new token. Now this only happens when the
user manually logs out, or during login and there's the db from a previous, different,
user.
2026-05-25 20:52:23 +02:00
Roland Geider
98e9ea9417 Smarter handling of token lifetimes
We don't want to logout the user if we can't refresh the token because the
device is offline.
2026-05-25 20:33:50 +02:00
Roland Geider
6436226a9e Remove network info dashboard widget
This is not really needed anymore since most parts of the application can be used
offline, and the ones that don't are marked.
2026-05-25 19:48:12 +02:00
Roland Geider
a485fd21df Split gym state and notifier into their own files 2026-05-25 17:58:23 +02:00
Roland Geider
3204df14ef Properly filter the ingredient list 2026-05-25 17:01:26 +02:00
Roland Geider
5194a6c869 Refactor the ingredient detail screen
We now use the exact same widget as in the regular info dialog
2026-05-25 16:45:51 +02:00
Roland Geider
5c916241b6 Make the ingredient object nullable for logs and meal items
This is needed due to the way powersync works. In practice, this will only be null during
a very small time window between editing the model and the sync back from the backend.
2026-05-25 15:51:34 +02:00
Roland Geider
1f55069b97 Don't rebuild on every keystroke 2026-05-25 15:15:58 +02:00
Roland Geider
34b1fa6a86 Merge branch 'feature/offline-mode' into feat/nutrition-ingredients-implementation
# Conflicts:
#	lib/providers/ingredient_notifier.dart
2026-05-25 13:44:48 +02:00
Roland Geider
a7e30fcf8c Refactor auth screen
This has been split up into several individual widgets and (hopefully) made
more user friendly
2026-05-24 20:14:25 +02:00
Anja Klipic
10cb77cffd chore: add tests for changes related to brand field 2026-05-23 13:10:16 +02:00
Roland Geider
6ffb1b6c75 Add some more tests for the auth screen 2026-05-22 23:52:11 +02:00
Roland Geider
aaa788570d Cleanup auth screen 2026-05-22 22:50:50 +02:00
Roland Geider
ea3087792c Merge branch 'feature/allauth' into feature/offline-mode 2026-05-22 22:30:45 +02:00
Roland Geider
1b72fb71ad Fix circular provider dependency 2026-05-22 22:14:45 +02:00
Roland Geider
fe5c7bb0ef Regenerate build files 2026-05-22 20:18:49 +02:00
Roland Geider
99f54a830d Regenerate build files 2026-05-22 20:11:23 +02:00
Roland Geider
8213c44342 Add "login via web"
This allows the user to login via all supported methods, such as social auth,
passkeys, etc. without needing to implement them individually here.
2026-05-22 20:11:14 +02:00
Roland Geider
291d3f0f76 Extract token from correct key 2026-05-22 20:11:06 +02:00
Roland Geider
8fc149741f Edit the user's email via allauth's endpoints 2026-05-22 20:10:47 +02:00
Roland Geider
6188175c1a Add 2fa login screen 2026-05-22 20:08:44 +02:00
Roland Geider
87a40fd4e6 Switch the pasted-token field from DRF tokens to refresh tokens 2026-05-22 20:08:43 +02:00
Roland Geider
42752de182 Move Authorization header to a dedicated HTTP client 2026-05-22 20:08:07 +02:00
Roland Geider
225a689e7e Implement refresh token logic 2026-05-22 20:08:06 +02:00
Roland Geider
3f89b5a9b5 Add secure storage integration and headless (allauth) JWT support 2026-05-22 20:08:06 +02:00
Roland Geider
26722a49be Start implementing JWT support 2026-05-22 20:04:42 +02:00
Roland Geider
736cb41cb2 Improve the login process
The previous process was depending too much on the backend being available, we
can now bypass many of these checks if the user had already logged in before
2026-05-22 19:19:00 +02:00
Roland Geider
af8ed102eb Also write to the user profile via powersync 2026-05-22 17:59:16 +02:00
Roland Geider
1075a2807f Remove the AuthStatus.serverUnreachable case
If the user is logged in, they can access the app
2026-05-22 17:10:28 +02:00
Roland Geider
51730e956e Make more widgets online-aware 2026-05-22 16:49:59 +02:00
Roland Geider
d0c56c42eb Re-probe the connection to the wger server itself
This is actually the "real" connectivity test, since we need a backend to talk to
2026-05-22 15:52:23 +02:00
Roland Geider
d97de48fee Refactor the error logic
UI related functions have been moved to error_dialogs.dart, while everything else
is kept in errors.dart
2026-05-22 15:50:33 +02:00
Roland Geider
802fc4d468 Merge pull request #1202 from pankaj-basnet/fix/fl-chart-unsupported-operation-error
fix(nutrition): resolve fl_chart app crash when toggling meal details in Nutritional Plan Detail screen
2026-05-22 09:31:05 +02:00
pankaj-basnet
90949c63fb fix(nutrition): resolve fl_chart crash on division by zero when logged/planned macros are empty in MealDiaryBarChart
Bug: Unsupported operation: Infinity or NaN toInt (package:fl_chart)
2026-05-22 01:23:57 +05:45
Roland Geider
848ba17d54 Format number inputs according to locale
Due to some idiosyncrasies of the on-screen keyboards where we can neither control nor
know what separator it shows, and the way intl parses work (in the "de" locale 80.5 is
parsed to 805.0), we need to roll our own
2026-05-21 14:51:05 +02:00
Roland Geider
4ebc98e18b Regenerate mock files and fix test 2026-05-21 13:37:56 +02:00
Roland Geider
52364ebafc Merge branch 'master' into feature/offline-mode
# Conflicts:
#	lib/helpers/errors.dart
#	lib/main.dart
#	lib/widgets/nutrition/forms.dart
#	lib/widgets/routines/forms/slot_entry.dart
2026-05-21 12:26:53 +02:00
Roland Geider
0741fd4bb8 Better error handling
We can now distinguish between errors that should block the application, (hopefully)
transient ones that only warrant a snackbar and others that are only logged.
2026-05-21 12:09:51 +02:00