Merge commit 'ef671d2e3e902a4db3fa13336cabd26012084ea7' into pipelines/run-20261112-1912-ctrl-e-toggles-files-ctrl-shift-e-center-719c

This commit is contained in:
2026-11-12 19:52:52 +00:00
4 changed files with 63 additions and 24 deletions
+10 -6
View File
@@ -232,8 +232,8 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
// A phone (narrower than the list-detail split) gets a full-width Material // A phone (narrower than the list-detail split) gets a full-width Material
// NavigationBar at the bottom, with Settings as its last destination. Wider // NavigationBar at the bottom, with Settings as its last destination. Wider
// windows without the rail keep the floating glass tab bar, which the list // windows without the rail keep the floating glass tab bar, which the list
// beside an open item needs (see below). Content keeps the whole width and // beside an open item needs (see below). On phones the NavigationBar is a
// scrolls behind the bar, learning its height as its bottom media padding. // real Scaffold bottom child, so content is laid out above its surface.
// Neither scaffold's structure depends on the width, so resizing never // Neither scaffold's structure depends on the width, so resizing never
// remounts a destination. Pushed detail routes cover the shell, and a // remounts a destination. Pushed detail routes cover the shell, and a
// bar-less spec (a chat workspace) hides the bar. // bar-less spec (a chat workspace) hides the bar.
@@ -272,9 +272,9 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
); );
}, },
); );
// Destinations reach the top edge and scroll behind the floating top // Destinations may still reach the top edge and scroll behind the floating
// bar too: each learns the bar's height as its top media padding and // top bar; the bottom phone bar is different because Scaffold reserves its
// pads its own lists by it (see withTopBarClearance). // complete height rather than overlaying the body.
SegmentedBar currentBar() => SegmentedBar currentBar() =>
_segmentedBar(_bar.specFor(_selected), details.label, page: page); _segmentedBar(_bar.specFor(_selected), details.label, page: page);
final topBar = _ListPaneBar( final topBar = _ListPaneBar(
@@ -317,7 +317,11 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: topBar, appBar: topBar,
body: _destinationStack(contents), body: _destinationStack(contents),
extendBody: true, // Only phone destinations use the Scaffold's real bottom slot. The
// narrow tablet layout keeps its existing floating bar over the body.
// The NavigationBar owns its SafeArea and therefore also owns the
// system gesture inset at the bottom.
extendBody: !phone,
bottomNavigationBar: rail ? null : bar, bottomNavigationBar: rail ? null : bar,
); );
return backable( return backable(
@@ -0,0 +1,17 @@
# Phone content ends above the bottom bar
Changed the adaptive shell to use the phone `NavigationBar` as a real
`Scaffold.bottomNavigationBar` without `extendBody`, so destination content is
constrained above the opaque bar and its system safe-area inset. The existing
floating bar keeps `extendBody` on the narrow tablet layout, preserving its
overlay composition; rail layouts are unchanged.
Added a widget regression asserting that a phone destination body's bottom edge
equals the navigation bar's top edge.
Focused verification:
- `tool/memwatch/full.sh 'test/shell/shell_navigation_bar_test.dart test/shell/floating_tab_bar_test.dart'` — 15 passed.
- `tool/analyze.sh` — clean.
Browser/device captures were not run in this implementation stage.
+18 -18
View File
@@ -139,24 +139,24 @@ void main() {
expect(find.text('Chat — Not implemented'), findsOneWidget); expect(find.text('Chat — Not implemented'), findsOneWidget);
}); });
testWidgets('content learns the bar height as bottom padding', ( testWidgets(
tester, 'phone content has no floating-bar padding; tablet content does',
) async { (tester) async {
for (final size in const [Size(390, 844), Size(640, 800)]) { for (final size in const [Size(390, 844), Size(640, 800)]) {
await setSize(tester, size); await setSize(tester, size);
await tester.pumpWidget(shell()); await tester.pumpWidget(shell());
await tester.pump(); await tester.pump();
final rect = size.width < 600 final rect = size.width < 600
? tester.getRect(find.byType(NavigationBar)) ? tester.getRect(find.byType(NavigationBar))
: tester.getRect(pill()); : tester.getRect(pill());
// The content's bottom padding clears the whole bar and its margin. expect(
expect( contentBottomPadding,
contentBottomPadding, size.width < 600 ? 0 : size.height - rect.top,
moreOrLessEquals(size.height - rect.top, epsilon: 0.5), reason: '$size',
reason: '$size', );
); }
} },
}); );
testWidgets('resizing moves the bar without remounting content', ( testWidgets('resizing moves the bar without remounting content', (
tester, tester,
@@ -70,6 +70,24 @@ void main() {
expect(tester.widget<NavigationBar>(bar()).selectedIndex, 4); expect(tester.widget<NavigationBar>(bar()).selectedIndex, 4);
}); });
testWidgets('the phone destination body ends at the bar top', (tester) async {
await pumpPhone(
tester,
bodies: {
AppDestination.pipelines: (_) => const ColoredBox(
key: ValueKey('phone.destination-body'),
color: Colors.red,
),
},
);
final body = tester.getRect(
find.byKey(const ValueKey('phone.destination-body')),
);
final navigationBar = tester.getRect(bar());
expect(body.bottom, navigationBar.top);
});
testWidgets('a tap shows its destination, and a re-tap of the shown one ' testWidgets('a tap shows its destination, and a re-tap of the shown one '
'still reports it to the shell', (tester) async { 'still reports it to the shell', (tester) async {
final selected = <AppDestination>[]; final selected = <AppDestination>[];