-
-
Notifications
You must be signed in to change notification settings - Fork 272
Extension gallery enhancement: add search bar #2055
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
base: master
Are you sure you want to change the base?
Conversation
We definitely need a tags/sort-filter system |
I can put it to the right of the search bar tomorrow, but it's getting a little late here Tags would be interesting, but since this is client-side and relies on the page being already loaded we need a way to inject these and store them permanently when the page is loaded by EJS.... I can probably do a "filter by author" and "sort alphabetically" tomorrow as well, but sorting by release date would be tricky and would also need a similar solution to tags |
Todo:
|
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.
just some minor nitpicks and changes
@yuri-kiss I'd still like to add some sort/filter features to this |
This comment was marked as off-topic.
This comment was marked as off-topic.
Working on a sort system, but things are about to get tricky. @CubesterYT We need to decide how we're going to go about assigning attributes (e.g., tags, release dates, etc.) to various extensions. we could do it in extensions.json but that would quickly clutter things. I might also need to modify the homepage renderer to include some data attributes in the Sorting alphabetically is relatively easy, sorting by release date is harder. Filtering by category is virtually impossible without extensions assigned to categories. |
Added a simple sort system that can sort by the original order (the order in extensions.json), ABC, and ZXY order. |
@CubesterYT the extension search bar in the add extension menu of the It would really be a pain trying to tag all of the various extensions. Is there anyway that just a search bar and XYZ, ZXY, and default sorting is acceptable for production? of course, we could always add it later, but my tiny brain cells can't think up a way to reasonably do it without modifying |
We could put tags in a comma-delimited comment in the header metadata of individual extensions and iterate through the files in JS to get which tags are there:
So for example even though neither the title or description contains "3D", the tag does, so Ammo Physics would show up with Simple3D. Searching by tags would be case insensitive, so "3d" would also work. We could also possibly display tags on the website below the description as small Bootstrap badges. The trickier part would be keeping track of release dates, as the user doesn't know beforehand when their extension will first be merged into the gallery. I could write a custom workflow / GitHub action that executes when a PR with a "pr: new extension" tag has been merged to automatically create a new comment at the bottom of the metadata, such as:
and then the JS file for searching and sorting could read the released comment to sort extensions by the date they were released, but there could potentially be many security concerns with executing a workflow on a PR before it's completely merged.... Of course the workflow would only work on New Extension PRs so it wouldn't override the original release date when an extension is updated. Also don't really know how that would work but these are ideas and suggestions and I'm looking for feedback. Filtering would also not be fun to integrate but it's definitely possible... There'd probably be a button or something that brings up a modal or tooltip or something with some check boxes that you can use to filter but I don't know what we would filter by |
I feel like you could just make a separate extension search metadata json |
Then contributors have to find yet another file to add metadata too, even though there's already a place for metadata at the top of their .js files. Wouldn't it just make things more complicated? |
i think she means it would be auto-generated from the js file comments, LIKE IT IS ALREADY DONE for the gallery metadata used in the editor |
the top of the extensions is going to be so bloated at this point |
So did we want to add filter stuff or just merge this how it is It'd just be a big mess to code and I don't see any reason that would justify adding it if filter functionality would be limited and not really that helpful |
This is a small pull request that adds a client-side JS search bar to the extension gallery. It searches by the contents of the titles and descriptions. It doesn't require that a result that starts with the search query, only that the results' strings contain the search query.
Potentially could also add sort/filter too
video.mp4