Skip to content

Maintain selected sort option when toggling filters #11849

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

shotor
Copy link

@shotor shotor commented Mar 8, 2025

In the database health report view:

If you sort by a column, then toggle one of the filters (show excluded, show expired) the user selected sort option is lost.

It tries to reset to sorting by the first column (quality) in ascending order. But that doesn't work either, you need to manually sort again. Or toggle filter again to get the "default sort" to actually take effect.

This PR stores the user sort option and restores it after filtering. Because it seems more like expected behavior from a user perspective.

Also valid is to fix the default sort, so it actually does reset the order when a filter has been toggled.

Screenshots

Old version

Step 1: Sort by score/descending

image

Step 2: Toggle show excluded entries. UI indicates the table is sorted by quality/ascending. But it's not, it's still the previous sort: score/descending.

image

Step 3: Toggle show excluded entries again. Now it's actually reset and displaying quality/ascending

image

New version

Step 1: Sort by score/descending

image

Step 2: Toggle show excluded entries. Sorting is kept to user choice score/descending.

image

Step 3: Toggling show excluded entries again. Sorting is kept to user choice score/descending.

image

Testing strategy

Created multiple passwords with different qualities.

Created expired password.

Exclude a password.

Then toggle and sort in every direction

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)

@shotor shotor force-pushed the fix/maintain-sort-toggle-filter branch from 9560e7a to 3f12af5 Compare March 8, 2025 01:37
@droidmonkey droidmonkey added this to the v2.7.11 milestone Mar 11, 2025
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.

2 participants