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
@@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../ui/adaptive/segmented_bar.dart';
import '../../../core/api_gateway.dart';
import '../../../ui/adaptive/host.dart';
import '../../changes/changes.dart';
@@ -185,9 +186,9 @@ class _MaterialChangesPage extends StatelessWidget {
@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(title: Text(title)),
extendBodyBehindAppBar: true,
appBar: SegmentedBar(cupertino: false, title: title),
body: SafeArea(
top: false,
child: ChangesViewer(steps: steps, showSummary: showSummary),
),
);
@@ -206,7 +207,7 @@ class _CupertinoChangesPage extends StatelessWidget {
@override
Widget build(BuildContext context) => CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(middle: Text(title)),
navigationBar: SegmentedBar(cupertino: true, title: title),
child: SafeArea(
// A CupertinoApp supplies no Material theme; follow the host brightness
// so the viewer's Material-derived section text stays readable.
+13 -7
View File
@@ -1,3 +1,4 @@
import '../../../ui/adaptive/segmented_bar.dart';
import 'dart:math' as math;
import 'package:flutter/cupertino.dart';
@@ -302,25 +303,30 @@ class _RunDetailTabsState extends State<RunDetailTabs> {
final title = detailTitle(run);
if (cupertino) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
leading: CupertinoNavigationBarBackButton(
navigationBar: SegmentedBar(
cupertino: true,
leading: SegmentedBackButton(
key: const Key('run-visit-back'),
cupertino: true,
onPressed: () => Navigator.of(pageContext).pop(),
),
middle: Text(title),
title: title,
),
child: SafeArea(child: pane),
);
}
return Scaffold(
appBar: AppBar(
leading: BackButton(
extendBodyBehindAppBar: true,
appBar: SegmentedBar(
cupertino: false,
leading: SegmentedBackButton(
key: const Key('run-visit-back'),
cupertino: false,
onPressed: () => Navigator.of(pageContext).pop(),
),
title: Text(title),
title: title,
),
body: SafeArea(top: false, child: pane),
body: SafeArea(child: pane),
);
},
);
@@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../ui/adaptive/segmented_bar.dart';
import '../../../core/api_gateway.dart';
import '../../../ui/adaptive/host.dart';
import '../../graph/widgets/run_graph_view.dart';
@@ -105,16 +106,18 @@ class RunGraphPreview extends StatelessWidget {
cupertino
? CupertinoPageRoute<void>(
builder: (page) => CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Graph'),
navigationBar: const SegmentedBar(
cupertino: true,
title: 'Graph',
),
child: SafeArea(child: graphView(page)),
),
)
: MaterialPageRoute<void>(
builder: (page) => Scaffold(
appBar: AppBar(title: const Text('Graph')),
body: SafeArea(top: false, child: graphView(page)),
extendBodyBehindAppBar: true,
appBar: const SegmentedBar(cupertino: false, title: 'Graph'),
body: SafeArea(child: graphView(page)),
),
),
);
@@ -1,3 +1,4 @@
import '../../../ui/adaptive/segmented_bar.dart';
import 'dart:math' as math;
import 'package:flutter/cupertino.dart';
@@ -37,13 +38,14 @@ class RunsStatsPage extends StatelessWidget {
);
if (cupertino) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(middle: Text('Usage')),
navigationBar: const SegmentedBar(cupertino: true, title: 'Usage'),
child: SafeArea(child: body),
);
}
return Scaffold(
appBar: AppBar(title: const Text('Usage')),
body: SafeArea(top: false, child: body),
extendBodyBehindAppBar: true,
appBar: const SegmentedBar(cupertino: false, title: 'Usage'),
body: SafeArea(child: body),
);
}