mirror of
https://github.com/block/buzz.git
synced 2026-10-31 06:21:34 +00:00
## Summary - refine mobile message metadata, search spacing, and Activity filter semantics - add channel-parity Latest navigation and stable tail following to threads - synchronize Android composer/keyboard geometry and keep Latest spacing stable across IME transitions ## Validation - `bin/just mobile-check` - `bin/just mobile-test` (1,276 tests) - Pixel 10 install/launch and channel/thread keyboard, Latest, tail, and back-navigation review - signed iPhone install/launch workflow ## Snapshots See the review snapshots below. --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Signed-off-by: Kenny Lopez <klopez4212@gmail.com> Signed-off-by: Princess Donut <b238ea756dee4d98afa5883fc7f1de61eeabe65bf700e3a5a5a80db5e42e2c2b@buzz.block.builderlab.xyz> Co-authored-by: Fast Fizz <2df81cb51f05a9d5387ef24d7b9ecb8fcdfcd1c70ffabc67061c9596e1b5b1c4@buzz.block.builderlab.xyz> Co-authored-by: Princess Donut <b238ea756dee4d98afa5883fc7f1de61eeabe65bf700e3a5a5a80db5e42e2c2b@buzz.block.builderlab.xyz>
94 lines
2.7 KiB
Dart
94 lines
2.7 KiB
Dart
import 'package:buzz/features/channels/android_ime_lift.dart';
|
|
import 'package:buzz/shared/theme/theme.dart';
|
|
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
testWidgets('lifts only the composer on Android', (tester) async {
|
|
final previousPlatform = debugDefaultTargetPlatformOverride;
|
|
debugDefaultTargetPlatformOverride = TargetPlatform.android;
|
|
try {
|
|
await tester.pumpWidget(_testLayout());
|
|
|
|
expect(
|
|
tester.getBottomLeft(find.byKey(const ValueKey('composer'))).dy,
|
|
280,
|
|
);
|
|
} finally {
|
|
debugDefaultTargetPlatformOverride = previousPlatform;
|
|
}
|
|
});
|
|
|
|
testWidgets('leaves the iOS composer on the scaffold resize path', (
|
|
tester,
|
|
) async {
|
|
final previousPlatform = debugDefaultTargetPlatformOverride;
|
|
debugDefaultTargetPlatformOverride = TargetPlatform.iOS;
|
|
try {
|
|
await tester.pumpWidget(_testLayout());
|
|
|
|
expect(
|
|
tester.getBottomLeft(find.byKey(const ValueKey('composer'))).dy,
|
|
400,
|
|
);
|
|
} finally {
|
|
debugDefaultTargetPlatformOverride = previousPlatform;
|
|
}
|
|
});
|
|
|
|
testWidgets('does not double-count Android navigation safe area', (
|
|
tester,
|
|
) async {
|
|
final previousPlatform = debugDefaultTargetPlatformOverride;
|
|
debugDefaultTargetPlatformOverride = TargetPlatform.android;
|
|
try {
|
|
await tester.pumpWidget(
|
|
_testLayout(viewPadding: 24, reservesViewPadding: true),
|
|
);
|
|
|
|
final keyboardTop = 400 - 120;
|
|
final composerBottom = tester
|
|
.getBottomLeft(find.byKey(const ValueKey('composer')))
|
|
.dy;
|
|
expect(keyboardTop - composerBottom, Grid.xxs);
|
|
} finally {
|
|
debugDefaultTargetPlatformOverride = previousPlatform;
|
|
}
|
|
});
|
|
}
|
|
|
|
Widget _testLayout({double viewPadding = 0, bool reservesViewPadding = false}) {
|
|
return MediaQuery(
|
|
data: MediaQueryData(
|
|
viewInsets: const EdgeInsets.only(bottom: 120),
|
|
viewPadding: EdgeInsets.only(bottom: viewPadding),
|
|
),
|
|
child: Directionality(
|
|
textDirection: TextDirection.ltr,
|
|
child: Align(
|
|
alignment: Alignment.topLeft,
|
|
child: SizedBox(
|
|
width: 400,
|
|
height: 400,
|
|
child: AndroidImeLift(
|
|
child: Align(
|
|
alignment: Alignment.bottomCenter,
|
|
child: Padding(
|
|
padding: EdgeInsets.only(
|
|
bottom: reservesViewPadding ? viewPadding + Grid.xxs : 0,
|
|
),
|
|
child: const SizedBox(
|
|
key: ValueKey('composer'),
|
|
width: 100,
|
|
height: 40,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|