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 '../../../ui/adaptive/host.dart';
import 'graph_viewport.dart';
import 'graph_viewport_controller.dart';
@@ -102,22 +103,27 @@ class _GraphExpandedViewState extends State<GraphExpandedView> {
);
if (usesCupertinoHost(context)) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
navigationBar: SegmentedBar(
cupertino: true,
automaticallyImplyLeading: false,
middle: Text(widget.title),
trailing: CupertinoButton(
key: const Key('graph-expanded-close'),
padding: EdgeInsets.zero,
onPressed: _close,
child: const Text(graphExpandedClose),
),
title: widget.title,
actions: [
CupertinoButton(
key: const Key('graph-expanded-close'),
padding: const EdgeInsets.symmetric(horizontal: 16),
onPressed: _close,
child: const Text(graphExpandedClose),
),
],
),
child: SafeArea(child: body),
);
}
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
extendBodyBehindAppBar: true,
appBar: SegmentedBar(
cupertino: false,
title: widget.title,
automaticallyImplyLeading: false,
actions: [
TextButton(
@@ -1,3 +1,4 @@
import '../../../ui/adaptive/segmented_bar.dart';
import 'dart:convert';
import 'package:flutter/cupertino.dart';
@@ -141,14 +142,15 @@ Future<void> openStageDefinition(
? CupertinoPageRoute<void>(
settings: settings,
builder: (_) => CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(middle: Text(title)),
navigationBar: SegmentedBar(cupertino: true, title: title),
child: SafeArea(child: view),
),
)
: MaterialPageRoute<void>(
settings: settings,
builder: (_) => Scaffold(
appBar: AppBar(title: Text(title)),
extendBodyBehindAppBar: true,
appBar: SegmentedBar(cupertino: false, title: title),
body: SafeArea(child: view),
),
);