Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Initial support for filtering notifications by sending account #1127

Merged
merged 9 commits into from
Nov 25, 2024

Conversation

nikclayton
Copy link
Contributor

Allow the user to define filtering rules for notifications by sending account:

  • Not followed
  • Younger than 30d
  • Limited by moderators

and a policy for each of either show, warn, or hide.

To do this:

Manage followers

  • Create a new FollowingAccountEntity, to record accounts the logged in account is following.
  • Fetch the account's followers when an account is made active, and persist to this table.
  • Provide the followers as a property on PachliAccount
  • Update this table if the user follows/unfollows accounts during normal operation.

Track account creation time

  • Record account creation time in TimelineAccount.

Track notification creation time

  • Record notification creation time in Notification.

API

  • Always fetch all notifications, including those the server is filtering.

UX and storage for account filters

  • Show a new Account preference to edit account notification filters.
  • Display a dialog to manage account notification filters.
  • Persist the user's choice to new properties in AccountEntity.
  • New AccountManager methods to update the properties

Filtering notifications

  • New NotificationFilter.filterNotificationByAccount() method to make the filtering decision based on the user's preferences.
  • Use this in NotificationFetcher to filter notifications before creating Android notifications.
  • Use this in NotificationsViewModel to filter notifications before display in NotificationsFragment.

UX for filtered notifications

  • Display filtered (with warning) notifications inline with other notifications, with UI to disclose the notification or edit the filters.

Allow the user to define filtering rules for notifications by sending
account:

- Not followed
- Younger than 30d
- Limited by moderators

and a policy for each of either show, warn, or hide.

To do this:

## Manage followers

- Create a new `FollowingAccountEntity`, to record accounts the
logged in account is following.
- Fetch the account's followers when an account is made active, and
persist to this table.
- Provide the followers as a property on `PachliAccount`
- Update this table if the user follows/unfollows accounts during
normal operation.

## Track account creation time

- Record account creation time in `TimelineAccount`.

## Track notification creation time

- Record notification creation time in `Notification`.

## API

- Always fetch all notifications, including those the server is
filtering.

## UX and storage for account filters

- Show a new Account preference to edit account notification filters.
- Display a dialog to manage account notification filters.
- Persist the user's choice to new properties in `AccountEntity`.
- New `AccountManager` methods to update the properties

## Filtering notifications

- New `NotificationFilter.filterNotificationByAccount()` method to
make the filtering decision based on the user's preferences.
- Use this in `NotificationFetcher` to filter notifications before
creating Android notifications.
- Use this in `NotificationsViewModel` to filter notifications before
display in `NotificationsFragment`.

## UX for filtered notifications

- Display filtered (with warning) notifications inline with other
notifications, with UI to disclose the notification or edit the
filters.
@nikclayton nikclayton merged commit e009c00 into pachli:main Nov 25, 2024
24 checks passed
@nikclayton nikclayton deleted the 92x-notification-filters branch November 25, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant