From f19b7a85a8c08b9a12515b05547cff1859e7971e Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Fri, 23 Oct 2026 13:06:57 +0100 Subject: [PATCH] feat(app): run detail leads with the web's status kicker --- .../runs/ui/run_detail_cupertino.dart | 7 ++++- .../features/runs/ui/run_detail_material.dart | 12 +++++++- app/lib/ui/status/run_status_icon.dart | 29 +++++++++++++++++++ .../runs/ui/run_detail_widget_test.dart | 7 ++++- 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/app/lib/features/runs/ui/run_detail_cupertino.dart b/app/lib/features/runs/ui/run_detail_cupertino.dart index 072195cc..7ecb30c8 100644 --- a/app/lib/features/runs/ui/run_detail_cupertino.dart +++ b/app/lib/features/runs/ui/run_detail_cupertino.dart @@ -1,6 +1,7 @@ import 'package:flutter/cupertino.dart'; import '../../../core/api_gateway.dart'; +import '../../../ui/status/run_status_icon.dart'; import '../domain/run_models.dart'; import 'run_changes_action.dart'; import 'run_detail_content.dart'; @@ -71,12 +72,16 @@ Widget buildCupertinoRunDetail({ child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + RunStatusKicker( + state: runStateOf(run['status']), + label: runStatusLabel(run), + ), + const SizedBox(height: 4), Text( detailTitle(run), style: theme.textTheme.navLargeTitleTextStyle, ), const SizedBox(height: 4), - Text(runStatusLabel(run)), Text('Run ${run['id']} ยท Pipeline ${detailPipeline(run)}'), ], ), diff --git a/app/lib/features/runs/ui/run_detail_material.dart b/app/lib/features/runs/ui/run_detail_material.dart index d61c2d09..ea8b4ead 100644 --- a/app/lib/features/runs/ui/run_detail_material.dart +++ b/app/lib/features/runs/ui/run_detail_material.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import '../../../core/api_gateway.dart'; +import '../../../ui/status/run_status_icon.dart'; import '../domain/run_models.dart'; import 'run_changes_action.dart'; import 'run_detail_content.dart'; @@ -59,6 +60,16 @@ Widget buildMaterialRunDetail({ ), Padding( padding: const EdgeInsets.fromLTRB(16, 8, 16, 0), + child: Align( + alignment: AlignmentDirectional.centerStart, + child: RunStatusKicker( + state: runStateOf(run['status']), + label: runStatusLabel(run), + ), + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(16, 4, 16, 0), child: Text(detailTitle(run), style: theme.textTheme.headlineSmall), ), Padding( @@ -68,7 +79,6 @@ Widget buildMaterialRunDetail({ runSpacing: 4, crossAxisAlignment: WrapCrossAlignment.center, children: [ - Chip(label: Text(runStatusLabel(run))), Text('Run ${run['id']}'), Text('Pipeline ${detailPipeline(run)}'), headerActions, diff --git a/app/lib/ui/status/run_status_icon.dart b/app/lib/ui/status/run_status_icon.dart index 313f12d2..0fa1fc2b 100644 --- a/app/lib/ui/status/run_status_icon.dart +++ b/app/lib/ui/status/run_status_icon.dart @@ -71,3 +71,32 @@ IconData _cupertinoIcon(String state) => switch (state) { 'waiting' || 'queued' => CupertinoIcons.clock, _ => CupertinoIcons.question_circle, }; + +/// The run detail's kicker above its title, as the web's `run-kicker`: the +/// status glyph and the state word in the state's colour. +class RunStatusKicker extends StatelessWidget { + const RunStatusKicker({super.key, required this.state, required this.label}); + + final String state; + final String label; + + @override + Widget build(BuildContext context) { + final color = runStatusColor(state).resolveFrom(context); + return Row( + key: const Key('run-status-kicker'), + mainAxisSize: MainAxisSize.min, + children: [ + RunStatusIcon(state: state, label: label, size: 16), + const SizedBox(width: 6), + // A long state (`cancel requested`) wraps rather than overflowing a + // 320px pane at 2x text. + Flexible( + child: ExcludeSemantics( + child: Text(label, style: TextStyle(color: color)), + ), + ), + ], + ); + } +} diff --git a/app/test/features/runs/ui/run_detail_widget_test.dart b/app/test/features/runs/ui/run_detail_widget_test.dart index 337fa3c9..cd9697d8 100644 --- a/app/test/features/runs/ui/run_detail_widget_test.dart +++ b/app/test/features/runs/ui/run_detail_widget_test.dart @@ -147,8 +147,13 @@ void main() { expect(tester.takeException(), isNull); expect(find.text('Nightly build'), findsOneWidget); expect(find.textContaining('Original prompt'), findsOneWidget); + // Both hosts lead with the web's status kicker above the title. + expect(find.byKey(const Key('run-status-kicker')), findsOneWidget); + expect( + tester.getTopLeft(find.byKey(const Key('run-status-kicker'))).dy, + lessThan(tester.getTopLeft(find.text('Nightly build')).dy), + ); if (platform == AppPlatform.material) { - expect(find.byType(Chip), findsOneWidget); expect( tester.widget(find.byKey(const ValueKey('run-detail-summary-input'))), isA(),