From 621ce0e009ce15cb2c38ee3774bc7b48113ac0d1 Mon Sep 17 00:00:00 2001 From: kenny lopez Date: Mon, 3 Aug 2026 18:42:48 +0100 Subject: [PATCH] fix retained activity detail filtering Signed-off-by: kenny lopez --- .../lib/features/activity/activity_page.dart | 3 ++ .../features/activity/activity_page_test.dart | 40 +++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/mobile/lib/features/activity/activity_page.dart b/mobile/lib/features/activity/activity_page.dart index 92e91b8cc..703d3c50c 100644 --- a/mobile/lib/features/activity/activity_page.dart +++ b/mobile/lib/features/activity/activity_page.dart @@ -378,6 +378,9 @@ class ActivityPage extends HookConsumerWidget { draftCount: drafts.length, onChanged: (nextFilter) { filter.value = nextFilter; + selectedItemId.value = null; + selectedItemTarget.value = null; + selectedItemForDetail.value = null; }, ), _InboxOptionsButton( diff --git a/mobile/test/features/activity/activity_page_test.dart b/mobile/test/features/activity/activity_page_test.dart index 2b88af6ce..79681737c 100644 --- a/mobile/test/features/activity/activity_page_test.dart +++ b/mobile/test/features/activity/activity_page_test.dart @@ -316,6 +316,46 @@ void main() { }, ); + testWidgets('clears a retained wide detail when its filter changes', ( + tester, + ) async { + tester.view.physicalSize = const Size(1180, 820); + tester.view.devicePixelRatio = 1; + addTearDown(() { + tester.view.resetPhysicalSize(); + tester.view.resetDevicePixelRatio(); + }); + + await tester.pumpWidget( + await buildTestable( + feed: HomeFeedResponse( + mentions: [testMention], + needsAction: const [], + activity: const [], + agentActivity: const [], + ), + ), + ); + await tester.pumpAndSettle(); + + await tester.tap(find.byKey(const ValueKey('inbox-row-m1'))); + await tester.pumpAndSettle(); + expect(find.byType(ChannelDetailPage), findsOneWidget); + + await tester.tap(find.byKey(const ValueKey('activity-options-menu'))); + await tester.pumpAndSettle(); + await tester.tap(find.text('Show unread')); + await tester.pumpAndSettle(); + expect(find.byType(ChannelDetailPage), findsOneWidget); + + await tester.tap(find.byKey(const ValueKey('activity-filter-menu'))); + await tester.pumpAndSettle(); + await tester.tap(find.text('Reminders')); + await tester.pumpAndSettle(); + + expect(find.byType(ChannelDetailPage), findsNothing); + }); + testWidgets('keeps footer clearance inside the scrollable content', ( tester, ) async {