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

Multiple notification filters #16101

Closed

Conversation

ncounter
Copy link
Contributor

@ncounter ncounter commented May 7, 2024

What's changed?

Before, there was a list of links, where every link was loading a different subset of notifications based on a query string parameter type=..... It was possible to load one type of notifications at a time.
I.e.:

  • All Unread notifications
  • All Comment notifications
  • All home:my_project notifications

After, there are a list of filter options (the same amount of before), but now they are checkboxes, part of a form that can be submitted by an Apply button; this submit loads a subset of notifications filtered by the criteria of the checkboxes selection, this time as a multiple flavors selection based on status/type/project/group at the same time combining them with an AND among the filter group, and with an OR among the internal filter group option.
I.e.:

  • All Unread AND (Comments OR Requests) AND home:my_project
  • All Read AND (Reports OR Roles Revoked
  • All (Read OR Unread) AND Incoming Requests

Note

By default, if no filter is selected at all, it returns the list of Unread notifications only and it automatically check the Unread filter checkbox. It is intended to be so because at first, the user wants to read the Unread notifications only. Just in case the user selects the Read filter checkbox and applies the filter, then the read notifications will be rendered too.

  • No status selected (no Read|Unread) --> Unread notifications only
  • Read selected --> Read notifications only
  • Unread selected --> Unread notifications only
  • Both Read|Unread selected --> Both Read and Unread notifications returned

Note 2

Now that potentially both Read and Unread notifications are selected and rendered, when that scenario happens, the notification action bar that contains the select all checkbox and Mark all as read|unread button is not visible, due to the risk of misunderstanding: it would not be a mark as but it would be a toggler of the state of each selected notification, which is seldom the desired behavior for a multiple selection.

Before

image

After

image

@github-actions github-actions bot added the Frontend Things related to the OBS RoR app label May 7, 2024
@ncounter ncounter changed the title Notification filter items: from single links to checkboxes Multiple notification filters May 7, 2024
@danidoni danidoni force-pushed the notifications-multiple-filters branch from 940baf4 to eb0b97a Compare May 7, 2024 14:28
@ncounter ncounter force-pushed the notifications-multiple-filters branch from 813b9f2 to 5e12679 Compare May 8, 2024 10:21
@danidoni danidoni force-pushed the notifications-multiple-filters branch 2 times, most recently from b555a0d to 21c4027 Compare May 8, 2024 15:06
@ncounter ncounter force-pushed the notifications-multiple-filters branch from 1fcf0fc to 805dad8 Compare May 9, 2024 09:13
@danidoni danidoni force-pushed the notifications-multiple-filters branch 2 times, most recently from 37f545e to dc969a2 Compare May 9, 2024 10:15
@github-actions github-actions bot added the Test Suite / CI 💉 Things related to our tests/CI label May 9, 2024
@danidoni danidoni force-pushed the notifications-multiple-filters branch 4 times, most recently from 047556e to 998aac8 Compare May 9, 2024 15:47
@ncounter ncounter force-pushed the notifications-multiple-filters branch 9 times, most recently from 5ac4349 to 9f3f45e Compare May 10, 2024 20:43
@ncounter ncounter marked this pull request as ready for review May 10, 2024 21:02
@ncounter ncounter force-pushed the notifications-multiple-filters branch from 78efd5f to 8815369 Compare May 13, 2024 09:29
@saraycp
Copy link
Contributor

saraycp commented May 13, 2024

The counters are a bit confusing. Look at this screenshot, I filtered by Read and there are 4 results. However, the filter says there are 10 notifications related to the project home:Admin. I would expect the counter says how many of the four read notifications are also related to home:Admin.

Screenshot 2024-05-13 at 12-55-04 Open Build Service

srbaker
srbaker previously approved these changes May 13, 2024
src/api/app/models/notification.rb Show resolved Hide resolved
Copy link
Contributor

@saraycp saraycp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the feedback from others, I caught the following:

  • Text in the spec
  • Confusing behaviour of the counters (mentioned in a previous comment).

@danidoni
Copy link
Contributor

The counters are a bit confusing. Look at this screenshot, I filtered by Read and there are 4 results. However, the filter says there are 10 notifications related to the project home:Admin. I would expect the counter says how many of the four read notifications are also related to home:Admin.

Screenshot 2024-05-13 at 12-55-04 Open Build Service

Yeah, that sounds like a bug

ncounter and others added 17 commits May 15, 2024 15:22
Adapt the cleanup job using a scope
When we mark notifications as read or unread we get the
authenticity_token and several other parameters. When using strong
parameters, we have to explicitly permit them otheriwise the form is
never going to work. By namespacing the notification params, we can just
forget about those other params.
Only when one of the two status is selected [Read|Unread].
In case of both, the multiselection is disabled: it would be tricky to
select multiple notifications with different status and mark them "Read"
or "Unread" with no real criteria to decide.
@danidoni danidoni force-pushed the notifications-multiple-filters branch from 8b707b5 to d2954bd Compare May 15, 2024 13:22
danidoni pushed a commit to hennevogel/open-build-service that referenced this pull request May 20, 2024
This will be the foundation where we'll build a better openSUSE#16101.

We decouple the read/unread status of a notification from it's
type (which notifiable it associated to).
danidoni pushed a commit to hennevogel/open-build-service that referenced this pull request May 21, 2024
This will be the foundation where we'll build a better openSUSE#16101.

We decouple the read/unread status of a notification from it's
type (which notifiable it associated to).
ncounter pushed a commit to hennevogel/open-build-service that referenced this pull request May 22, 2024
This will be the foundation where we'll build a better openSUSE#16101.

We decouple the read/unread status of a notification from it's
type (which notifiable it associated to).
ncounter pushed a commit to hennevogel/open-build-service that referenced this pull request May 22, 2024
This will be the foundation where we'll build a better openSUSE#16101.

We decouple the read/unread status of a notification from it's
type (which notifiable it associated to).
@ncounter
Copy link
Contributor Author

Superseded by #16183

@ncounter ncounter closed this May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Things related to the OBS RoR app Test Suite / CI 💉 Things related to our tests/CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants