Add group dropdown to post filter dialog (#16) #17
Loading…
Reference in a new issue
No description provided.
Delete branch "ocbot426786/feet:feature/group-filter-dropdown"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What?
Closes #16 — "Dropdown to select group": allow the user to only view posts in a specific Fever group.
The app already requests and caches groups (
?groups) together with thefeeds_groupsmapping during refresh, but nothing in the UI ever used that data. The only way to narrow down posts was the feed check-list, so a user could not filter by a whole group.This change exposes the groups in the existing filter dialog as a dropdown:
Filter (group: …)), and choosing All groups again clears it.When a group is selected, the group filter and feed filter are combined (ANDed), so manually unchecking a feed inside a group also works.
Implementation
lib/api/cache.dart: newAPICache.feedsInGroup(groupId)that resolves the feeds of a group fromfeeds_groups, skipping feed ids which are missing from the cache (defensive against deleted/not-yet-fetched feeds).lib/widgets/filter_menu.dart: newDropdownButton<int?>at the top of the dialog listing "All groups" plus all cached groups (sorted by title); the feed list and summary text adapt to the selected group; the confirm callback now also returns the selected group id.lib/main.dart: new_groupFilterstate wired into the sharedpostspredicate for all three pages, the dialog invocation, the menu label, and the full-refresh reset.Testing
Added
test/group_filter_test.dart:APICache.feedsInGroup()(resolution, unknown group, stale feed ids).Manual check on a device/emulator: open the popup menu → Filter..., pick a group in the dropdown, tap Done, and confirm only posts from that group's feeds are shown in all three tabs. I wasn't able to run the Android UI in this environment, so this part is only covered by the widget tests above.
Screenshots
The dropdown reuses the Material 3 styling of the existing filter dialog (a
DropdownButtonabove the feed check-list), so no new visual language is introduced.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.