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
@@ -281,7 +281,14 @@ void main() {
// Drag like an operator: a programmatic scroll is undone by the
// view's follow-to-latest, while a user drag stops following.
final list = find.byKey(const ValueKey<String>('chat-thread-s'));
final viewport = tester.getRect(list);
// The transcript scrolls behind the floating header; only the part
// below it is visible.
final viewport = Rect.fromLTRB(
tester.getRect(list).left,
tester.getRect(find.byKey(const Key('chat-thread-header'))).bottom,
tester.getRect(list).right,
tester.getRect(list).bottom,
);
for (var i = 0; i < 10; i++) {
final rect = tester.getRect(control);
if (rect.top >= viewport.top && rect.bottom <= viewport.bottom) break;
@@ -5,6 +5,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/graph/domain/stage_definition.dart';
import 'package:pipelines_app/features/graph/widgets/stage_definition_view.dart';
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
JsonMap _graph() => <String, dynamic>{
'stages': <dynamic>[
@@ -174,7 +175,7 @@ void main() {
await tester.pumpAndSettle();
expect(_text('plan definition'), findsOneWidget);
expect(find.byType(AppBar), findsOneWidget);
expect(find.byType(SegmentedBar), findsOneWidget);
expect(find.byType(BackButton), findsOneWidget);
final route = ModalRoute.of(
tester.element(find.byType(StageDefinitionView)),
@@ -215,7 +216,7 @@ void main() {
expect(_text('Success definition'), findsOneWidget);
expect(_text('#success definition'), findsNothing);
expect(find.byType(CupertinoNavigationBar), findsOneWidget);
expect(find.byType(SegmentedBar), findsOneWidget);
expect(find.byType(CupertinoNavigationBarBackButton), findsOneWidget);
expect(_text('Incoming routes'), findsOneWidget);
@@ -8,6 +8,7 @@ import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/runs/screen.dart';
import 'package:pipelines_app/features/runs/ui/run_detail_view.dart';
import 'run_detail_finders.dart';
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
class _Gateway implements ApiGateway {
final framesController = StreamController<JsonMap>.broadcast();
@@ -310,7 +311,9 @@ void main() {
await _mountList(tester, gateway);
expect(find.byType(CupertinoPageScaffold), findsNWidgets(2));
expect(find.byType(CupertinoNavigationBar), findsNWidgets(2));
// The host's own bar and the detail pane's segmented bar.
expect(find.byType(CupertinoNavigationBar), findsOneWidget);
expect(find.byType(SegmentedBar), findsOneWidget);
expect(find.text('Loading run details…'), findsOneWidget);
expect(find.byType(CupertinoActivityIndicator), findsOneWidget);
expect(find.text('Back to list'), findsOneWidget);
@@ -10,6 +10,7 @@ import 'package:pipelines_app/features/settings/settings_screen.dart';
import 'package:pipelines_app/features/settings/settings_store.dart';
import 'fake_channel.dart';
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
void main() {
testWidgets('renders idle settings without opening a connection', (
@@ -241,7 +242,7 @@ void main() {
await _pump(tester, client, platform: TargetPlatform.iOS);
expect(find.byType(CupertinoNavigationBar), findsOneWidget);
expect(find.byType(SegmentedBar), findsOneWidget);
expect(find.byType(CupertinoTextField), findsNWidgets(2));
expect(find.byType(TextField), findsNothing);
expect(find.byType(FilledButton), findsNothing);
@@ -9,6 +9,7 @@ import 'package:pipelines_app/features/templates/ui/template_detail.dart';
import '../data/template_test_support.dart' show source;
import 'template_gallery_test_support.dart';
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
void main() {
testWidgets('loading shows the exact line, then the server catalogue', (
@@ -210,7 +211,7 @@ void main() {
);
await pumpGallery(tester, gateway, embedded: true);
expect(find.byType(AppBar), findsNothing);
expect(find.byType(SegmentedBar), findsNothing);
expect(find.byKey(templatesRefreshKey), findsOneWidget);
await tester.tap(find.byKey(templateRowKey('release')));
await tester.pumpAndSettle();