-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Feature - Implement basic search functionality v2 #159
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for quicksnip ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hey, @barrymun. Great work. 👍 After seeing the demo, I noticed that there is also |
@dostonnabotov This feature was in v1 (#34) and I thought it was to be implemented here too? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing as you changed a lot of things already, could you maybe add the language + category path to the url ? And make snippets link shareable to fix #56
IMO we should to it like so:
/
Default lang + default category/javascript
Lang + default category/javascript/category
Lang + Category*?q=search
Searching in,*
being the lang, category or lack of, in which you want the search to happen*?snippet=snippet-name
Opens the snippet preview,*
has the same behavior asq=
, both can be found at the same time to preserve search too
And we should be able to reconstruct the page based on that, for example:
quicksnip.dev/javascript/basics?q=hello&snippet=hello-world
Should open quicksnip on the javascript language, in the basics category, with a search of hello
and the hello-world
snippet opened
src/router.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the old way of handing routers in react router dom, please see: https://reactrouter.com/start/library/routing#routing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will see what I can do with regards the lang and category selection in the routes. I will also update the code so we use the new routing method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made some changes that should get this working. I haven't fully tested it, so it's not ready for merge, but I will confirm everything asap. The netlify build currently points to an older commit and I cannot force it to point to the latest commit, so this will need to be done if you would like to view the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Demo so far (there are some things that I don't like that will be fixed later): https://jam.dev/c/acdebbf9-df85-4a98-945e-48392067d9d8
@barrymun I see that you've been actively participating on improving QuickSnip. It would be awesome if you could join our Discord server. I will give you access to our maintainers channel, in which we discuss ideas and plans for QuickSnip. You have been really helpful for our project. |
@dostonnabotov Thank you, I'm already a member, and my username should be the same as it is here (barrymun). |
I will be away until next week but I think I have a decent solution for this, and will hopefully have the code ready shortly after I return. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
…L query param and not the search text, remove the searchVal state and just use the AppContext searchText state instead as it is cleaner, ensure that the search term is preserved when switching categories should one exist
Made some additional changes to fix some small bugs and refactored the code a little so that it is cleaner, but it should be ready now. |
Lets wait on another review and we are good to go |
Do you know if it's possible to point the netlify deploy to the latest commit for this branch? It still seems to be referencing the commit from last week and it would make it easier for others to test if it were updated. |
We disabled auto previews because we were running out of build time with our current plan, they will need to clone and test localy |
It works great but there are few minor issues,
|
I'm not a big fan of the site redirecting One option would be to, in the futur have a real homepage, with just the selection of languages |
We need something though, It doesn't make any sense to have one category on |
I'll keep on eye on the thread and see that everyone can agree on the functionality here. Thanks for reviewing |
For the search yeah it shouldnt require you to press enter. And it should update the url on blur and on enter |
… search will be performed as the user types, some refactoring
I've made the following changes to the search functionality:
Let me know if any other changes are required. |
Description
Type of Change
Checklist
Related Issues
Closes #64 #56
Additional Context
Screenshots (Optional)
Click to view screenshots