Narrow list panes: readable bar title, More overflow menu, rows keep status and actions
The floating bar keeps the title at its own width (up to half the bar) and moves overflowable actions into one More menu instead of squeezing them below their touch targets. List rows keep their leading status avatar and More actions at any list-pane width; the time moves under the subtitle.
This commit is contained in:
@@ -4,6 +4,8 @@ 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';
|
||||
import 'package:pipelines_app/ui/status/run_status_icon.dart';
|
||||
import 'package:pipelines_app/ui/text/relative_time_label.dart';
|
||||
|
||||
final _finished = {
|
||||
'id': 42,
|
||||
@@ -108,29 +110,39 @@ void main() {
|
||||
expect(find.byKey(runMoreMenuKey), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('compact rows keep a title and one metadata line', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(240, 400);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: RunListRow(
|
||||
run: _finished,
|
||||
now: DateTime.utc(2026, 10, 22),
|
||||
gateway: _FakeGateway(),
|
||||
onRunChanged: (_) {},
|
||||
for (final status in ['succeeded', 'failed']) {
|
||||
testWidgets('a compact $status row keeps its status, menu and time', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(240, 400);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: RunListRow(
|
||||
run: {..._finished, 'status': status},
|
||||
now: DateTime.utc(2026, 10, 22),
|
||||
gateway: _FakeGateway(),
|
||||
onRunChanged: (_) {},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
);
|
||||
|
||||
expect(find.text('Ship the release notes'), findsOneWidget);
|
||||
expect(find.text('release'), findsOneWidget);
|
||||
expect(find.text('2m 5s'), findsNothing);
|
||||
expect(find.byKey(const ValueKey('run-list-more-menu-42')), findsNothing);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
expect(find.text('Ship the release notes'), findsOneWidget);
|
||||
expect(find.text('release'), findsOneWidget);
|
||||
expect(find.text('2m 5s'), findsNothing);
|
||||
// The status tells a failed run from a succeeded one at any width.
|
||||
final icon = find.byType(RunStatusIcon);
|
||||
expect(icon, findsOneWidget);
|
||||
expect(tester.widget<RunStatusIcon>(icon).state, status);
|
||||
final menu = find.byKey(const ValueKey('run-list-more-menu-42'));
|
||||
expect(menu, findsOneWidget);
|
||||
expect(tester.getRect(menu).right, lessThanOrEqualTo(240));
|
||||
expect(tester.getSize(menu).width, greaterThanOrEqualTo(44));
|
||||
expect(find.byType(RelativeTimeLabel), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user