diff --git a/mobile/lib/features/channels/channel_detail_page/message_bubble.dart b/mobile/lib/features/channels/channel_detail_page/message_bubble.dart index b19caa698a..8e6d38aac5 100644 --- a/mobile/lib/features/channels/channel_detail_page/message_bubble.dart +++ b/mobile/lib/features/channels/channel_detail_page/message_bubble.dart @@ -142,7 +142,8 @@ class _MessageBubble extends HookConsumerWidget { } if (message.isAgentCoordination && !coordinationExpanded.value) { - return Padding( + final collapsed = Padding( + key: swipeContentKey, padding: const EdgeInsets.symmetric(vertical: Grid.xxs), child: Material( color: Colors.transparent, @@ -199,6 +200,16 @@ class _MessageBubble extends HookConsumerWidget { ), ), ); + return MessageSwipeReply( + contentKey: swipeContentKey, + message: message, + allMessages: allMessages, + channelId: currentChannelId, + currentPubkey: currentPubkey, + isMember: isMember, + isArchived: isArchived, + child: collapsed, + ); } final content = NotificationListener( diff --git a/mobile/test/features/channels/channel_detail_page_test/bubble_tests.dart b/mobile/test/features/channels/channel_detail_page_test/bubble_tests.dart index 540398f220..9ea049df04 100644 --- a/mobile/test/features/channels/channel_detail_page_test/bubble_tests.dart +++ b/mobile/test/features/channels/channel_detail_page_test/bubble_tests.dart @@ -367,6 +367,16 @@ void bubbleLayoutTests() { await tester.tap(find.byKey(const ValueKey('collapse-update-update'))); await tester.pumpAndSettle(); expect(body(), findsNothing); + await tester.drag(row, const Offset(150, 0)); + await tester.pumpAndSettle(); + expect(find.byType(ThreadDetailPage), findsOneWidget); + expect( + tester + .widget(find.byType(ThreadDetailPage)) + .threadHead + .id, + 'update', + ); expect(tester.takeException(), isNull); }, ); diff --git a/mobile/test/features/channels/me/solo_creation_tags_test.dart b/mobile/test/features/channels/me/solo_creation_tags_test.dart index c880e5457a..2108ce261a 100644 --- a/mobile/test/features/channels/me/solo_creation_tags_test.dart +++ b/mobile/test/features/channels/me/solo_creation_tags_test.dart @@ -88,6 +88,35 @@ void main() { nsec: owner.nsec, ); final sync = MeSync(relay, config, prefs: prefs); + final nativeChannels = []; + const platformViews = MethodChannel('flutter/platform_views'); + tester.binding.defaultBinaryMessenger.setMockMethodCallHandler( + platformViews, + (call) async { + if (call.method == 'create') { + final args = call.arguments as Map; + if (args['viewType'] == 'buzz/ios_navigation_bar') { + final channel = MethodChannel( + 'buzz/ios_navigation_bar/${args['id']}', + ); + nativeChannels.add(channel); + tester.binding.defaultBinaryMessenger.setMockMethodCallHandler( + channel, + (call) async => null, + ); + } + } + return null; + }, + ); + addTearDown(() { + for (final channel in [platformViews, ...nativeChannels]) { + tester.binding.defaultBinaryMessenger.setMockMethodCallHandler( + channel, + null, + ); + } + }); const bridge = MethodChannel('buzz/profile_text_editor'); var forms = 0; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(bridge, ( @@ -127,12 +156,26 @@ void main() { ), ); await tester.pumpAndSettle(); + // Ownership verification runs on a real isolate; fake-clock settling + // alone cannot wait for its completion. tester .widget(find.byType(FrostedAppBar)) .nativeActions! .firstWhere((action) => action.label == 'New chat') .onPressed!(); await tester.pumpAndSettle(); + for ( + var attempt = 0; + attempt < 500 && relay.submitted.isEmpty; + attempt++ + ) { + await tester.runAsync( + () => Future.delayed(const Duration(milliseconds: 10)), + ); + await tester.pump(); + } + expect(relay.submitted, hasLength(1)); + await tester.pumpAndSettle(); final command = relay.submitted.single; expect(command.kind, 9007); expect(command.pubkey, owner.public); @@ -140,6 +183,8 @@ void main() { expect(command.tags, contains(equals(['channel_type', 'stream']))); expect(command.tags, contains(equals(['visibility', 'private']))); expect(command.tags.where((tag) => tag.first == 'P'), isEmpty); + await tester.pumpWidget(const SizedBox.shrink()); + await tester.pumpAndSettle(); }, variant: TargetPlatformVariant.only(TargetPlatform.iOS), );