fix retained activity detail filtering

Signed-off-by: kenny lopez <klopez4212@gmail.com>
This commit is contained in:
kenny lopez
2026-08-03 18:42:48 +01:00
parent c78d6cdf50
commit 621ce0e009
2 changed files with 43 additions and 0 deletions
@@ -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(
@@ -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 {