From 773653f2700b93082889de4deb7e8e32fd618b1d Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Sat, 31 Oct 2026 00:36:17 +0000 Subject: [PATCH 1/3] polish runs and pipelines lists --- .../widgets/pipeline_list_panel.dart | 23 +++++ app/lib/features/runs/ui/run_more_menu.dart | 8 +- app/lib/features/runs/ui/runs_list.dart | 87 +++++++++++++++++-- .../pipeline_list_composition_test.dart | 10 ++- .../features/runs/ui/run_list_row_test.dart | 45 ++++++++++ 5 files changed, 162 insertions(+), 11 deletions(-) diff --git a/app/lib/features/pipelines/widgets/pipeline_list_panel.dart b/app/lib/features/pipelines/widgets/pipeline_list_panel.dart index e64d9c07..36efa302 100644 --- a/app/lib/features/pipelines/widgets/pipeline_list_panel.dart +++ b/app/lib/features/pipelines/widgets/pipeline_list_panel.dart @@ -139,6 +139,12 @@ class PipelineListPanel extends StatelessWidget { child: Column( mainAxisSize: MainAxisSize.min, children: [ + Icon( + useCupertinoControls(context) + ? CupertinoIcons.flowchart + : Icons.account_tree_outlined, + ), + const SizedBox(height: 12), const PipelineProgress(label: 'Loading pipelines'), for (final message in messages) Padding( @@ -158,6 +164,12 @@ class PipelineListPanel extends StatelessWidget { child: Column( mainAxisSize: MainAxisSize.min, children: [ + Icon( + useCupertinoControls(context) + ? CupertinoIcons.tray + : Icons.inbox_outlined, + ), + const SizedBox(height: 12), Text( empty.message, textAlign: TextAlign.center, @@ -193,6 +205,7 @@ class PipelineListPanel extends StatelessWidget { horizontal: kPipelineListInset, ), visualDensity: VisualDensity.compact, + leading: _pipelineIdentityIcon(context), title: _rowTitle(context, pipeline), subtitle: _rowMetadata(context, pipeline, now), ); @@ -216,6 +229,7 @@ class PipelineListPanel extends StatelessWidget { backgroundColor: controller.selectedId == pipeline.id ? CupertinoColors.tertiarySystemFill.resolveFrom(context) : null, + leading: _pipelineIdentityIcon(context), title: _rowTitle(context, pipeline), subtitle: _rowMetadata(context, pipeline, now), trailing: const CupertinoListTileChevron(), @@ -372,6 +386,15 @@ class PipelineListPanel extends StatelessWidget { color: theme.colorScheme.onSurfaceVariant, ); } + + Widget _pipelineIdentityIcon(BuildContext context) => Semantics( + label: 'Pipeline', + child: Icon( + useCupertinoControls(context) + ? CupertinoIcons.flowchart + : Icons.account_tree_outlined, + ), + ); } /// The row's recorded flow cue: label-free stage boxes and their routes. diff --git a/app/lib/features/runs/ui/run_more_menu.dart b/app/lib/features/runs/ui/run_more_menu.dart index 124fc86f..00cffee8 100644 --- a/app/lib/features/runs/ui/run_more_menu.dart +++ b/app/lib/features/runs/ui/run_more_menu.dart @@ -38,6 +38,7 @@ class RunMoreMenu extends StatefulWidget { required this.onRunChanged, required this.cupertino, this.onRunOpened, + this.menuKey = runMoreMenuKey, }); final JsonMap run; @@ -48,6 +49,9 @@ class RunMoreMenu extends StatefulWidget { /// Opens the new run an accepted retry names. final ValueChanged? onRunOpened; + /// Detail menus retain the shared key; list rows supply a per-run key. + final Key menuKey; + @override State createState() => _RunMoreMenuState(); } @@ -93,7 +97,7 @@ class _RunMoreMenuState extends State { if (items.isEmpty) return const SizedBox.shrink(); if (!widget.cupertino) { return PopupMenuButton<_RunMoreItem>( - key: runMoreMenuKey, + key: widget.menuKey, icon: const Icon(Icons.more_vert), tooltip: 'More actions', onSelected: (item) => _pick(context, item), @@ -108,7 +112,7 @@ class _RunMoreMenuState extends State { label: 'More actions', excludeSemantics: true, child: CupertinoButton( - key: runMoreMenuKey, + key: widget.menuKey, padding: EdgeInsets.zero, minimumSize: const Size.square(kMinInteractiveDimensionCupertino), onPressed: () async { diff --git a/app/lib/features/runs/ui/runs_list.dart b/app/lib/features/runs/ui/runs_list.dart index ddca99aa..c53b6b90 100644 --- a/app/lib/features/runs/ui/runs_list.dart +++ b/app/lib/features/runs/ui/runs_list.dart @@ -13,6 +13,7 @@ import '../../attention/ui/needs_you_runs_heading.dart'; import '../domain/run_models.dart'; import '../../../shell/shell_bar.dart'; import 'run_path_mini.dart'; +import 'run_more_menu.dart'; import 'runs_controller.dart'; import 'runs_stats_page.dart'; import 'runs_filters.dart'; @@ -100,10 +101,12 @@ class RunsList extends StatelessWidget { Widget _list(BuildContext context) { if (controller.loading && controller.runs.isEmpty) { - return Center( - child: usesCupertinoHost(context) + return _state( + context, + icon: usesCupertinoHost(context) ? const CupertinoActivityIndicator() : const CircularProgressIndicator(), + title: 'Loading runs…', ); } if (controller.error != null && controller.runs.isEmpty) { @@ -116,7 +119,16 @@ class RunsList extends StatelessWidget { RunsFilters(controller: controller), Expanded( child: controller.visibleRuns.isEmpty - ? const Center(child: Text('No runs found.')) + ? _state( + context, + icon: Icon( + usesCupertinoHost(context) + ? CupertinoIcons.tray + : Icons.inbox_outlined, + ), + title: 'No runs found.', + subtitle: 'Try changing or clearing the filters.', + ) : _groupedRuns(context), ), ], @@ -164,6 +176,12 @@ class RunsList extends StatelessWidget { child: Column( mainAxisSize: MainAxisSize.min, children: [ + Icon( + usesCupertinoHost(context) + ? CupertinoIcons.exclamationmark_triangle + : Icons.error_outline, + ), + const SizedBox(height: 8), Text(controller.error!), const SizedBox(height: 8), usesCupertinoHost(context) @@ -179,6 +197,37 @@ class RunsList extends StatelessWidget { ), ); + Widget _state( + BuildContext context, { + required Widget icon, + required String title, + String? subtitle, + }) => Center( + child: Padding( + padding: const EdgeInsets.all(24), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + icon, + const SizedBox(height: 12), + Text(title, textAlign: TextAlign.center), + if (subtitle != null) ...[ + const SizedBox(height: 4), + Text( + subtitle, + textAlign: TextAlign.center, + style: TextStyle( + color: usesCupertinoHost(context) + ? CupertinoColors.secondaryLabel.resolveFrom(context) + : Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + ], + ], + ), + ), + ); + Widget _inlineError(BuildContext context) => Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: Row( @@ -202,6 +251,9 @@ class RunsList extends StatelessWidget { selected: id == controller.selectedRunId, now: DateTime.now(), onTap: id is num ? () => onSelected(id) : null, + gateway: controller.repository.gateway, + onRunChanged: controller.acceptRunDetail, + onRunOpened: onSelected, ); } } @@ -216,12 +268,18 @@ class RunListRow extends StatelessWidget { required this.now, this.selected = false, this.onTap, + this.gateway, + this.onRunChanged, + this.onRunOpened, }); final JsonMap run; final DateTime now; final bool selected; final VoidCallback? onTap; + final ApiGateway? gateway; + final ValueChanged? onRunChanged; + final ValueChanged? onRunOpened; @override Widget build(BuildContext context) { @@ -233,6 +291,14 @@ class RunListRow extends StatelessWidget { // A run without its own title is named by its pipeline, so the pipeline // line does not repeat it. final pipeline = identity.pipeline?.trim(); + // With no stored title, `name` is already the row title; repeating it as + // a subtitle adds no identity. A titled run with an empty name genuinely + // lacks its pipeline, so make that absence explicit. + final pipelineLabel = pipeline == null + ? null + : pipeline.isEmpty + ? 'Pipeline unavailable' + : pipeline; final secondary = cupertino ? CupertinoColors.secondaryLabel.resolveFrom(context) : Theme.of(context).colorScheme.onSurfaceVariant; @@ -307,11 +373,7 @@ class RunListRow extends StatelessWidget { line(title, id == null ? null : '#$id', titleStyle), const SizedBox(height: 2), line( - [ - if (pipeline != null) - pipeline.isEmpty ? 'Pipeline unavailable' : pipeline, - if (scheduled) 'Scheduled', - ].join(' · '), + [?pipelineLabel, if (scheduled) 'Scheduled'].join(' · '), facts.duration, small, ), @@ -327,6 +389,15 @@ class RunListRow extends StatelessWidget { ], ), ), + if (gateway != null && onRunChanged != null && showRunMoreMenu(run)) + RunMoreMenu( + run: run, + gateway: gateway!, + onRunChanged: onRunChanged!, + onRunOpened: onRunOpened, + cupertino: cupertino, + menuKey: ValueKey('run-list-more-menu-$id'), + ), ], ); final padded = Padding( diff --git a/app/test/features/pipelines/pipeline_list_composition_test.dart b/app/test/features/pipelines/pipeline_list_composition_test.dart index 78555698..0c45f550 100644 --- a/app/test/features/pipelines/pipeline_list_composition_test.dart +++ b/app/test/features/pipelines/pipeline_list_composition_test.dart @@ -23,10 +23,18 @@ void main() { // Filter and sort are app-bar actions; no toolbar row without a filter. expect(find.byKey(const Key('pipeline-toolbar')), findsNothing); + // A native leading flow icon gives each pipeline a durable identity while + // the title follows its normal ListTile spacing. + expect(find.byIcon(Icons.account_tree_outlined), findsNWidgets(3)); expect( - tester.getTopLeft(find.text('Alpha review')).dx - listLeft, + tester.getTopLeft(find.byIcon(Icons.account_tree_outlined).first).dx - + listLeft, kPipelineListInset, ); + expect( + tester.getTopLeft(find.text('Alpha review')).dx, + greaterThan(listLeft), + ); expect( find.descendant(of: list, matching: find.byType(Divider)), diff --git a/app/test/features/runs/ui/run_list_row_test.dart b/app/test/features/runs/ui/run_list_row_test.dart index a1b3ef67..1759b50c 100644 --- a/app/test/features/runs/ui/run_list_row_test.dart +++ b/app/test/features/runs/ui/run_list_row_test.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/features/runs/domain/run_models.dart'; +import 'package:pipelines_app/features/runs/ui/run_more_menu.dart'; import 'package:pipelines_app/features/runs/ui/runs_list.dart'; final _finished = { @@ -14,6 +16,14 @@ final _finished = { 'completed_steps': 3, }; +class _FakeGateway implements ApiGateway { + @override + Future call(String type, [JsonMap fields = const {}]) async => {}; + + @override + Stream get frames => const Stream.empty(); +} + void main() { test('row facts: when, how long and how far', () { final facts = runRowFacts(_finished, DateTime.utc(2026, 10, 22)); @@ -59,4 +69,39 @@ void main() { expect(right.right, greaterThan(800 - 32)); } }); + + testWidgets('uses a muted pipeline fallback only when it is absent', ( + tester, + ) async { + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: RunListRow( + run: {..._finished, 'name': ''}, + now: DateTime.utc(2026, 10, 22), + ), + ), + ), + ); + + expect(find.text('Pipeline unavailable'), findsOneWidget); + }); + + testWidgets('gives a list action menu a per-run key', (tester) async { + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: RunListRow( + run: _finished, + now: DateTime.utc(2026, 10, 22), + gateway: _FakeGateway(), + onRunChanged: (_) {}, + ), + ), + ), + ); + + expect(find.byKey(const ValueKey('run-list-more-menu-42')), findsOneWidget); + expect(find.byKey(runMoreMenuKey), findsNothing); + }); } From 63fb903518534de0bd86d74a0607a227319eef49 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Sat, 31 Oct 2026 00:55:11 +0000 Subject: [PATCH 2/3] style(app): apply dart format to chat conversation files Formatter-only output (verified identical to dart format of the previous tree), committed so pipeline deliveries see a clean checkout. --- .../chat/conversation/chat_card_styles.dart | 9 ++++--- .../chat_question_card_fields.dart | 5 +--- .../chat_question_card_model.dart | 3 +-- .../chat_question_recorded_answers.dart | 7 +----- .../chat/conversation/chat_scroll.dart | 4 +++- .../chat/conversation/chat_thread_cards.dart | 6 ++--- .../app_lifecycle_reconnect_test.dart | 24 +++++++++++-------- 7 files changed, 26 insertions(+), 32 deletions(-) diff --git a/app/lib/features/chat/conversation/chat_card_styles.dart b/app/lib/features/chat/conversation/chat_card_styles.dart index 65135523..d2b12f58 100644 --- a/app/lib/features/chat/conversation/chat_card_styles.dart +++ b/app/lib/features/chat/conversation/chat_card_styles.dart @@ -8,8 +8,7 @@ import 'package:flutter/material.dart'; /// style. Keeping the styles here stops each card file from inventing its own /// size and colour; everything still comes from the active Material/Cupertino /// theme, so light, dark and text scaling follow the host. -TextStyle? chatCardTitleStyle(BuildContext context, bool cupertino) => - cupertino +TextStyle? chatCardTitleStyle(BuildContext context, bool cupertino) => cupertino ? CupertinoTheme.of(context).textTheme.navTitleTextStyle : Theme.of(context).textTheme.titleMedium; @@ -21,9 +20,9 @@ TextStyle? chatCardBodyStyle(BuildContext context, bool cupertino) => cupertino /// (the same subordinate style the rest of the app uses for secondary copy) /// keeps labels from reading as extra headings; Material keeps `titleSmall`. TextStyle? chatCardLabelStyle(BuildContext context, bool cupertino) => cupertino - ? CupertinoTheme.of( - context, - ).textTheme.tabLabelTextStyle.copyWith(color: chatCardSecondaryColor(context, true)) + ? CupertinoTheme.of(context).textTheme.tabLabelTextStyle.copyWith( + color: chatCardSecondaryColor(context, true), + ) : Theme.of(context).textTheme.titleSmall; /// Body text that supports a control, such as a field description. diff --git a/app/lib/features/chat/conversation/chat_question_card_fields.dart b/app/lib/features/chat/conversation/chat_question_card_fields.dart index 5577149f..c227f5a1 100644 --- a/app/lib/features/chat/conversation/chat_question_card_fields.dart +++ b/app/lib/features/chat/conversation/chat_question_card_fields.dart @@ -63,10 +63,7 @@ Widget _field({ children: [ Text(label, style: chatCardLabelStyle(context, cupertino)), if (description.isNotEmpty && description != title) - Text( - description, - style: chatCardSecondaryStyle(context, cupertino), - ), + Text(description, style: chatCardSecondaryStyle(context, cupertino)), if ('${field['type'] ?? ''}' == 'external') _external(context, field, cupertino) else if ('${field['type'] ?? ''}' == 'boolean') diff --git a/app/lib/features/chat/conversation/chat_question_card_model.dart b/app/lib/features/chat/conversation/chat_question_card_model.dart index d86a527f..e8a07f39 100644 --- a/app/lib/features/chat/conversation/chat_question_card_model.dart +++ b/app/lib/features/chat/conversation/chat_question_card_model.dart @@ -44,8 +44,7 @@ Object? chatFormFieldValue(JsonMap field, String raw) { case 'integer': final parsed = num.tryParse(raw); if (parsed == null) return double.nan; - final integral = - parsed.isFinite && parsed == parsed.roundToDouble(); + final integral = parsed.isFinite && parsed == parsed.roundToDouble(); return type == 'integer' && integral ? parsed.toInt() : parsed; default: return raw; diff --git a/app/lib/features/chat/conversation/chat_question_recorded_answers.dart b/app/lib/features/chat/conversation/chat_question_recorded_answers.dart index 1009ca32..2c0429bb 100644 --- a/app/lib/features/chat/conversation/chat_question_recorded_answers.dart +++ b/app/lib/features/chat/conversation/chat_question_recorded_answers.dart @@ -33,12 +33,7 @@ List chatQuestionRecordedAnswers({ for (final entry in answers.entries) { if (shown.contains(entry.key)) continue; widgets.add( - _recorded( - context, - entry.key, - _answerText(null, entry.value), - cupertino, - ), + _recorded(context, entry.key, _answerText(null, entry.value), cupertino), ); } if (widgets.isEmpty) { diff --git a/app/lib/features/chat/conversation/chat_scroll.dart b/app/lib/features/chat/conversation/chat_scroll.dart index 90334da5..20d3acc4 100644 --- a/app/lib/features/chat/conversation/chat_scroll.dart +++ b/app/lib/features/chat/conversation/chat_scroll.dart @@ -65,7 +65,9 @@ int chatNewMessageCount(List messageIds, String? newestAtRelease) { /// native client adds while the operator is reading above the end. String chatJumpToLatestLabel(int newMessages) { if (newMessages <= 0) return 'Jump to latest'; - final suffix = newMessages == 1 ? '1 new message' : '$newMessages new messages'; + final suffix = newMessages == 1 + ? '1 new message' + : '$newMessages new messages'; return 'Jump to latest · $suffix'; } diff --git a/app/lib/features/chat/conversation/chat_thread_cards.dart b/app/lib/features/chat/conversation/chat_thread_cards.dart index 12946988..5fb6efd6 100644 --- a/app/lib/features/chat/conversation/chat_thread_cards.dart +++ b/app/lib/features/chat/conversation/chat_thread_cards.dart @@ -44,8 +44,7 @@ class ChatThreadCards { String answerFor(String requestId) => _answers[requestId] ?? ''; - String? permissionErrorFor(String requestId) => - _permissionErrors[requestId]; + String? permissionErrorFor(String requestId) => _permissionErrors[requestId]; String? formErrorFor(String formId) => _formErrors[formId]; @@ -105,8 +104,7 @@ class ChatThreadCards { _forms[id] = { ...form, 'resolved': true, - if (answers.isNotEmpty) - 'answers': Map.from(answers), + if (answers.isNotEmpty) 'answers': Map.from(answers), }; _pruneSettledForms(); notify(); diff --git a/app/test/application/app_lifecycle_reconnect_test.dart b/app/test/application/app_lifecycle_reconnect_test.dart index 44d76547..45bea855 100644 --- a/app/test/application/app_lifecycle_reconnect_test.dart +++ b/app/test/application/app_lifecycle_reconnect_test.dart @@ -165,11 +165,13 @@ void main() { await pumpApp(tester, provider: provider, client: client); await waitForRequest(tester, channel, 'list_runs'); final initialRuns = pipelineRequest(channel, 'list_runs')!; - channel.incoming.add(jsonEncode({ - 'id': initialRuns['id'], - 'type': 'runs', - 'runs': PipelineFixture().runs, - })); + channel.incoming.add( + jsonEncode({ + 'id': initialRuns['id'], + 'type': 'runs', + 'runs': PipelineFixture().runs, + }), + ); await tester.pump(); final before = countType(channel, 'list_runs'); showDialog( @@ -198,11 +200,13 @@ void main() { await pumpApp(tester, provider: provider, client: client); await waitForRequest(tester, channel, 'list_runs'); final initialRuns = pipelineRequest(channel, 'list_runs')!; - channel.incoming.add(jsonEncode({ - 'id': initialRuns['id'], - 'type': 'runs', - 'runs': PipelineFixture().runs, - })); + channel.incoming.add( + jsonEncode({ + 'id': initialRuns['id'], + 'type': 'runs', + 'runs': PipelineFixture().runs, + }), + ); await tester.pump(); final before = countType(channel, 'list_runs'); showDialog( From 2542791a828c20574489b88123b02c6f51fa161d Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Sat, 31 Oct 2026 01:03:47 +0000 Subject: [PATCH 3/3] fix(app): keep the polished run and pipeline lists usable in narrow panes Run #196 landed list polish that broke a 640px window: the list pane is ~127px there, so the new pipeline icon overflowed, the run row's centre landed on its new actions menu (a tap opened the menu instead of the run), and the new loading/empty states overflowed short panes. Narrow pipeline rows drop the icon and chevron, run rows show their menu only from 280px (the detail carries it), and the state blocks scroll. --- .../widgets/pipeline_list_panel.dart | 46 +++++++------ app/lib/features/runs/ui/runs_list.dart | 65 ++++++++++++------- 2 files changed, 67 insertions(+), 44 deletions(-) diff --git a/app/lib/features/pipelines/widgets/pipeline_list_panel.dart b/app/lib/features/pipelines/widgets/pipeline_list_panel.dart index 36efa302..5ee9175f 100644 --- a/app/lib/features/pipelines/widgets/pipeline_list_panel.dart +++ b/app/lib/features/pipelines/widgets/pipeline_list_panel.dart @@ -127,11 +127,21 @@ class PipelineListPanel extends StatelessWidget { if (empty == null) return const SizedBox.shrink(); return _empty(context, empty); } - return useCupertinoControls(context) - ? _cupertinoList(context, items) - : _materialList(context, items); + // A list pane beside a detail can be very narrow (a 640px window leaves + // it ~130px): there the rows drop the identity icon and chevron so the + // name keeps the width. + return LayoutBuilder( + builder: (context, constraints) { + final compact = constraints.maxWidth < _compactRowWidth; + return useCupertinoControls(context) + ? _cupertinoList(context, items, compact: compact) + : _materialList(context, items, compact: compact); + }, + ); } + static const double _compactRowWidth = 220; + Widget _centered(BuildContext context, List messages) { return Center( child: Padding( @@ -139,12 +149,6 @@ class PipelineListPanel extends StatelessWidget { child: Column( mainAxisSize: MainAxisSize.min, children: [ - Icon( - useCupertinoControls(context) - ? CupertinoIcons.flowchart - : Icons.account_tree_outlined, - ), - const SizedBox(height: 12), const PipelineProgress(label: 'Loading pipelines'), for (final message in messages) Padding( @@ -164,12 +168,6 @@ class PipelineListPanel extends StatelessWidget { child: Column( mainAxisSize: MainAxisSize.min, children: [ - Icon( - useCupertinoControls(context) - ? CupertinoIcons.tray - : Icons.inbox_outlined, - ), - const SizedBox(height: 12), Text( empty.message, textAlign: TextAlign.center, @@ -186,7 +184,11 @@ class PipelineListPanel extends StatelessWidget { ); } - Widget _materialList(BuildContext context, List items) { + Widget _materialList( + BuildContext context, + List items, { + required bool compact, + }) { final now = DateTime.now(); return ListView.separated( key: const Key('pipeline-list'), @@ -205,7 +207,7 @@ class PipelineListPanel extends StatelessWidget { horizontal: kPipelineListInset, ), visualDensity: VisualDensity.compact, - leading: _pipelineIdentityIcon(context), + leading: compact ? null : _pipelineIdentityIcon(context), title: _rowTitle(context, pipeline), subtitle: _rowMetadata(context, pipeline, now), ); @@ -213,7 +215,11 @@ class PipelineListPanel extends StatelessWidget { ); } - Widget _cupertinoList(BuildContext context, List items) { + Widget _cupertinoList( + BuildContext context, + List items, { + required bool compact, + }) { final now = DateTime.now(); return ListView( key: const Key('pipeline-list'), @@ -229,10 +235,10 @@ class PipelineListPanel extends StatelessWidget { backgroundColor: controller.selectedId == pipeline.id ? CupertinoColors.tertiarySystemFill.resolveFrom(context) : null, - leading: _pipelineIdentityIcon(context), + leading: compact ? null : _pipelineIdentityIcon(context), title: _rowTitle(context, pipeline), subtitle: _rowMetadata(context, pipeline, now), - trailing: const CupertinoListTileChevron(), + trailing: compact ? null : const CupertinoListTileChevron(), onTap: () => controller.openPipeline( pipeline.id, version: pipeline.version, diff --git a/app/lib/features/runs/ui/runs_list.dart b/app/lib/features/runs/ui/runs_list.dart index c53b6b90..5956e6eb 100644 --- a/app/lib/features/runs/ui/runs_list.dart +++ b/app/lib/features/runs/ui/runs_list.dart @@ -173,27 +173,30 @@ class RunsList extends StatelessWidget { } Widget _emptyError(BuildContext context) => Center( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Icon( + child: SingleChildScrollView( + padding: const EdgeInsets.symmetric(horizontal: 24), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + usesCupertinoHost(context) + ? CupertinoIcons.exclamationmark_triangle + : Icons.error_outline, + ), + const SizedBox(height: 8), + Text(controller.error!), + const SizedBox(height: 8), usesCupertinoHost(context) - ? CupertinoIcons.exclamationmark_triangle - : Icons.error_outline, - ), - const SizedBox(height: 8), - Text(controller.error!), - const SizedBox(height: 8), - usesCupertinoHost(context) - ? CupertinoButton( - onPressed: controller.load, - child: const Text('Retry'), - ) - : FilledButton( - onPressed: controller.load, - child: const Text('Retry'), - ), - ], + ? CupertinoButton( + onPressed: controller.load, + child: const Text('Retry'), + ) + : FilledButton( + onPressed: controller.load, + child: const Text('Retry'), + ), + ], + ), ), ); @@ -203,7 +206,9 @@ class RunsList extends StatelessWidget { required String title, String? subtitle, }) => Center( - child: Padding( + // A short pane (a list beside a detail, or the keyboard up) scrolls the + // state instead of overflowing it. + child: SingleChildScrollView( padding: const EdgeInsets.all(24), child: Column( mainAxisSize: MainAxisSize.min, @@ -262,6 +267,9 @@ class RunsList extends StatelessWidget { /// number on top, the pipeline and duration below, then when it ran and how /// far it got. class RunListRow extends StatelessWidget { + /// The narrowest row that still shows its own actions menu. + static const double _menuMinRowWidth = 280; + const RunListRow({ super.key, required this.run, @@ -356,7 +364,7 @@ class RunListRow extends StatelessWidget { }, ); final scheduled = run['scheduled'] == true; - final body = Row( + Widget body(bool withMenu) => Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( @@ -389,7 +397,10 @@ class RunListRow extends StatelessWidget { ], ), ), - if (gateway != null && onRunChanged != null && showRunMoreMenu(run)) + if (withMenu && + gateway != null && + onRunChanged != null && + showRunMoreMenu(run)) RunMoreMenu( run: run, gateway: gateway!, @@ -400,9 +411,15 @@ class RunListRow extends StatelessWidget { ), ], ); + // A narrow list pane beside the open run leaves the row no room for a + // second control (a tap on its centre would land on the menu); the open + // run's detail beside it carries the same menu. final padded = Padding( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10), - child: body, + child: LayoutBuilder( + builder: (context, constraints) => + body(constraints.maxWidth >= _menuMinRowWidth), + ), ); return Semantics( selected: selected,