From ab821d167ffc49865d27ef29718996fe717b7203 Mon Sep 17 00:00:00 2001 From: kenny lopez Date: Wed, 14 Oct 2026 19:03:27 -0400 Subject: [PATCH] Open and close mobile search without a transition Signed-off-by: kenny lopez --- mobile/lib/features/home/home_page.dart | 19 ++----------------- mobile/test/features/home/home_page_test.dart | 3 ++- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/mobile/lib/features/home/home_page.dart b/mobile/lib/features/home/home_page.dart index dadfb8dfea..c1b3e7395e 100644 --- a/mobile/lib/features/home/home_page.dart +++ b/mobile/lib/features/home/home_page.dart @@ -105,25 +105,10 @@ class HomePage extends HookConsumerWidget { onSearch: () => Navigator.of(context).push( PageRouteBuilder( allowSnapshotting: false, - transitionDuration: reducedMotion - ? Duration.zero - : _tabContentTransitionDuration, - reverseTransitionDuration: reducedMotion - ? Duration.zero - : _tabContentTransitionDuration, + transitionDuration: Duration.zero, + reverseTransitionDuration: Duration.zero, pageBuilder: (_, animation, secondaryAnimation) => const SearchPage(), - transitionsBuilder: (_, animation, secondaryAnimation, child) { - final progress = reducedMotion - ? 1.0 - : _tabContentTransitionCurve.transform(animation.value); - return DirectionalTransitionScope( - horizontalOffset: - _tabContentTransitionDistance * (1 - progress), - opacity: progress, - child: child, - ); - }, ), ), communityInvitePageBuilder: communityInvitePageBuilder, diff --git a/mobile/test/features/home/home_page_test.dart b/mobile/test/features/home/home_page_test.dart index 51a878060c..14f7a35a6a 100644 --- a/mobile/test/features/home/home_page_test.dart +++ b/mobile/test/features/home/home_page_test.dart @@ -147,7 +147,8 @@ void main() { expect(find.byType(SearchPage), findsOneWidget); final searchRoute = ModalRoute.of(tester.element(find.byType(SearchPage)))!; expect(searchRoute.allowSnapshotting, isFalse); - expect(searchRoute.transitionDuration, const Duration(milliseconds: 240)); + expect(searchRoute.transitionDuration, Duration.zero); + expect(searchRoute.reverseTransitionDuration, Duration.zero); Navigator.of(tester.element(find.byType(SearchPage))).pop(); await tester.pumpAndSettle(); expect(find.byType(SearchPage), findsNothing);