diff --git a/mobile/lib/features/channels/message_long_press_region.dart b/mobile/lib/features/channels/message_long_press_region.dart index 526271c8c4..94c4be8750 100644 --- a/mobile/lib/features/channels/message_long_press_region.dart +++ b/mobile/lib/features/channels/message_long_press_region.dart @@ -8,7 +8,7 @@ import 'package:flutter/rendering.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; /// Shared hold deadline so nested reaction pills win before the message menu. -const iosMessageLongPressDuration = Duration(milliseconds: 200); +const iosMessageLongPressDuration = Duration(milliseconds: 500); const _maxMessageSnapshotDimension = 2048.0; double _messageSnapshotPixelRatio(Size size, double devicePixelRatio) { diff --git a/mobile/test/features/channels/message_actions_test.dart b/mobile/test/features/channels/message_actions_test.dart index 410d4cc843..e07013a26b 100644 --- a/mobile/test/features/channels/message_actions_test.dart +++ b/mobile/test/features/channels/message_actions_test.dart @@ -476,7 +476,7 @@ void main() { }); testWidgets( - 'message long press keeps taps and scrolling while repeated holds win', + 'message long press keeps taps and delayed scrolling while repeated holds win', (tester) async { var parentTaps = 0; var nestedTaps = 0; @@ -536,6 +536,8 @@ void main() { final drag = await tester.startGesture( tester.getCenter(find.byKey(const ValueKey('parent-gesture-target'))), ); + await tester.pump(const Duration(milliseconds: 300)); + expect(longPresses, 5); await drag.moveBy(const Offset(0, -30)); await tester.pump(); await drag.moveBy(const Offset(0, -70)); @@ -547,9 +549,13 @@ void main() { expect(longPresses, 5); expect(scrollController.offset, greaterThan(0)); }, + variant: TargetPlatformVariant({ + TargetPlatform.iOS, + TargetPlatform.android, + }), ); - testWidgets('iOS message long press recognizes at 200 ms', (tester) async { + testWidgets('iOS message long press recognizes at 500 ms', (tester) async { debugDefaultTargetPlatformOverride = TargetPlatform.iOS; try { var longPresses = 0; @@ -571,7 +577,7 @@ void main() { final gesture = await tester.startGesture( tester.getCenter(find.byKey(const ValueKey('ios-long-press-target'))), ); - await tester.pump(const Duration(milliseconds: 199)); + await tester.pump(const Duration(milliseconds: 499)); expect(longPresses, 0); await tester.pump(const Duration(milliseconds: 2)); expect(longPresses, 1);