Share one list row across runs, pipelines, chat, search and schedules

AppListRow (Material + Cupertino) with avatar, bold title and trailing
time, one muted line, one overflow menu style, inset dividers, selected
and emphasised states and a compact mode. Pipelines get a legible initial
avatar, schedule rows shrink to two lines with Edit/Pause/Delete in an
overflow menu, and the shell chat list scrolls behind the bar.
This commit is contained in:
2026-10-31 04:15:01 +00:00
parent 6ab8551348
commit 3c56db37fd
38 changed files with 1841 additions and 1520 deletions
@@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/ui/layout/app_list_row.dart';
import 'package:pipelines_app/features/pipelines/screen.dart';
import 'package:pipelines_app/shell/detail_page.dart';
@@ -24,17 +25,32 @@ void main() {
// Filter and sort are app-bar actions; no toolbar row without a filter.
expect(find.byKey(const Key('pipeline-toolbar')), findsNothing);
// Each pipeline has a deterministic tinted initial rather than one generic
// flow icon, while the title follows native ListTile spacing.
// flow icon, while the title follows the shared row's spacing.
expect(find.byKey(const Key('pipeline-avatar-1')), findsOneWidget);
expect(
tester.getTopLeft(find.text('Alpha review')).dx,
greaterThan(listLeft),
);
// Inset dividers between rows, none after the last.
expect(
find.descendant(of: list, matching: find.byType(Divider)),
find.descendant(of: list, matching: find.byKey(appListRowDividerKey)),
findsNWidgets(fixture.summaries.length - 1),
);
// The divider starts under the title, not at the list edge.
expect(
tester.getTopLeft(find.byKey(appListRowDividerKey).first).dx,
closeTo(tester.getTopLeft(find.text('Alpha review')).dx, 1),
);
// The initial is legible: a 40px circle with a large glyph.
final avatar = find.byKey(const Key('pipeline-avatar-1'));
expect(tester.getSize(avatar), const Size.square(40));
expect(
tester
.getSize(find.descendant(of: avatar, matching: find.text('A')))
.height,
greaterThanOrEqualTo(14),
);
// The title's trailing time and the one muted facts line replace the old
// version/id, run metadata, and graph stack.
@@ -196,7 +212,7 @@ void main() {
expect(tester.takeException(), isNull);
});
testWidgets('Cupertino keeps native tiles with the same row identity', (
testWidgets('Cupertino keeps the shared row with the same row identity', (
tester,
) async {
debugDefaultTargetPlatformOverride = TargetPlatform.iOS;
@@ -211,7 +227,12 @@ void main() {
);
await tester.pumpAndSettle();
expect(find.byType(CupertinoListTile), findsWidgets);
expect(
tester
.widget<AppListRow>(find.byKey(const Key('pipeline-row-1')))
.cupertino,
isTrue,
);
expect(find.text('2 stages · 1 schedule'), findsOneWidget);
expect(find.textContaining('v2 · #'), findsNothing);
expect(find.byKey(const Key('pipeline-avatar-1')), findsOneWidget);
@@ -61,13 +61,18 @@ void main() {
expect(find.text('Schedules (1)'), findsOneWidget);
expect(find.text('Research batteries'), findsOneWidget);
expect(
find.text('Every 24h · mon, wed · Europe/London'),
find.text('v3 · Every 24h · mon, wed · Europe/London'),
findsOneWidget,
);
expect(find.byKey(scheduleAddKey), findsOneWidget);
// Edit, Pause and Delete are the row's overflow menu.
await tester.tap(find.byKey(scheduleRowMenuKey(8)));
await tester.pumpAndSettle();
expect(find.byKey(scheduleRowEditKey(8)), findsOneWidget);
expect(find.byKey(scheduleRowToggleKey(8)), findsOneWidget);
expect(find.byKey(scheduleRowDeleteKey(8)), findsOneWidget);
await tester.tapAt(const Offset(4, 4));
await tester.pumpAndSettle();
expect(gateway.callsOf('list_schedules').single.fields, {'pipeline_id': 1});
await tester.tap(find.text('Source'));
@@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/ui/layout/app_list_row.dart';
import '../../native_back.dart';
import 'package:pipelines_app/features/graph/widgets/definition_graph_view.dart';
import 'package:pipelines_app/features/pipelines/pipeline_repository.dart';
@@ -122,7 +123,13 @@ void main() {
await tester.pumpAndSettle();
expect(find.byType(CupertinoPageScaffold), findsOneWidget);
expect(find.byType(CupertinoListTile), findsWidgets);
// The shared list row, in its Cupertino form.
expect(
tester
.widget<AppListRow>(find.byKey(const Key('pipeline-row-1')))
.cupertino,
isTrue,
);
expect(find.byType(CupertinoActionSheet), findsNothing);
await tester.tap(find.byKey(const Key('pipeline-row-1')));
await tester.pumpAndSettle();
@@ -2,6 +2,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/ui/layout/app_list_row.dart';
import 'package:pipelines_app/features/pipelines/ui/run_pipeline_wording.dart';
import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/pipelines/screen.dart';
@@ -129,7 +130,7 @@ void main() {
await tester.tap(find.byTooltip('Refresh'));
await tester.pumpAndSettle();
final row = tester.widget<ListTile>(
final row = tester.widget<AppListRow>(
find.byKey(const Key('pipeline-row-1')),
);
expect(row.selected, isTrue);