Top bar: every piece pops in like the tab buttons

One shared pop (pop_entrance.dart: PopTransition, popWindow, PopEntrance)
drives the floating tab buttons and the top bar, on Motion.tabEntrance*
(0.6 -> 1, 260 ms, 70 ms stagger, ease-out-back, glass fading in).
SegmentedEntrance and the barEntrance* constants are gone.

Back, the title, the actions pill and each action pop in turn from the
leading edge (SegmentedEntrancePlanner). A lone action pops once, with its
pill. A newcomer pops alone. Rebuilds and title changes never replay it.
The shell passes published actions one by one, keyed by their screen
(actionsKey), not as one cross-fading Row. The chat thread's model and mode
are separate actions. The folder picker now uses SegmentedBar.
This commit is contained in:
2026-11-03 00:30:44 +00:00
parent 2176b396ac
commit 05798a56c8
14 changed files with 709 additions and 457 deletions
@@ -1117,40 +1117,22 @@ class _ChatThreadViewState extends State<ChatThreadView> {
// A pushed page keeps the platform's stock Back (pop this route); a
// standalone conversation calls its owner.
onBack: inShellBar ? null : widget.onBack,
// Natural width while the bar has room; past the title's share both
// controls ellipsise. A session without a mode draws no mode control,
// so no empty pill is ever drawn.
// Each control is its own action, so each pops in (and sinks) on its
// own. Natural width while the bar has room; past the title's share
// the model ellipsises, and the mode keeps its whole name until it
// would take more than half the pill. A session without a mode draws
// no mode control, so no empty pill is ever drawn.
controls: [
if (hasModel || hasMode)
LayoutBuilder(
builder: (context, constraints) => Row(
mainAxisSize: MainAxisSize.min,
children: [
if (hasModel)
Flexible(
child: ChatModelControl(
key: ValueKey<String>('chat-model-${widget.sessionId}'),
gateway: widget.gateway,
sessionId: widget.sessionId,
session: session,
onChanged: widget.onModelChanged,
answeredBy: answeredBy,
),
),
if (hasMode)
// The mode keeps its whole name until it would take more
// than half the pill; the model takes the rest.
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: hasModel
? constraints.maxWidth / 2
: constraints.maxWidth,
),
child: _modeControl(),
),
],
),
if (hasModel)
ChatModelControl(
key: ValueKey<String>('chat-model-${widget.sessionId}'),
gateway: widget.gateway,
sessionId: widget.sessionId,
session: session,
onChanged: widget.onModelChanged,
answeredBy: answeredBy,
),
if (hasMode) _modeControl(),
],
);
}
@@ -2,7 +2,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../../core/api_gateway.dart';
import '../../data/directory_listing.dart';
import '../../../../ui/adaptive/segmented_bar.dart';
import '../sessions/chat_adaptive.dart';
import 'folder_picker_controller.dart';
import 'folder_picker_list.dart';
@@ -108,41 +108,40 @@ class _FolderPickerPageState extends State<FolderPickerPage> {
);
}
/// The app's segmented bar: Back (climbing one folder), the title, and
/// Cancel in the actions pill, each popping in like every other bar.
SegmentedBar _bar(bool cupertino) => SegmentedBar(
cupertino: cupertino,
automaticallyImplyLeading: false,
leading: SegmentedBackButton(cupertino: cupertino, onPressed: _back),
title: folderPickerTitle,
actions: [
if (cupertino)
CupertinoButton(
padding: const EdgeInsets.symmetric(horizontal: 16),
onPressed: () => Navigator.pop(context),
child: const Text('Cancel'),
)
else
TextButton(
onPressed: () => Navigator.pop(context),
child: const Text('Cancel'),
),
],
);
Widget _material(Widget body) {
return Scaffold(
appBar: AppBar(
leading: BackButton(onPressed: _back),
title: const Text(folderPickerTitle),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: const Text('Cancel'),
),
],
),
body: SafeArea(top: false, child: body),
extendBodyBehindAppBar: true,
appBar: _bar(false),
// Inset below the floating bar, which the scaffold reports as padding.
body: SafeArea(child: body),
);
}
Widget _cupertino(BuildContext context, Widget body) {
final parent = _controller.listing?.parent;
final home = _controller.home;
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
automaticallyImplyLeading: false,
leading: CupertinoNavigationBarBackButton(
onPressed: _back,
previousPageTitle: parent == null || home == null
? 'Back'
: folderCrumbs(home, parent).last.label,
),
middle: const Text(folderPickerTitle),
trailing: CupertinoButton(
padding: EdgeInsets.zero,
onPressed: () => Navigator.pop(context),
child: const Text('Cancel'),
),
),
navigationBar: _bar(true),
child: DefaultTextStyle(
style: CupertinoTheme.of(context).textTheme.textStyle,
child: SafeArea(child: body),