Add desktop navigation rail with Settings
Replace wide-layout floating destination controls with a full-height Material navigation rail, keeping badges and existing navigation behavior. Pin Settings to the rail and preserve the phone layout and pane/window clearance.
This commit is contained in:
@@ -106,7 +106,7 @@ void main() {
|
||||
.first,
|
||||
);
|
||||
|
||||
for (final width in [1200.0, 1600.0]) {
|
||||
for (final width in [600.0, 640.0]) {
|
||||
testWidgets('$width split: the destination bar sits under the '
|
||||
'list and the composer at the detail\'s bottom edge', (tester) async {
|
||||
await setSize(tester, Size(width, 800));
|
||||
@@ -211,11 +211,12 @@ void main() {
|
||||
});
|
||||
}
|
||||
|
||||
testWidgets('1200 split: the bar follows a dragged list width', (
|
||||
testWidgets('640 split: the bar follows a dragged list width', (
|
||||
tester,
|
||||
) async {
|
||||
await setSize(tester, const Size(1200, 800));
|
||||
for (final width in [300.0, 520.0]) {
|
||||
await setSize(tester, const Size(640, 800));
|
||||
// Within a 640 window's list bounds (at most 0.6 of it, less the body).
|
||||
for (final width in [260.0, 300.0]) {
|
||||
final store = MemoryListPaneWidthStore({'chat': width});
|
||||
await tester.pumpWidget(
|
||||
KeyedSubtree(
|
||||
@@ -235,26 +236,26 @@ void main() {
|
||||
}
|
||||
});
|
||||
|
||||
testWidgets('1200 Settings: a page without a list keeps the bar '
|
||||
testWidgets('640 Settings: a page without a list keeps the bar '
|
||||
'at the right edge', (tester) async {
|
||||
await setSize(tester, const Size(1200, 800));
|
||||
await setSize(tester, const Size(640, 800));
|
||||
await tester.pumpWidget(shell(destination: AppDestination.settings));
|
||||
await tester.pump();
|
||||
final pill = destinationPill(tester);
|
||||
expect(pill.right, closeTo(1200 - kFloatingBarMargin, 0.5));
|
||||
expect(pill.right, closeTo(640 - kFloatingBarMargin, 0.5));
|
||||
});
|
||||
|
||||
testWidgets('1200 unsplit: the bar stays under the list column', (
|
||||
testWidgets('640 unsplit: the bar stays under the list column', (
|
||||
tester,
|
||||
) async {
|
||||
await setSize(tester, const Size(1200, 800));
|
||||
await setSize(tester, const Size(640, 800));
|
||||
await tester.pumpWidget(shell(split: false));
|
||||
await tester.pump();
|
||||
final pill = destinationPill(tester);
|
||||
// Same place as beside an open item (Search has no split), so opening
|
||||
// or closing an item never moves the bar across the window.
|
||||
expect(pill.left, closeTo(kFloatingBarMargin, 0.5));
|
||||
expect(pill.width, lessThan(1200 * 0.6));
|
||||
expect(pill.width, lessThan(640 * 0.6));
|
||||
});
|
||||
|
||||
testWidgets('390: the bar hugs its tabs at the phone\'s bottom '
|
||||
@@ -277,7 +278,7 @@ void main() {
|
||||
expect(pill.right, closeTo(390 - kFloatingBarMargin, 0.5));
|
||||
});
|
||||
|
||||
for (final width in [600.0, 840.0]) {
|
||||
for (final width in [600.0, 640.0]) {
|
||||
testWidgets('$width split at 2x: the bar fits the list pane and '
|
||||
'the item tabs the detail, without overflow', (tester) async {
|
||||
await setSize(tester, Size(width, 800));
|
||||
|
||||
Reference in New Issue
Block a user