Skip to content

Commit 09bacef

Browse files
klopez4212Terp
andcommitted
fix(mobile): provide native Home icons before asynchronous rendering
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Signed-off-by: kenny lopez <[email protected]>
1 parent c44af22 commit 09bacef

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

‎mobile/ios/Runner/NativeTabler.swift‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ enum NativeTabler {
6161
"arrowshape.turn.up.left": 0xeb77, // arrow-back-up
6262
"circle.lefthalf.filled": 0xf4a3, // sun-moon
6363
"magnifyingglass": 0xeb1c, // search
64+
"tray": 0xeac4, // inbox
6465
"sparkles": 0xf6d7, // sparkles
6566
"clock": 0xea70, // clock
6667
"leaf": 0xed4f, // leaf

‎mobile/lib/features/channels/channels_page.dart‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,13 +461,15 @@ class ChannelsPage extends HookConsumerWidget {
461461
if (onSearch != null)
462462
IosNavigationAction(
463463
label: 'Search',
464+
symbol: 'magnifyingglass',
464465
sharesBackground: true,
465466
icon: BuzzIcons.search300,
466467
onPressed: onSearch,
467468
),
468469
if (onInbox != null)
469470
IosNavigationAction(
470471
label: 'Inbox',
472+
symbol: 'tray',
471473
sharesBackground: true,
472474
icon: BuzzIcons.inbox300,
473475
activityColor: hasUnreadInbox ? context.colors.primary : null,

‎mobile/test/features/home/home_page_test.dart‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,21 @@ void main() {
5757
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger;
5858
const support = MethodChannel('buzz/concentric_sheet_surface');
5959
final created = <Map<Object?, Object?>>[];
60+
final initialHeaders = <Map<Object?, Object?>>[];
6061
messenger.setMockMethodCallHandler(support, (call) async => true);
6162
messenger.setMockMethodCallHandler(SystemChannels.platform_views, (
6263
call,
6364
) async {
6465
if (call.method == 'create') {
6566
final args = call.arguments as Map<Object?, Object?>;
67+
if (args['viewType'] == 'buzz/ios_navigation_bar') {
68+
initialHeaders.add(
69+
const StandardMessageCodec().decodeMessage(
70+
ByteData.sublistView(args['params'] as Uint8List),
71+
)
72+
as Map<Object?, Object?>,
73+
);
74+
}
6675
if (args['viewType'] == 'buzz/concentric_sheet_surface') {
6776
created.add(
6877
const StandardMessageCodec().decodeMessage(
@@ -81,6 +90,18 @@ void main() {
8190
await tester.pumpWidget(await buildHome(unreadInboxCount: 2));
8291
await tester.pump();
8392
await tester.pump();
93+
// Inspect the creation payload, not a later configure call after PNG rendering.
94+
final initialActions = initialHeaders.first['actions'] as List;
95+
for (final entry in {
96+
'Search': 'magnifyingglass',
97+
'Inbox': 'tray',
98+
}.entries) {
99+
final action = initialActions.cast<Map>().firstWhere(
100+
(action) => action['label'] == entry.key,
101+
);
102+
expect(action['iconData'], isNull);
103+
expect(action['symbol'], entry.value);
104+
}
84105
final bar = find.byKey(const ValueKey('home-ios-glass-tabs'));
85106
expect(bar, findsOneWidget);
86107
expect(tester.getSize(bar), const Size(148, 56));

0 commit comments

Comments
 (0)