diff --git a/app/lib/features/runs/ui/runs_filters.dart b/app/lib/features/runs/ui/runs_filters.dart index 32025b8e..8245a399 100644 --- a/app/lib/features/runs/ui/runs_filters.dart +++ b/app/lib/features/runs/ui/runs_filters.dart @@ -227,8 +227,18 @@ class RunsBarActions { // The current order is the sheet's default (bold) action. isDefaultAction: controller.sort == option.$1, onPressed: () => Navigator.pop(sheet, option.$1), - child: Text( - '${controller.sort == option.$1 ? '✓ ' : ''}${option.$2}', + child: Semantics( + selected: controller.sort == option.$1, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text(option.$2), + if (controller.sort == option.$1) ...[ + const SizedBox(width: 8), + const Icon(CupertinoIcons.checkmark), + ], + ], + ), ), ), ], diff --git a/app/test/features/runs/ui/runs_sheets_test.dart b/app/test/features/runs/ui/runs_sheets_test.dart index 34d79db5..e388903a 100644 --- a/app/test/features/runs/ui/runs_sheets_test.dart +++ b/app/test/features/runs/ui/runs_sheets_test.dart @@ -150,6 +150,35 @@ void main() { expect(controller.sort, 'newest_first'); }); + testWidgets('Cupertino sort sheet marks the selected order with an icon', ( + tester, + ) async { + await mount(tester, cupertino: true); + await tester.tap(find.byKey(const ValueKey('runs.sort'))); + await tester.pumpAndSettle(); + + expect(find.text('✓ Newest first'), findsNothing); + final newestFirst = find.widgetWithText( + CupertinoActionSheetAction, + 'Newest first', + ); + expect(newestFirst, findsOneWidget); + expect( + find.descendant( + of: newestFirst, + matching: find.byIcon(CupertinoIcons.checkmark), + ), + findsOneWidget, + ); + final selected = find.descendant( + of: newestFirst, + matching: find.byWidgetPredicate( + (widget) => widget is Semantics && widget.properties.selected == true, + ), + ); + expect(selected, findsOneWidget); + }); + testWidgets('the usage page is honest when nothing was reported', ( tester, ) async {