App: run failure reasons, Run again, labelled tabs, actionable errors, nav fixes
- Run rows show a failed run's reason (else its diagnostic's first line, full text in a tooltip) or a short result preview; the Summary leads with "Why it failed". - Run again for succeeded/canceled/interrupted runs opens the New run form pre-filled (prompt, workspace, report format) at the latest version with the original offered. - Run detail and stage tabs show their names; touch shows captions on the Runs header and artifact viewer actions (desktop keeps tooltips). - ErrorNotice maps not connected / server too old / permission / timeout to what to do, raw detail behind Details (Schedules, create chat, Runs, Pipelines banners). - Settings has no Back arrow; Schedules keeps the rail on wide windows; phone Settings leads with Connection and Notifications and has a Jump to topic menu. - Walkthrough: Open Connection (skipped when connected), labelled Copy. - Pluralised counts; no duplicate status/rail names for screen readers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/settings/settings_phone_order.dart';
|
||||
import 'package:pipelines_app/features/settings/settings_search_page.dart';
|
||||
import 'package:pipelines_app/features/settings/settings_section.dart';
|
||||
|
||||
SettingsSection _section(String id, String title) => SettingsSection(
|
||||
id: id,
|
||||
title: title,
|
||||
keywords: '',
|
||||
builder: (_) => SizedBox(height: 400, child: Text('$title body')),
|
||||
);
|
||||
|
||||
/// A phone's Settings lead with Connection and Notifications and offer a
|
||||
/// "Jump to topic" menu; a wide window keeps its order and index column.
|
||||
void main() {
|
||||
final sections = [
|
||||
_section('interface-size', 'Interface size'),
|
||||
_section('font', 'Font'),
|
||||
_section('notifications', 'Notifications'),
|
||||
_section('connection', 'Connection'),
|
||||
_section('help', 'Help and about'),
|
||||
];
|
||||
|
||||
test('Connection, then Notifications, lead on a phone', () {
|
||||
expect(settingsPhoneOrder(sections).map((section) => section.id), [
|
||||
'connection',
|
||||
'notifications',
|
||||
'interface-size',
|
||||
'font',
|
||||
'help',
|
||||
]);
|
||||
});
|
||||
|
||||
Future<void> pumpAt(WidgetTester tester, double width) async {
|
||||
tester.view.physicalSize = Size(width, 800);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Scaffold(body: SettingsSearchPage(sections: sections)),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
testWidgets('a phone jumps to a topic from its menu', (tester) async {
|
||||
await pumpAt(tester, 390);
|
||||
final connection = tester.getTopLeft(find.text('Connection body')).dy;
|
||||
final size = tester.getTopLeft(find.text('Interface size body')).dy;
|
||||
expect(connection, lessThan(size));
|
||||
|
||||
await tester.tap(find.byKey(settingsTopicMenuKey));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Help and about').last);
|
||||
await tester.pumpAndSettle();
|
||||
expect(
|
||||
tester.getTopLeft(find.text('Help and about body')).dy,
|
||||
lessThan(400),
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('a wide window keeps its order and has no topic menu', (
|
||||
tester,
|
||||
) async {
|
||||
await pumpAt(tester, 1300);
|
||||
expect(find.byKey(settingsTopicMenuKey), findsNothing);
|
||||
final connection = tester.getTopLeft(find.text('Connection body')).dy;
|
||||
final size = tester.getTopLeft(find.text('Interface size body')).dy;
|
||||
expect(size, lessThan(connection));
|
||||
});
|
||||
}
|
||||
@@ -232,6 +232,10 @@ void main() {
|
||||
|
||||
await tester.enterText(workspace, ' /srv/pipelines ');
|
||||
await tester.pump();
|
||||
// A phone leads with Connection and Notifications, so Save may sit
|
||||
// below the fold.
|
||||
await tester.ensureVisible(find.byKey(SettingsKeys.saveWorkspace));
|
||||
await tester.pump();
|
||||
await tester.tap(find.byKey(SettingsKeys.saveWorkspace));
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
@@ -359,7 +363,9 @@ void main() {
|
||||
expect(row, findsOneWidget);
|
||||
expect(
|
||||
tester
|
||||
.widget<ListTile>(find.descendant(of: row, matching: find.byType(ListTile)))
|
||||
.widget<ListTile>(
|
||||
find.descendant(of: row, matching: find.byType(ListTile)),
|
||||
)
|
||||
.enabled,
|
||||
isTrue,
|
||||
);
|
||||
@@ -391,7 +397,9 @@ void main() {
|
||||
expect(row, findsOneWidget);
|
||||
expect(
|
||||
tester
|
||||
.widget<ListTile>(find.descendant(of: row, matching: find.byType(ListTile)))
|
||||
.widget<ListTile>(
|
||||
find.descendant(of: row, matching: find.byType(ListTile)),
|
||||
)
|
||||
.enabled,
|
||||
isFalse,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user