feat(app): icon-only tab bars, Settings from the Pipelines bar, main bar bottom right with detail bars above it

Settings leaves the tab bar (Pipelines, Runs, Chat, Search) and opens as a
page from a gear in the Pipelines bar, keeping /settings, its keys and a Back
to Pipelines (also the system Back). Every floating tab bar shows icons only,
named for assistive technology. On wide windows the shell's tab bar stays at
the bottom right; a split detail learns its height plus a 12px gap, so its
tabs or the chat composer float above it, and pages the detail opens (the
stage page) stay in its pane through its own navigator.
This commit is contained in:
2026-10-31 14:57:56 +00:00
parent 33cb9ca121
commit a1c4c1c402
40 changed files with 1057 additions and 228 deletions
@@ -52,7 +52,9 @@ void main() {
expect(tester.widget<Badge>(find.byType(Badge)).isLabelVisible, isFalse);
expect(find.bySemanticsLabel(needingAttention), findsNothing);
await tester.tap(find.text('Pipelines').last);
await tester.tap(
find.byKey(const ValueKey('shell.destination.pipelines')),
);
await tester.pump();
expect(provider.value.uri.path, '/pipelines');
await waitForRequest(tester, channel, 'list_pipelines');
@@ -159,7 +159,9 @@ void main() {
expect(tester.getSize(list).width, closeTo(before, 0.01));
expect(tester.getSize(detail).width, closeTo(bodyBefore, 0.01));
expect(
tester.state<NavigatorState>(find.byType(Navigator)).canPop(),
tester
.state<NavigatorState>(find.byType(Navigator).first)
.canPop(),
isFalse,
);
for (final rowKey in rowKeys) {
@@ -224,7 +226,9 @@ void main() {
tester.view.physicalSize = const Size(390, 900);
await tester.pumpAndSettle();
expect(
tester.state<NavigatorState>(find.byType(Navigator)).canPop(),
tester
.state<NavigatorState>(find.byType(Navigator).first)
.canPop(),
isTrue,
reason: '$destination should push its selected item on a phone',
);
@@ -235,7 +239,9 @@ void main() {
tester.view.physicalSize = Size(width, 900);
await tester.pumpAndSettle();
expect(
tester.state<NavigatorState>(find.byType(Navigator)).canPop(),
tester
.state<NavigatorState>(find.byType(Navigator).first)
.canPop(),
isFalse,
);
expect(tester.getSize(list).width, closeTo(before, 0.01));
+1 -1
View File
@@ -239,7 +239,7 @@ void main() {
final pipelinesRunsId =
pipelineRequest(channel, 'list_runs')!['id'] as String;
await tester.tap(find.text('Runs').last);
await tester.tap(find.byKey(const ValueKey('shell.destination.runs')));
await tester.pump();
expect(provider.value.uri.path, '/runs');
@@ -77,7 +77,7 @@ void main() {
await tester.pump();
expect(find.text('hash-alpha'), findsOneWidget);
await tester.tap(find.text('Source'));
await tester.tap(find.byKey(const Key('pipeline-detail-tab-source')));
await tester.pump();
expect(
selectableText(
+4 -9
View File
@@ -1,7 +1,6 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_test/flutter_test.dart';
import '../features/runs/ui/run_detail_finders.dart';
import '../native_back.dart';
@@ -87,15 +86,11 @@ Future<void> replyRun7List(WidgetTester tester, FakeChannel channel) => reply(
},
);
/// Taps a tab by its label: the bottom bar or, on a wide window, the rail.
/// Taps a shell tab by its label (the tabs show icons only, keyed by name).
Future<void> tapTab(WidgetTester tester, String label) async {
final bar = find.byWidgetPredicate(
(widget) =>
widget is NavigationBar ||
widget is NavigationRail ||
widget is CupertinoTabBar,
await tester.tap(
find.byKey(ValueKey('shell.destination.${label.toLowerCase()}')),
);
await tester.tap(find.descendant(of: bar, matching: find.text(label)));
}
/// Opens Search, sends `report` and answers with the artifact hit for run 7.
@@ -300,7 +295,7 @@ void main() {
// On a phone an open run fills the screen and the tabs step aside, so
// switching tabs with a run open is a wide-window move.
// Search is the fifth tab.
// Search is the fourth tab.
await tapTab(tester, 'Search');
await tester.pump();
await tester.pump(const Duration(milliseconds: 600));
@@ -0,0 +1,125 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/application/pipelines_app.dart';
import 'package:pipelines_app/core/transport/pipelines_client.dart';
import 'package:pipelines_app/features/settings/settings_screen.dart';
import 'package:pipelines_app/ui/adaptive/floating_destination_bar.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../core/transport/pipelines_client_test.dart' show FakeChannel;
import '../features/pipelines/fixtures.dart';
import 'pipelines_app_test.dart' show webServer;
import 'pipelines_replies.dart';
/// Settings is not a tab: it opens as a page from the gear in the Pipelines
/// bar, keeps its `/settings` route (and deep link), and closes back to
/// Pipelines. The tab bar keeps Pipelines selected meanwhile.
void main() {
Future<PlatformRouteInformationProvider> pumpApp(
WidgetTester tester, {
required bool cupertino,
required String location,
required Size size,
}) async {
SharedPreferences.setMockInitialValues({});
tester.view.physicalSize = size;
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
final channel = FakeChannel()..readyCompleter.complete();
final provider = PlatformRouteInformationProvider(
initialRouteInformation: RouteInformation(uri: Uri.parse(location)),
);
addTearDown(provider.dispose);
await tester.pumpWidget(
PipelinesApp(
server: webServer(),
client: PipelinesClient(channelFactory: (_) => channel),
cupertino: cupertino,
routeInformationProvider: provider,
),
);
await tester.pump();
if (location == '/pipelines') {
await replyPipelines(tester, channel, PipelineFixture());
}
return provider;
}
int selectedTab(WidgetTester tester) => tester
.widget<FloatingDestinationBar>(find.byType(FloatingDestinationBar))
.currentIndex;
for (final cupertino in [false, true]) {
final host = cupertino ? 'Cupertino' : 'Material';
for (final size in [const Size(390, 844), const Size(1200, 800)]) {
testWidgets('$host ${size.width}: the Pipelines bar gear opens Settings '
'as a page and Back returns', (tester) async {
final provider = await pumpApp(
tester,
cupertino: cupertino,
location: '/pipelines',
size: size,
);
// Four tabs; Settings is none of them.
expect(
tester
.widget<FloatingDestinationBar>(
find.byType(FloatingDestinationBar),
)
.items
.map((item) => item.label),
['Pipelines', 'Runs', 'Chat', 'Search'],
);
expect(
find.byKey(const ValueKey('shell.destination.settings')),
findsNothing,
);
expect(find.byKey(const ValueKey('shell.back')), findsNothing);
await tester.tap(find.byKey(const Key('pipelines-open-settings')));
await tester.pump();
await tester.pump();
expect(provider.value.uri.path, '/settings');
expect(find.byType(SettingsScreen), findsOneWidget);
expect(find.text('Server URL'), findsOneWidget);
// A page of Pipelines: Back in its bar, Pipelines still selected.
expect(find.byKey(const ValueKey('shell.back')), findsOneWidget);
expect(find.byKey(const ValueKey('shell.search')), findsNothing);
expect(selectedTab(tester), 0);
expect(tester.takeException(), isNull);
await tester.tap(find.byKey(const ValueKey('shell.back')));
await tester.pump();
await tester.pump();
expect(provider.value.uri.path, '/pipelines');
expect(find.byKey(const Key('pipelines-open-settings')), findsWidgets);
expect(find.byKey(const ValueKey('shell.back')), findsNothing);
await tester.pumpWidget(const SizedBox.shrink());
await tester.pump();
});
}
testWidgets('$host: the /settings deep link opens the Settings page and '
'the system Back closes it to Pipelines', (tester) async {
final provider = await pumpApp(
tester,
cupertino: cupertino,
location: '/settings',
size: const Size(390, 844),
);
await tester.pump();
expect(find.byType(SettingsScreen), findsOneWidget);
expect(find.byKey(const ValueKey('shell.back')), findsOneWidget);
expect(selectedTab(tester), 0);
final handled = await tester.binding.handlePopRoute();
expect(handled, isTrue, reason: 'Back closes the page, not the app');
await tester.pump();
await tester.pump();
expect(provider.value.uri.path, '/pipelines');
await tester.pumpWidget(const SizedBox.shrink());
await tester.pump();
});
}
}
@@ -51,7 +51,7 @@ void main() {
);
await replyPipelines(tester, channel, PipelineFixture());
await tester.tap(find.text('Settings').last);
await tester.tap(find.byKey(const Key('pipelines-open-settings')));
await tester.pump();
await tester.pump();
expect(provider.value.uri.path, '/settings');
@@ -93,7 +93,7 @@ Future<void> openSettings(
FakeChannel channel,
PlatformRouteInformationProvider provider,
) async {
await tester.tap(find.text('Settings').last);
await tester.tap(find.byKey(const Key('pipelines-open-settings')));
await tester.pump();
await tester.pump();
expect(provider.value.uri.path, '/settings');
@@ -354,7 +354,7 @@ void main() {
await tester.pump();
await tester.tap(find.byKey(templatesPageBackKey));
await tester.pumpAndSettle();
await tester.tap(find.text('Pipelines').last);
await tester.tap(find.byKey(const ValueKey('shell.destination.pipelines')));
await tester.pumpAndSettle();
expect(provider.value.uri.path, '/pipelines');