feat(app): segmented glass top bar across the app

Extract the chat's segmented bar into lib/ui/adaptive (SegmentedBar,
GlassPill, SegmentedBarOverlay) and use it for the shell bar, DetailPane
and every page-level bar. Pieces are frosted glass over a fading scrim;
only pills take taps. Actions keep their natural width so the title gives
way before a model name. The chat transcript scrolls behind its header.
This commit is contained in:
2026-10-31 00:21:27 +00:00
parent 4a85a12cf7
commit 0582bfc34f
42 changed files with 1391 additions and 571 deletions
@@ -11,6 +11,7 @@ import 'package:pipelines_app/features/chat/ui/sessions/chat_sessions_screen.dar
import '../core/transport/pipelines_client_test.dart' show FakeChannel;
import '../native_back.dart';
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
ServerEndpoint webServer() => ServerEndpoint.resolve(
base: Uri.parse('http://127.0.0.1:8096/'),
@@ -215,13 +216,10 @@ void main() {
find.byType(NavigationRail),
cupertino ? findsNothing : findsOneWidget,
);
if (cupertino) {
expect(find.byType(CupertinoNavigationBar), findsOneWidget);
expect(find.byType(AppBar), findsNothing);
} else {
expect(find.byType(AppBar), findsOneWidget);
expect(find.byType(CupertinoNavigationBar), findsNothing);
}
// The shell's bar and the conversation's own header.
expect(find.byType(SegmentedBar), findsNWidgets(2));
expect(find.byType(AppBar), findsNothing);
expect(find.byType(CupertinoNavigationBar), findsNothing);
expect(find.byKey(const Key('chat-thread-header')), findsOneWidget);
expect(findNativeBack(), findsNothing);
@@ -9,6 +9,7 @@ import '../features/pipelines/fixtures.dart';
import '../features/pipelines/test_helpers.dart' show selectableText;
import 'pipelines_app_test.dart' show webServer;
import 'pipelines_replies.dart';
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
void main() {
for (final cupertino in [false, true]) {
@@ -56,21 +57,17 @@ void main() {
await tester.pump();
expect(find.text('Alpha review'), findsOneWidget);
expect(
find.text('2 stages · 1 schedule'),
findsOneWidget,
);
expect(find.text('2 stages · 1 schedule'), findsOneWidget);
expect(find.text('Pipelines — Not implemented'), findsNothing);
expect(sockets, 1);
// The shell owns the only navigation bar; the embedded screen adds no
// second AppBar or CupertinoNavigationBar.
// second bar.
expect(find.byType(SegmentedBar), findsOneWidget);
if (cupertino) {
expect(find.byType(CupertinoNavigationBar), findsOneWidget);
expect(find.byType(CupertinoPageScaffold), findsOneWidget);
expect(find.byType(Material), findsNothing);
} else {
expect(find.byType(AppBar), findsOneWidget);
expect(find.byType(Scaffold), findsOneWidget);
}
@@ -11,6 +11,7 @@ import '../core/transport/pipelines_client_test.dart' show FakeChannel;
import '../features/pipelines/fixtures.dart';
import 'pipelines_app_test.dart' show webServer, requestOf;
import 'pipelines_replies.dart';
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
void main() {
for (final cupertino in [false, true]) {
@@ -65,10 +66,7 @@ void main() {
}
expect(find.text('Settings — Not implemented'), findsNothing);
expect(sockets, 1);
expect(
cupertino ? find.byType(CupertinoNavigationBar) : find.byType(AppBar),
findsOneWidget,
);
expect(find.byType(SegmentedBar), findsOneWidget);
final ping = requestOf(channel, 'ping')!;
channel.incoming.add(
jsonEncode({
@@ -1,6 +1,5 @@
import 'dart:convert';
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';
@@ -19,6 +18,7 @@ import '../features/templates/ui/template_gallery_test_support.dart'
show GalleryGateway, galleryTemplates, pumpGallery, templatesReply;
import 'pipelines_app_test.dart' show webServer;
import 'pipelines_replies.dart';
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
List<Map<String, dynamic>> requestsOf(FakeChannel channel, String type) =>
channel.outgoing
@@ -152,7 +152,7 @@ void main() {
);
await pumpGallery(tester, gateway);
expect(find.byType(AppBar), findsOneWidget);
expect(find.byType(SegmentedBar), findsOneWidget);
await tester.tap(find.byKey(templateRowKey('release')));
await tester.pump();
expect(find.text('Definition source'), findsOneWidget);
@@ -204,10 +204,7 @@ void main() {
expect(find.text('Release workflow'), findsOneWidget);
// One visible navigation bar: the Templates page owns it, the shell is
// preserved underneath.
expect(
find.byType(cupertino ? CupertinoNavigationBar : AppBar),
findsOneWidget,
);
expect(find.byType(SegmentedBar), findsOneWidget);
if (cupertino) {
expect(find.byType(Material), findsNothing);
}