feat(app): icon-only tab bars, Settings from the Pipelines bar, main bar bottom right with detail bars above it

Settings leaves the tab bar (Pipelines, Runs, Chat, Search) and opens as a
page from a gear in the Pipelines bar, keeping /settings, its keys and a Back
to Pipelines (also the system Back). Every floating tab bar shows icons only,
named for assistive technology. On wide windows the shell's tab bar stays at
the bottom right; a split detail learns its height plus a 12px gap, so its
tabs or the chat composer float above it, and pages the detail opens (the
stage page) stay in its pane through its own navigator.
This commit is contained in:
2026-10-31 14:57:56 +00:00
parent 33cb9ca121
commit a1c4c1c402
40 changed files with 1057 additions and 228 deletions
+61 -38
View File
@@ -117,7 +117,10 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
// Full-screen detail routes cover the shell themselves. Keep the root tabs
// mounted/layout-ready underneath, so Back does not resize or reveal them
// only after the outgoing page has finished its native animation.
final index = AppDestination.values.indexOf(_selected);
// Settings is shown as a page of the Pipelines tab: the tab bar keeps
// Pipelines selected and the bar offers Back to it.
final index = shellTabDestinations.indexOf(shellTabFor(_selected));
final page = !shellTabDestinations.contains(_selected);
final details = destinationDetails(_selected);
final contents = AppDestination.values.map((destination) {
final item = destinationDetails(destination);
@@ -144,62 +147,75 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
// scaffold's structure depends on the width, so resizing never
// remounts a destination.
//
// While the tab shows its list beside an open item, the bar floats
// over the list pane only (judging its placement on that width), so
// it never covers the item or stacks on the item's own composer.
// While the tab shows its list beside an open item the bar keeps
// the same place, bottom right near the thumb: the item pane learns
// the bar's height (see ListDetailPanes) and floats its own tabs or
// composer above it, so the two never overlap.
final split = _bar.split(_selected);
final bar = ListPaneWidth(
split: split,
alignment: AlignmentDirectional.bottomStart,
child: FloatingDestinationBar(
cupertino: widget.cupertino,
currentIndex: index,
onTap: (value) => _select(AppDestination.values[value]),
items: _destinationItems(),
),
final bar = FloatingDestinationBar(
cupertino: widget.cupertino,
currentIndex: index,
onTap: (value) => _select(shellTabDestinations[value]),
items: _destinationItems(),
);
// Destinations reach the top edge and scroll behind the floating top
// bar too: each learns the bar's height as its top media padding and
// pads its own lists by it (see withTopBarClearance).
final topBar = _ListPaneBar(
split: split,
bar: _segmentedBar(spec, details.label),
bar: _segmentedBar(spec, details.label, page: page),
);
// The scaffolds below swap the system insets for their bars'
// heights; panes beside a list read the real ones from here.
final system = MediaQuery.paddingOf(context);
// A page (Settings) closes to Pipelines on the system Back too. The
// scope is always there, so opening the page never remounts the shell.
Widget backable(Widget child) => PopScope(
canPop: !page,
onPopInvokedWithResult: (didPop, _) {
if (!didPop) _closePage();
},
child: child,
);
if (widget.cupertino) {
return ShellSystemInsets(
padding: system,
child: CupertinoPageScaffold(
navigationBar: topBar,
child: SafeArea(
top: false,
bottom: false,
child: FloatingBarOverlay(
bar: bar,
child: _destinationStack(contents, index),
return backable(
ShellSystemInsets(
padding: system,
child: CupertinoPageScaffold(
navigationBar: topBar,
child: SafeArea(
top: false,
bottom: false,
child: FloatingBarOverlay(
bar: bar,
child: _destinationStack(contents),
),
),
),
),
);
}
return ShellSystemInsets(
padding: system,
child: Scaffold(
extendBodyBehindAppBar: true,
appBar: topBar,
body: _destinationStack(contents, index),
extendBody: true,
bottomNavigationBar: bar,
return backable(
ShellSystemInsets(
padding: system,
child: Scaffold(
extendBodyBehindAppBar: true,
appBar: topBar,
body: _destinationStack(contents),
extendBody: true,
bottomNavigationBar: bar,
),
),
);
},
);
}
/// Leaves a page destination (Settings) for the tab it belongs to.
void _closePage() => _select(shellTabFor(_selected));
List<FloatingDestinationItem> _destinationItems() =>
AppDestination.values.map((destination) {
shellTabDestinations.map((destination) {
final item = destinationDetails(destination);
return FloatingDestinationItem(
key: ValueKey('shell.destination.${destination.name}'),
@@ -213,9 +229,13 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
/// The open screen's own bar: its Back, title and actions, or the tab's
/// name with Search.
SegmentedBar _segmentedBar(ShellBarSpec? spec, String label) {
SegmentedBar _segmentedBar(
ShellBarSpec? spec,
String label, {
required bool page,
}) {
final cupertino = widget.cupertino;
final onBack = spec?.onBack;
final onBack = spec?.onBack ?? (page ? _closePage : null);
final published = spec?.actions ?? const <Widget>[];
final onSearch = widget.onSearch;
return SegmentedBar(
@@ -251,7 +271,7 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
)
// A screen whose main pill is its own field (Search) needs no
// separate Search action.
else if (onSearch != null && spec?.titleWidget == null)
else if (onSearch != null && spec?.titleWidget == null && !page)
cupertino
? CupertinoButton(
key: const ValueKey('shell.search'),
@@ -272,8 +292,11 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
);
}
Widget _destinationStack(List<Widget> contents, int index) =>
IndexedStack(key: _destinationStackKey, index: index, children: contents);
Widget _destinationStack(List<Widget> contents) => IndexedStack(
key: _destinationStackKey,
index: AppDestination.values.indexOf(_selected),
children: contents,
);
}
/// The shell's top bar, over the list pane only while the tab shows a list
+17
View File
@@ -3,6 +3,23 @@ import 'package:flutter/cupertino.dart';
enum AppDestination { pipelines, runs, chat, search, settings }
/// The destinations the shell's tab bar offers, in order. Settings is a
/// destination the shell can show (its route is `/settings`), but it opens
/// as a page from the Pipelines bar's gear instead of being a tab.
const List<AppDestination> shellTabDestinations = [
AppDestination.pipelines,
AppDestination.runs,
AppDestination.chat,
AppDestination.search,
];
/// The tab that owns [destination] in the tab bar: itself, or Pipelines for
/// Settings (reached from the Pipelines bar).
AppDestination shellTabFor(AppDestination destination) =>
shellTabDestinations.contains(destination)
? destination
: AppDestination.pipelines;
({String label, IconData icon, IconData cupertinoIcon}) destinationDetails(
AppDestination value,
) => switch (value) {
+45
View File
@@ -0,0 +1,45 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../ui/adaptive/host.dart';
/// The open item's own navigator beside a list on a wide window.
///
/// A page the item opens (a run's stage page, an artifact, a file) is pushed
/// here, so it fills the item's pane while the list and the shell's tab bar
/// stay in place: the page's own tabs then float above the shell's bar, as
/// the item's tabs do. Dialogs still use the root navigator.
///
/// The item is this navigator's first page under a fixed key, so a rebuilt
/// item updates in place and is never remounted. The system Back pops a page
/// pushed here before it leaves the item.
class DetailPaneNavigator extends StatefulWidget {
const DetailPaneNavigator({super.key, required this.child});
final Widget child;
@override
State<DetailPaneNavigator> createState() => _DetailPaneNavigatorState();
}
class _DetailPaneNavigatorState extends State<DetailPaneNavigator> {
final GlobalKey<NavigatorState> _navigator = GlobalKey();
static const _rootKey = ValueKey<String>('list-detail-root');
@override
Widget build(BuildContext context) {
final Page<void> root = usesCupertinoHost(context)
? CupertinoPage<void>(key: _rootKey, child: widget.child)
: MaterialPage<void>(key: _rootKey, child: widget.child);
return NavigatorPopHandler(
onPopWithResult: (_) => _navigator.currentState?.maybePop(),
child: Navigator(
key: _navigator,
pages: [root],
// The item is never popped from here: its pane closes with the
// selection, which the owning screen controls.
onDidRemovePage: (_) {},
),
);
}
}
+30 -12
View File
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import '../ui/adaptive/floating_bar_layout.dart';
import '../ui/adaptive/host.dart';
import 'detail_pane_navigator.dart';
import 'shell_bar.dart';
/// At least this wide, a destination keeps its list beside the open item
@@ -100,11 +101,14 @@ class ListPaneWidth extends StatelessWidget {
/// One body-priority policy for all destinations, derived from the full window
/// and actual available space after navigation. No fixed pixel pane widths.
///
/// Under the shell, the list keeps the shell's bars (both narrowed to the list
/// Under the shell, the list keeps the shell's top bar (narrowed to the list
/// pane through [ShellPaneSplit], see [ListPaneWidth]) and the open item owns
/// the rest of the window: the detail starts at the top edge and reaches the
/// bottom edge with only the system insets ([ShellSystemInsets]) as its
/// padding, and its own tabs float at its bottom, as on a phone.
/// the rest of the window: the detail starts at the top edge below the status
/// bar ([ShellSystemInsets]). The shell's tab bar stays at the bottom right,
/// over the detail pane, so the detail learns that bar's height plus
/// [kStackedBarGap] as its bottom padding: its own tabs (or the chat
/// composer) float above the shell's bar, never on it, and its content clears
/// both. Pages the item opens stay in its pane ([DetailPaneNavigator]).
class ListDetailPanes extends StatelessWidget {
const ListDetailPanes({super.key, required this.list, required this.detail});
@@ -129,21 +133,35 @@ class ListDetailPanes extends StatelessWidget {
constraints.maxWidth,
);
Widget body = detail;
Widget listPane = list;
if (split) {
// Beside the list the item is under neither of the shell's bars
// (both stay over the list pane): it keeps only the system's own
// insets, so its bar sits just below the status bar at the top
// edge, and its tabs or composer own the pane's bottom edge,
// floating just above the system inset.
// Beside the list the item is not under the shell's top bar (it
// stays over the list pane): it keeps the system's own top inset,
// so its bar sits just below the status bar at the top edge. The
// shell's tab bar floats at the bottom right, over this pane; its
// height (the shell's bottom padding here) plus a gap lifts the
// item's tabs or composer above it.
final system = ShellSystemInsets.of(context);
body = MediaQuery(
data: media.copyWith(
padding: media.padding.copyWith(
top: system.top,
bottom: system.bottom,
bottom: media.padding.bottom + kStackedBarGap,
),
),
child: PageTabsEdge(edge: FloatingBarEdge.bottom, child: body),
child: PageTabsEdge(
edge: FloatingBarEdge.bottom,
child: DetailPaneNavigator(child: body),
),
);
// The tab bar sits over the detail pane, never the list (the
// detail is at least half the window, wider than the bar), so
// the list clears only the system's bottom inset.
listPane = MediaQuery(
data: media.copyWith(
padding: media.padding.copyWith(bottom: system.bottom),
),
child: list,
);
}
return Row(
@@ -156,7 +174,7 @@ class ListDetailPanes extends StatelessWidget {
container: true,
explicitChildNodes: true,
identifier: 'list-detail-list',
child: list,
child: listPane,
),
),
),