Skip to content

Reset selection after applying filter#13880

Merged
nucleogenesis merged 5 commits intolearningequality:release-v0.19.xfrom
AllanOXDi:reset-selection-after-applying-filter
Feb 24, 2026
Merged

Reset selection after applying filter#13880
nucleogenesis merged 5 commits intolearningequality:release-v0.19.xfrom
AllanOXDi:reset-selection-after-applying-filter

Conversation

@AllanOXDi
Copy link
Copy Markdown
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. Go to Device > Users and select all of the available users.
  2. 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
Copy Markdown
Contributor

github-actions Bot commented Nov 6, 2025

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@rtibbles rtibbles changed the base branch from develop to release-v0.19.x December 17, 2025 21:39
@nucleogenesis
Copy link
Copy Markdown
Member

Noting here that we've come to a decision to merge this experience. @tomiwaoLE has some early work on a revision to the table that would improve the table experience which we'll come back to when time/priorities align.

So - this needs to be rebased and probably a quick pass at some manual QA would be worthwhile to check for rebase-related regressions.

@AllanOXDi AllanOXDi closed this Feb 20, 2026
@AllanOXDi AllanOXDi force-pushed the reset-selection-after-applying-filter branch from 7a32fde to 849325a Compare February 20, 2026 11:14
@AllanOXDi AllanOXDi reopened this Feb 20, 2026
@nucleogenesis nucleogenesis requested a review from pcenov February 23, 2026 17:04
Copy link
Copy Markdown
Member

@pcenov pcenov left a comment

Choose a reason for hiding this comment

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

Thanks @AllanOXDi - I confirm that after applying a filter or searching for a user the previously selected users are no longer selected.

@nucleogenesis nucleogenesis dismissed their stale review February 24, 2026 17:32

Decision made, executed, and ready to merge!

@nucleogenesis nucleogenesis merged commit ac480c8 into learningequality:release-v0.19.x Feb 24, 2026
119 checks passed
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

4 participants