Skip to content

Smarter Resources - Search bar!#660

Merged
lemonsaurus merged 23 commits into
mainfrom
659/lemon/resource_search_bar
Feb 13, 2022
Merged

Smarter Resources - Search bar!#660
lemonsaurus merged 23 commits into
mainfrom
659/lemon/resource_search_bar

Conversation

@lemonsaurus
Copy link
Copy Markdown
Contributor

@lemonsaurus lemonsaurus commented Feb 13, 2022

Implements a search feature on the resources page
search final

You can test it on the deploy preview!
https://deploy-preview-660--pydis-static.netlify.app/

Features

  • Uses fuzzysort to do fuzzy matching against resource titles.
  • Fully reactive! ✨ Every keypress triggers a search.
  • Updates the URL to match the search query, and loads the search on page load when a ?search= parameter is provided.
    live updating query
  • Will match even if the user has a typo in the search query.
    image
  • Adds a tag to the filter tag pool whenever a search is live.
    search tag

Kaizen

  • Fixes redirects to /pages/resources/communities, these are used in the !guild tag on the bot.
  • Ensures that resource cards are always fullwidth. Previously they would only fill the width needed for the longest description of the visible resource cards.
  • Update the URL for Two Scoops of Django. The previous one was broken.

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 13, 2022

✔️ Deploy Preview for pydis-static ready!

🔨 Explore the source changes: d612953

🔍 Inspect the deploy log: https://app.netlify.com/sites/pydis-static/deploys/62095818a1a38e0008893a3a

😎 Browse the preview: https://deploy-preview-660--pydis-static.netlify.app

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 13, 2022

Coverage Status

Coverage remained the same at 100.0% when pulling d612953 on 659/lemon/resource_search_bar into db67e67 on main.

@lemonsaurus lemonsaurus linked an issue Feb 13, 2022 that may be closed by this pull request
Without a min-width, the tag would not extend to fit the full
size of the contents on Firefox. It seemed to work just fine on
Chrome, though. The fix is simple - just enforce a min-width equal
to fit-content.
@jchristgit jchristgit self-requested a review February 13, 2022 15:16
Comment thread pydis_site/templates/resources/resource_box.html Outdated
Comment thread pydis_site/templates/resources/resources.html Outdated
Copy link
Copy Markdown
Contributor

@jchristgit jchristgit 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 great lemon. Stunning work on the Smarter Resources. I don't understand anything about JavaScript or CSS or HTML for that matter, but I think this is great.

Copy link
Copy Markdown
Contributor

@whispersofthedawn whispersofthedawn left a comment

Choose a reason for hiding this comment

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

This looks wonderful! I don't know much about Django, but from what I do know about JS, that all looks great. The search experience is flawless, too.

Copy link
Copy Markdown
Contributor

@MarkKoz MarkKoz left a comment

Choose a reason for hiding this comment

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

The close button doesn't look great when the bar is really wide
bild

I think this is actually a problem with the bar's width, as it shouldn't get that wide in the first place. It seems to try to match the width of the line below it, but when a 3rd line gets added, it gets too wide:

bild

bild

Comment thread pydis_site/apps/resources/resources/python_discord_videos.yaml Outdated
Comment thread pydis_site/templates/resources/resources.html
lemonsaurus and others added 2 commits February 13, 2022 19:50
Co-authored-by: Mark <1515135+MarkKoz@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@MarkKoz MarkKoz left a comment

Choose a reason for hiding this comment

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

I've gone over the code and played around with it on netlify. Looks good!

@lemonsaurus lemonsaurus merged commit 4196696 into main Feb 13, 2022
@lemonsaurus lemonsaurus deleted the 659/lemon/resource_search_bar branch February 13, 2022 19:18
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.

Smarter Resources: Search bar

5 participants