-
Notifications
You must be signed in to change notification settings - Fork 841
Reset selection after applying filter #13880
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
base: develop
Are you sure you want to change the base?
Reset selection after applying filter #13880
Conversation
Build Artifacts
|
nucleogenesis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic works but the behavior change needs to be applied to all three users table variants. Left a suggestion for your consideration. Thanks @AllanOXDi !
| watch([numAppliedFilters, searchTerm], (newValues, oldValues) => { | ||
| if (newValues[0] !== oldValues[0] || newValues[1] !== oldValues[1]) { | ||
| clearSelectedUsers(); | ||
| } | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic here looks good to me. However the behavior needs to also apply to the NewUserPage and UsersTrashPage components.
You could look at putting this logic into the useUserManagement.js composable - looks like we have the search and numAppliedFilters and it also houses the list of selectedUsers - so might be able to feed 3 birds with 1 stone since the other user table pages use useUserManagement for these values.
|
|
||
| const clearSelectedUsers = () => { | ||
| selectedUsers.value.clear(); | ||
| selectedUsers.value = new Set(selectedUsers.value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels odd - does calling clear() not update the value reactively?
This seems like it's doing the same thing as selectedUsers.value = new Set().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing this help us to clear the selection on the user page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did just setting selectedUsers.value = new Set() not work properly in this location?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I misunderstood you earlier btw 🤦🏾♂️
nucleogenesis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question re: how you're clearing the selection.
The other thing that'd be great to get in is to use your new method in all three of the user table variants (+Trash page, +New users page)
nucleogenesis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good to me & tested across New, Trash and normal Users pages successfully! Thanks for the quick turnaround @AllanOXDi
nucleogenesis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a blocking review as we are a bit uncertain on the desired behavior - perhaps this will be a good item to get user testing feedback on as well?
Also just want to avoid merging this in case we would rather target the release branch. (cc @marcellamaki @radinamatic )
Summary
This PR fixes any selected users remain selected even after having applied additional filters
Closes #13868
References
#13868
Before
selected.users.and.filters.mp4
After
Screen.Recording.2025-11-06.at.18.32.56.mov
Reviewer guidance