feat(chat): segmented chat header with back, title and model pills

The open conversation draws its own bar of separate rounded pieces: the
platform Back in a circle, a title pill with the folder that opens the
chat information, and a pill with the model and mode controls. Detail
pages drop only their app bar for it, keeping the body mounted.
This commit is contained in:
2026-10-30 23:43:00 +00:00
parent 498c6f17a6
commit 4a85a12cf7
8 changed files with 385 additions and 168 deletions
+15 -1
View File
@@ -5,11 +5,20 @@ import 'destination.dart';
/// What the open screen of a tab puts in the app bar: its title, a Back
/// control and its actions. Absent, the bar shows the tab's own name.
class ShellBarSpec {
const ShellBarSpec({this.title, this.onBack, this.actions = const []});
const ShellBarSpec({
this.title,
this.onBack,
this.actions = const [],
this.barless = false,
});
final String? title;
final VoidCallback? onBack;
final List<Widget> actions;
/// The content draws its own floating bar: a detail page shows no bar of
/// its own and lets the content reach the top edge.
final bool barless;
}
/// The bar contents each tab's open screen has published.
@@ -86,9 +95,13 @@ class ShellBar extends StatefulWidget {
this.onBack,
this.actions = const [],
this.active = true,
this.barless = false,
required this.child,
});
/// See [ShellBarSpec.barless].
final bool barless;
/// False while the screen is kept mounted but hidden (a list under an open
/// detail): it then gives the bar up.
final bool active;
@@ -130,6 +143,7 @@ class _ShellBarState extends State<ShellBar> {
title: widget.title,
onBack: widget.onBack,
actions: widget.actions,
barless: widget.barless,
);
// The bar is above this screen; update it after this frame's build.
WidgetsBinding.instance.addPostFrameCallback((_) {