@@ -2830,6 +2830,81 @@ void main() {
28302830 },
28312831 );
28322832
2833+ testWidgets (
2834+ 'deep-linking an older reply does not resume tail following on keyboard resize' ,
2835+ (tester) async {
2836+ tester.view.physicalSize = const Size (400 , 800 );
2837+ tester.view.devicePixelRatio = 1 ;
2838+ addTearDown (tester.view.resetPhysicalSize);
2839+ addTearDown (tester.view.resetDevicePixelRatio);
2840+ addTearDown (tester.view.reset);
2841+
2842+ final rootEvent = _textMsg (
2843+ id: 'thread-root' ,
2844+ pubkey: 'alice' ,
2845+ content: 'Thread root' ,
2846+ createdAt: 1000 ,
2847+ );
2848+ final replies = [
2849+ for (var i = 0 ; i < 30 ; i++ )
2850+ _textMsg (
2851+ id: 'reply-$i ' ,
2852+ pubkey: 'bob' ,
2853+ content: 'Reply $i ' ,
2854+ createdAt: 1100 + i,
2855+ extraTags: const [
2856+ ['e' , 'thread-root' , '' , 'reply' ],
2857+ ],
2858+ ),
2859+ ];
2860+ final completer = Completer <List <NostrEvent >>();
2861+
2862+ await tester.pumpWidget (
2863+ _buildTestable (
2864+ messages: [rootEvent],
2865+ pendingThreadReplies: {'thread-root' : completer.future},
2866+ users: const {
2867+ 'alice' : UserProfile (pubkey: 'alice' , displayName: 'Alice' ),
2868+ 'bob' : UserProfile (pubkey: 'bob' , displayName: 'Bob' ),
2869+ },
2870+ ),
2871+ );
2872+ await tester.pumpAndSettle ();
2873+
2874+ final threadHead = formatTimeline ([rootEvent]).single;
2875+ final provisionalTarget = formatTimeline ([replies[5 ]]).single;
2876+ Navigator .of (tester.element (find.byType (ChannelDetailPage ))).push (
2877+ MaterialPageRoute <void >(
2878+ builder: (_) => ThreadDetailPage (
2879+ threadHead: threadHead,
2880+ allMessages: [threadHead, provisionalTarget],
2881+ channelId: _channelId,
2882+ currentPubkey: 'self' ,
2883+ isMember: true ,
2884+ isArchived: false ,
2885+ initialMessageId: 'reply-5' ,
2886+ ),
2887+ ),
2888+ );
2889+ await tester.pumpAndSettle ();
2890+
2891+ completer.complete (replies);
2892+ await tester.pumpAndSettle ();
2893+
2894+ final target = find.byKey (
2895+ const ValueKey ('thread-message-group-reply-5' ),
2896+ );
2897+ expect (target, findsOneWidget);
2898+
2899+ await tester.tap (find.text ('Reply in thread…' ).hitTestable ());
2900+ await tester.pumpAndSettle ();
2901+ tester.view.viewInsets = const FakeViewPadding (bottom: 300 );
2902+ await tester.pumpAndSettle ();
2903+
2904+ expect (target, findsOneWidget);
2905+ },
2906+ );
2907+
28332908 testWidgets ('a reaction landing while the thread is open shows up there' , (
28342909 tester,
28352910 ) async {
0 commit comments