From 7ad183cf89bd50a6906c6d4c72fec8c0d6b8f05e Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Fri, 23 Oct 2026 12:47:05 +0100 Subject: [PATCH] fix(app): run actions share one compact native style, as the web's run-action buttons --- .../features/artifacts/ui/artifact_gallery_action.dart | 3 ++- app/lib/features/runs/actions/cancel_run_action.dart | 10 ++++++++-- app/lib/features/runs/actions/retry_action.dart | 5 +++-- app/lib/features/runs/actions/title_action.dart | 3 ++- app/lib/features/runs/ui/run_changes_action.dart | 2 +- app/lib/features/runs/ui/run_detail_actions.dart | 4 +++- .../features/schedules/ui/run/schedule_run_action.dart | 3 ++- app/test/features/runs/actions/cancel_action_test.dart | 5 +++-- app/test/features/runs/actions/retry_action_test.dart | 5 +++-- 9 files changed, 27 insertions(+), 13 deletions(-) diff --git a/app/lib/features/artifacts/ui/artifact_gallery_action.dart b/app/lib/features/artifacts/ui/artifact_gallery_action.dart index bbcfd8a5..86a88d96 100644 --- a/app/lib/features/artifacts/ui/artifact_gallery_action.dart +++ b/app/lib/features/artifacts/ui/artifact_gallery_action.dart @@ -58,12 +58,13 @@ class RunArtifactsButton extends StatelessWidget { ); if (usesCupertinoHost(context)) { return CupertinoButton.tinted( + sizeStyle: CupertinoButtonSize.small, key: runArtifactsButtonKey, onPressed: open, child: const Text(artifactGalleryTitle), ); } - return FilledButton.tonalIcon( + return OutlinedButton.icon( key: runArtifactsButtonKey, onPressed: open, icon: const Icon(Icons.inventory_2_outlined), diff --git a/app/lib/features/runs/actions/cancel_run_action.dart b/app/lib/features/runs/actions/cancel_run_action.dart index 19bdf181..68c4ecc3 100644 --- a/app/lib/features/runs/actions/cancel_run_action.dart +++ b/app/lib/features/runs/actions/cancel_run_action.dart @@ -104,14 +104,20 @@ class _CancelRunActionState extends State { return const SizedBox.shrink(); } if (_usesCupertino(context)) { - return CupertinoButton.filled( + // The web tints Cancel as the one destructive run action. + return CupertinoButton.tinted( + sizeStyle: CupertinoButtonSize.small, key: cancelActionKey, + color: CupertinoColors.systemRed, onPressed: _open, child: const Text(cancelActionLabel), ); } - return FilledButton( + return OutlinedButton( key: cancelActionKey, + style: OutlinedButton.styleFrom( + foregroundColor: Theme.of(context).colorScheme.error, + ), onPressed: _open, child: const Text(cancelActionLabel), ); diff --git a/app/lib/features/runs/actions/retry_action.dart b/app/lib/features/runs/actions/retry_action.dart index b7f593a2..b342058d 100644 --- a/app/lib/features/runs/actions/retry_action.dart +++ b/app/lib/features/runs/actions/retry_action.dart @@ -120,13 +120,14 @@ class _RetryRunActionState extends State { return const SizedBox.shrink(); } if (_usesCupertino(context)) { - return CupertinoButton.filled( + return CupertinoButton.tinted( + sizeStyle: CupertinoButtonSize.small, key: retryActionKey, onPressed: _open, child: const Text(retryActionLabel), ); } - return FilledButton( + return OutlinedButton( key: retryActionKey, onPressed: _open, child: const Text(retryActionLabel), diff --git a/app/lib/features/runs/actions/title_action.dart b/app/lib/features/runs/actions/title_action.dart index 7a5b9b97..93eb5367 100644 --- a/app/lib/features/runs/actions/title_action.dart +++ b/app/lib/features/runs/actions/title_action.dart @@ -81,7 +81,8 @@ class _RunTitleActionState extends State { Widget build(BuildContext context) { if (runTitleId(widget.run) == null) return const SizedBox.shrink(); if (_usesCupertino(context)) { - return CupertinoButton( + return CupertinoButton.tinted( + sizeStyle: CupertinoButtonSize.small, key: runTitleActionKey, onPressed: _open, child: const Text(runTitleActionLabel), diff --git a/app/lib/features/runs/ui/run_changes_action.dart b/app/lib/features/runs/ui/run_changes_action.dart index 981b02ba..514d7601 100644 --- a/app/lib/features/runs/ui/run_changes_action.dart +++ b/app/lib/features/runs/ui/run_changes_action.dart @@ -62,7 +62,7 @@ class RunChangesButton extends StatelessWidget { ), ); } - return FilledButton.tonalIcon( + return OutlinedButton.icon( key: runChangesButtonKey, onPressed: open, icon: const Icon(Icons.difference_outlined), diff --git a/app/lib/features/runs/ui/run_detail_actions.dart b/app/lib/features/runs/ui/run_detail_actions.dart index 6b0943de..0416d823 100644 --- a/app/lib/features/runs/ui/run_detail_actions.dart +++ b/app/lib/features/runs/ui/run_detail_actions.dart @@ -33,7 +33,9 @@ class RunDetailActions extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - // Standard native spacing keeps adjacent outlines and fills distinct. + // Every run action uses one native style, as the web's `.run-action`: + // outlined on Material, tinted on Cupertino; Cancel alone is tinted + // destructive. Standard native spacing keeps adjacent buttons distinct. // Only actions that render are included: a hidden zero-size child still // consumes Wrap spacing and would double the visible gap. Wrap( diff --git a/app/lib/features/schedules/ui/run/schedule_run_action.dart b/app/lib/features/schedules/ui/run/schedule_run_action.dart index 5ed5227c..16be6723 100644 --- a/app/lib/features/schedules/ui/run/schedule_run_action.dart +++ b/app/lib/features/schedules/ui/run/schedule_run_action.dart @@ -71,7 +71,8 @@ class _ScheduleRunActionState extends State { if (!canScheduleRun(widget.run)) return const SizedBox.shrink(); final cupertino = usesCupertinoHost(context); final action = cupertino - ? CupertinoButton( + ? CupertinoButton.tinted( + sizeStyle: CupertinoButtonSize.small, key: scheduleRunActionKey, onPressed: _open, child: const Text(scheduleRunActionLabel), diff --git a/app/test/features/runs/actions/cancel_action_test.dart b/app/test/features/runs/actions/cancel_action_test.dart index e50a6eea..09354fc1 100644 --- a/app/test/features/runs/actions/cancel_action_test.dart +++ b/app/test/features/runs/actions/cancel_action_test.dart @@ -65,7 +65,8 @@ void main() { ); expect(find.byKey(cancelActionKey), findsOneWidget); - expect(find.byType(FilledButton), findsOneWidget); + // One native run-action style: outlined on Material. + expect(find.byType(OutlinedButton), findsOneWidget); expect(gateway.calls, isEmpty); await tester.tap(find.byKey(cancelActionKey)); @@ -116,7 +117,7 @@ void main() { expect(find.byKey(cancelActionKey), findsOneWidget); expect(find.byType(CupertinoButton), findsOneWidget); - expect(find.byType(FilledButton), findsNothing); + expect(find.byType(OutlinedButton), findsNothing); await tester.tap(find.byKey(cancelActionKey)); await tester.pumpAndSettle(); diff --git a/app/test/features/runs/actions/retry_action_test.dart b/app/test/features/runs/actions/retry_action_test.dart index c8a2eed6..ad6f6623 100644 --- a/app/test/features/runs/actions/retry_action_test.dart +++ b/app/test/features/runs/actions/retry_action_test.dart @@ -67,7 +67,8 @@ void main() { await pumpRetry(tester, gateway: gateway, changed: changed); expect(find.byKey(retryActionKey), findsOneWidget); - expect(find.byType(FilledButton), findsOneWidget); + // One native run-action style: outlined on Material. + expect(find.byType(OutlinedButton), findsOneWidget); expect(gateway.calls, isEmpty); await tester.tap(find.byKey(retryActionKey)); @@ -162,7 +163,7 @@ void main() { expect(find.byKey(retryActionKey), findsOneWidget); expect(find.byType(CupertinoButton), findsOneWidget); - expect(find.byType(FilledButton), findsNothing); + expect(find.byType(OutlinedButton), findsNothing); await tester.tap(find.byKey(retryActionKey)); await tester.pumpAndSettle();