Skip to content

Conversation

@emma-sg
Copy link
Member

@emma-sg emma-sg commented Oct 8, 2025

Closes #2885

Changes

  • Enumerates all possible values of filterBy when updating search params to match value on archived item list
  • Adds a new isNotEqual wrapper that inverts lodash's isEqual for use in the hasChanged option of @property/@state decorator functions
    • Applies these wherever relevant, both within and outside of filters
  • Updates how maps are updated in checkbox filters
    • Previously they were updated by updating the value of the old map, and then creating a new map with the updated old map as an initial value. While this works fine for the default comparator which compares values by reference, because every updated causes the map to be recreated we need to compare values of the map by value instead, which meant that because the old value was updated before creating the new map, the old and new map would have the same contents when compared.
    • The solution here is to create a new map by using the existing value of the old map plus the update as a key-value tuple as the initial value. This way the old value isn't updated, so the by-value comparison works as expected.

Testing

  • On both the workflows and archived items list pages, test that all of the filter chips work as expected.
    • In particular, test that checkbox-type filters update the state of the filter chips as well as the URLs when clicked, and that they don't hang your browser
  • On the archived items list page, test that you can enter a search term, and then clear that term, and that the URL updates to reflect both changes.

Known issues

The search box on the workflows list page is not yet hooked up to persist its value via URL. That's coming soon!

- adds a new `isNotEqual` util that wraps and inverts lodash's `isEqual`
for use in `hasChanged` in `@property`/`@state` - updates instances
where we were using inline arrow functions that do the same thing to use
this new helper - fixes how the selected map was being updated: the old
state was updated to be the same value as the new one, so the by-value
comparison wasn't working as intended
@emma-sg emma-sg requested a review from SuaYoo October 8, 2025 22:25
@emma-sg emma-sg merged commit 5be8577 into main Oct 9, 2025
29 checks passed
@emma-sg emma-sg deleted the frontend-fix-filter-bugs branch October 9, 2025 01:36
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.

[Bug]: URL doesn't update when clearing search results

3 participants