-
Notifications
You must be signed in to change notification settings - Fork 208
Client side sorting/filtering for the Store page #781
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: main
Are you sure you want to change the base?
Conversation
|
Any update on merging this? As of today sorting is still reversed, as mentioned on the original issue. |
They don't want to accept this as a fix to the issue due to the API being the core cause of this problem. I don't know if that code is public or not. |
Went around searching and found this, but the problem is that it looks fine? |
Right now they flipped it on the front end. It's possible that things are just working fine now and they could accept this PR albeit with some changes. I'll have to look at it some more when I have some free time. |
|
I like many of the changes here, but sorting on the frontend could present a problem if pagination is ever added to the store. I believe that's why we have API requests when sorting. |
I believe someone else mentioned this before on the Discord. I'm happy to remove sorting logic from the frontend code. |
Is this the right api url currently used? https://plugins.deckbrew.xyz/plugins?sort_by=name&sort_direction=asc |
I've not had time to research the issue nor do I contribute to the plugin store repo, but the relevant code is here if you'd like to take a look. I think the endpoint may've had issues sorting when I worked on the new store layout, leading to inconsistencies between the button label and API request made by Decky Loader. |
|
At first glance I don't see anything wrong. I can't really get the plugin repo to work locally at the moment plus I have to seed it with some data. If someone knows more about issues with the API it would be better for now. |
Please tick as appropriate:
Description
This fixes issue: #768
NOTE: This fix doesn't change the backend and the original functionality of fetching with sort still has it's issue.
Currently the way that the frontend sorts the plugin lists by going through the backend and making new network requests each time. This means wasted bandwidth and added latency for every time you want to change sorting order. Over time, more plugins will mean a bigger network response.
This PR introduces client side sorting and also filtering. The plugin list is fetched once when the component loads, and subsequent filtering and sorting is done on the client. This means we're only fetching data once on page load.
I also did expose a few missing properties for
StorePluginas part of this change and shouldn't affect functionality of the rest of the app.I also did make a few adjustments to how the dropdown for sorting is handled with data opting for a singular key instead of the tuple. For filtering, I did opt for a pattern which allows for a more seamless integration of new filter patterns:
filterPluginfunction.I'm interested in your thoughts on this implementation.
Demo