Skip to content

Conversation

@AllanOXDi
Copy link
Member

@AllanOXDi AllanOXDi commented Nov 6, 2025

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

  1. Install the build from https://github.com/learningequality/kolibri/releases/tag/v0.19.0-beta1
  2. Go to Device > Users and select all of the available users.
  3. Apply a filter and observe that the number of selected users remains the same.

@github-actions github-actions bot added APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) DEV: frontend SIZE: very small labels Nov 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Copy link
Member

@nucleogenesis nucleogenesis left a 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 !

Comment on lines 282 to 286
watch([numAppliedFilters, searchTerm], (newValues, oldValues) => {
if (newValues[0] !== oldValues[0] || newValues[1] !== oldValues[1]) {
clearSelectedUsers();
}
});
Copy link
Member

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);
Copy link
Member

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().

Copy link
Member Author

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

Copy link
Member

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?

Copy link
Member Author

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 🤦🏾‍♂️

Copy link
Member

@nucleogenesis nucleogenesis left a 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)

Copy link
Member

@nucleogenesis nucleogenesis left a 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

Copy link
Member

@nucleogenesis nucleogenesis left a 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 )

@nucleogenesis nucleogenesis added the TODO: needs decisions Design or specifications are necessary label Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) DEV: frontend SIZE: small SIZE: very small TODO: needs decisions Design or specifications are necessary

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Facility > Users - Any selected users remain selected even after having applied additional filters

2 participants