merge(app): land run action styles

This commit is contained in:
2026-10-23 12:48:00 +01:00
9 changed files with 27 additions and 13 deletions
@@ -58,12 +58,13 @@ class RunArtifactsButton extends StatelessWidget {
); );
if (usesCupertinoHost(context)) { if (usesCupertinoHost(context)) {
return CupertinoButton.tinted( return CupertinoButton.tinted(
sizeStyle: CupertinoButtonSize.small,
key: runArtifactsButtonKey, key: runArtifactsButtonKey,
onPressed: open, onPressed: open,
child: const Text(artifactGalleryTitle), child: const Text(artifactGalleryTitle),
); );
} }
return FilledButton.tonalIcon( return OutlinedButton.icon(
key: runArtifactsButtonKey, key: runArtifactsButtonKey,
onPressed: open, onPressed: open,
icon: const Icon(Icons.inventory_2_outlined), icon: const Icon(Icons.inventory_2_outlined),
@@ -104,14 +104,20 @@ class _CancelRunActionState extends State<CancelRunAction> {
return const SizedBox.shrink(); return const SizedBox.shrink();
} }
if (_usesCupertino(context)) { if (_usesCupertino(context)) {
return CupertinoButton.filled( // The web tints Cancel as the one destructive run action.
return CupertinoButton.tinted(
sizeStyle: CupertinoButtonSize.small,
key: cancelActionKey, key: cancelActionKey,
color: CupertinoColors.systemRed,
onPressed: _open, onPressed: _open,
child: const Text(cancelActionLabel), child: const Text(cancelActionLabel),
); );
} }
return FilledButton( return OutlinedButton(
key: cancelActionKey, key: cancelActionKey,
style: OutlinedButton.styleFrom(
foregroundColor: Theme.of(context).colorScheme.error,
),
onPressed: _open, onPressed: _open,
child: const Text(cancelActionLabel), child: const Text(cancelActionLabel),
); );
@@ -120,13 +120,14 @@ class _RetryRunActionState extends State<RetryRunAction> {
return const SizedBox.shrink(); return const SizedBox.shrink();
} }
if (_usesCupertino(context)) { if (_usesCupertino(context)) {
return CupertinoButton.filled( return CupertinoButton.tinted(
sizeStyle: CupertinoButtonSize.small,
key: retryActionKey, key: retryActionKey,
onPressed: _open, onPressed: _open,
child: const Text(retryActionLabel), child: const Text(retryActionLabel),
); );
} }
return FilledButton( return OutlinedButton(
key: retryActionKey, key: retryActionKey,
onPressed: _open, onPressed: _open,
child: const Text(retryActionLabel), child: const Text(retryActionLabel),
@@ -81,7 +81,8 @@ class _RunTitleActionState extends State<RunTitleAction> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (runTitleId(widget.run) == null) return const SizedBox.shrink(); if (runTitleId(widget.run) == null) return const SizedBox.shrink();
if (_usesCupertino(context)) { if (_usesCupertino(context)) {
return CupertinoButton( return CupertinoButton.tinted(
sizeStyle: CupertinoButtonSize.small,
key: runTitleActionKey, key: runTitleActionKey,
onPressed: _open, onPressed: _open,
child: const Text(runTitleActionLabel), child: const Text(runTitleActionLabel),
@@ -62,7 +62,7 @@ class RunChangesButton extends StatelessWidget {
), ),
); );
} }
return FilledButton.tonalIcon( return OutlinedButton.icon(
key: runChangesButtonKey, key: runChangesButtonKey,
onPressed: open, onPressed: open,
icon: const Icon(Icons.difference_outlined), icon: const Icon(Icons.difference_outlined),
@@ -33,7 +33,9 @@ class RunDetailActions extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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 // Only actions that render are included: a hidden zero-size child still
// consumes Wrap spacing and would double the visible gap. // consumes Wrap spacing and would double the visible gap.
Wrap( Wrap(
@@ -71,7 +71,8 @@ class _ScheduleRunActionState extends State<ScheduleRunAction> {
if (!canScheduleRun(widget.run)) return const SizedBox.shrink(); if (!canScheduleRun(widget.run)) return const SizedBox.shrink();
final cupertino = usesCupertinoHost(context); final cupertino = usesCupertinoHost(context);
final action = cupertino final action = cupertino
? CupertinoButton( ? CupertinoButton.tinted(
sizeStyle: CupertinoButtonSize.small,
key: scheduleRunActionKey, key: scheduleRunActionKey,
onPressed: _open, onPressed: _open,
child: const Text(scheduleRunActionLabel), child: const Text(scheduleRunActionLabel),
@@ -65,7 +65,8 @@ void main() {
); );
expect(find.byKey(cancelActionKey), findsOneWidget); 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); expect(gateway.calls, isEmpty);
await tester.tap(find.byKey(cancelActionKey)); await tester.tap(find.byKey(cancelActionKey));
@@ -116,7 +117,7 @@ void main() {
expect(find.byKey(cancelActionKey), findsOneWidget); expect(find.byKey(cancelActionKey), findsOneWidget);
expect(find.byType(CupertinoButton), findsOneWidget); expect(find.byType(CupertinoButton), findsOneWidget);
expect(find.byType(FilledButton), findsNothing); expect(find.byType(OutlinedButton), findsNothing);
await tester.tap(find.byKey(cancelActionKey)); await tester.tap(find.byKey(cancelActionKey));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
@@ -67,7 +67,8 @@ void main() {
await pumpRetry(tester, gateway: gateway, changed: changed); await pumpRetry(tester, gateway: gateway, changed: changed);
expect(find.byKey(retryActionKey), findsOneWidget); 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); expect(gateway.calls, isEmpty);
await tester.tap(find.byKey(retryActionKey)); await tester.tap(find.byKey(retryActionKey));
@@ -162,7 +163,7 @@ void main() {
expect(find.byKey(retryActionKey), findsOneWidget); expect(find.byKey(retryActionKey), findsOneWidget);
expect(find.byType(CupertinoButton), findsOneWidget); expect(find.byType(CupertinoButton), findsOneWidget);
expect(find.byType(FilledButton), findsNothing); expect(find.byType(OutlinedButton), findsNothing);
await tester.tap(find.byKey(retryActionKey)); await tester.tap(find.byKey(retryActionKey));
await tester.pumpAndSettle(); await tester.pumpAndSettle();