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

Search resources #306

Merged
merged 12 commits into from
Aug 28, 2023
Merged

Conversation

christina-ml
Copy link
Contributor

@christina-ml christina-ml commented Aug 1, 2023

Describe your changes

Added search bar filter and moved it into its own component to filter resources

Related issue number/link

Fixes #296

Thanks for contributing! 🥳🚀🌳
Screenshot 2023-08-01 at 4 15 41 PM

@VeckoTheGecko
Copy link
Collaborator

Hi @christina-ml , thanks for the PR! Would you be able to provide some insight into how the implemented search functionality differs from fuzzy searching packages like Fuse.js? (https://www.fusejs.io/) Would fusejs be a quick, free way to offload some code and get some good search functionality for the codebase in return?

Align form to the left by removing padding and adding margin to the bottom.
Change lib// to $lib/ for importing Search.svelte
Remove unused variables: searchResults and mainH1El
@VeckoTheGecko VeckoTheGecko mentioned this pull request Aug 15, 2023
@christina-ml
Copy link
Contributor Author

@VeckoTheGecko Added fuse.js to implement fuzzy searching.
Installed fuse.js with command npm install fuse.js
Set the threshold to 0.25 which matches close enough to most searches I tested.
Screenshot 2023-08-15 at 4 34 44 PM

@christina-ml
Copy link
Contributor Author

christina-ml commented Aug 15, 2023

@VeckoTheGecko @dmlb I have resolved all above changes on this pull request.

@VeckoTheGecko
Copy link
Collaborator

VeckoTheGecko commented Aug 21, 2023

As a point of discussion: how should the search work when there are also tags being used? At the moment, the search bar and the tag filter are completely independent and don't work in conjunction (which is fine by me). Is there a way that this can be made clearer in the UI? Or is the visual separation between the search bar and the tag filters enough?

EDIT: Let's leave this for a future conversation :)

@VeckoTheGecko VeckoTheGecko merged commit 8ee18f8 into ClimateTown:main Aug 28, 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.

[FEATURE] Build a reusable search component, similar to a modularized filter component
3 participants