Skip to content
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

Functional Filters! #42

Merged
merged 28 commits into from
Nov 9, 2023
Merged

Functional Filters! #42

merged 28 commits into from
Nov 9, 2023

Conversation

charmingduchess
Copy link
Contributor

@charmingduchess charmingduchess commented Nov 3, 2023

NB: to see the filters in action, head to the vercel preview and click on the advanced search button. clicking apply will show you the query that would be added to the url.

Basic overview:

  • Filters open and close.
    • I did not use the Accordion component because there is a ton of styling overrides required. Also much of the open/closed logic would still need to be ported from this solution, such as only having one filter open at a time, and closing on blur and escape key.
  • options selected in a checkbox group are not persisted when that filter closes unless the filter has been applied
  • applied filters are the filters that generate the url (and are in turn generated by the url)

honestly more than anything i would appreciate just folks clicking around and trying to break things! the expected behavior is a little kooky but I'm confident this work does what DFE does, for better or for worse.

I closed 3664 because i was getting very tangled going back and forth between the two branches. i incorporated the rest of yall's requests into this PR.

Copy link

vercel bot commented Nov 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
research-catalog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2023 3:43pm

@charmingduchess
Copy link
Contributor Author

Added styling!

Copy link
Member

@EdwinGuzman EdwinGuzman left a comment

Choose a reason for hiding this comment

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

This is really well done! Really liking the functional style for the data model and logic.

Nothing big to update/flag in the code and some things are "temp". There is this issue with the dropdown not layered correctly:
Screen Shot 2023-11-08 at 1 32 23 PM

I think one accessibility issue Clare might bring up is keeping focus within the filter button and the elements inside its dropdown. Right now, when you tab through the filters, you just continue to the next element on the page (this is how I landed on the above visual bug).

src/types/filterTypes.ts Show resolved Hide resolved
src/utils/itemFilterUtils.ts Outdated Show resolved Hide resolved
src/utils/itemFilterUtils.ts Outdated Show resolved Hide resolved
src/utils/utilsTests/itemFilterUtils.test.tsx Outdated Show resolved Hide resolved
src/utils/utilsTests/itemFilterUtils.test.tsx Outdated Show resolved Hide resolved
src/components/ItemFilters/ItemFilters.test.tsx Outdated Show resolved Hide resolved
src/models/itemFilterData.ts Show resolved Hide resolved
src/components/ItemFilters/ItemFilterButtons.tsx Outdated Show resolved Hide resolved
src/components/ItemFilters/ItemFilterLabel.tsx Outdated Show resolved Hide resolved
@apoorvakhanolkar
Copy link

My only comment is to set the dropdowns to a fixed width of 200px with a spacing of 32px between them, so that they have some breathing room.

@charmingduchess
Copy link
Contributor Author

@apoorvakhanolkar would you be okay 230px for the filter width and 16px margin? At 200px the longer labels wrap in a way that I find hard to read

@apoorvakhanolkar
Copy link

@apoorvakhanolkar would you be okay 230px for the filter width and 16px margin? At 200px the longer labels wrap in a way that I find hard to read

Yes that's OK

@charmingduchess
Copy link
Contributor Author

We decided to not worry about the tabbing/z index/focus issue until we get feedback from Clare about accessibility

@charmingduchess charmingduchess merged commit 7b4f25d into main Nov 9, 2023
2 checks passed
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.

3 participants