diff --git a/lib/features/measurements/widgets/categories_card.dart b/lib/features/measurements/widgets/categories_card.dart index e04c9e322..c6012567c 100644 --- a/lib/features/measurements/widgets/categories_card.dart +++ b/lib/features/measurements/widgets/categories_card.dart @@ -298,15 +298,22 @@ class CategoriesCard extends ConsumerWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - TextButton( - child: Text(AppLocalizations.of(context).goToDetailPage), - onPressed: () { - Navigator.pushNamed( - context, - MeasurementEntriesScreen.routeName, - arguments: currentCategory.id, - ); - }, + // The label runs long in several languages and the card is + // narrow on tablets, where the dashboard lays it out in columns + Expanded( + child: TextButton( + child: Text( + AppLocalizations.of(context).goToDetailPage, + overflow: TextOverflow.ellipsis, + ), + onPressed: () { + Navigator.pushNamed( + context, + MeasurementEntriesScreen.routeName, + arguments: currentCategory.id, + ); + }, + ), ), IconButton( onPressed: () async { diff --git a/test/features/measurements/widgets/categories_card_test.dart b/test/features/measurements/widgets/categories_card_test.dart index 919eb490e..742c46e36 100644 --- a/test/features/measurements/widgets/categories_card_test.dart +++ b/test/features/measurements/widgets/categories_card_test.dart @@ -1,6 +1,6 @@ /* * This file is part of wger Workout Manager . - * Copyright (c) 2026 wger Team + * Copyright (c) 2026 - 2026 wger Team * * wger Workout Manager is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -38,6 +38,7 @@ Widget _wrap( Map latest = const {}, List categories = const [], Map> entries = const {}, + Locale? locale, }) => ProviderScope( overrides: [ // The component rows read their last known value from its own query @@ -47,6 +48,7 @@ Widget _wrap( measurementGroupBucketsProvider.overrideWith(groupBucketsFrom(categories, entries)), ], child: MaterialApp( + locale: locale, localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, home: Scaffold(body: child), @@ -61,11 +63,12 @@ Map _latestOf(Map> entr /// The fixtures have fixed dates, so the card charts the full history instead /// of the range it defaults to -Widget _card(_Seed seed) => _wrap( +Widget _card(_Seed seed, {Locale? locale}) => _wrap( CategoriesCard(seed.category, range: ChartRange.all), latest: _latestOf(seed.entries), categories: [seed.category], entries: seed.entries, + locale: locale, ); _Seed _bpGroup({bool withEntries = false}) => (