Skip to content

Conversation

@LeonBlade
Copy link

@LeonBlade LeonBlade commented Jun 13, 2025

Please tick as appropriate:

  • I have tested this code on a steam deck or on a PC
  • My changes generate no new errors/warnings
  • This is a bugfix/hotfix
  • This is a new feature

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 StorePlugin as 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:

  1. Add new filter to enum.
  2. Create translation key matching the enum string value in the proper path.
  3. Add functionality for the filtering in the filterPlugin function.

I'm interested in your thoughts on this implementation.

Demo

image

@LeonBlade LeonBlade marked this pull request as ready for review June 17, 2025 04:25
@sirwatt
Copy link

sirwatt commented Oct 11, 2025

Any update on merging this? As of today sorting is still reversed, as mentioned on the original issue.

@LeonBlade
Copy link
Author

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.

@sirwatt
Copy link

sirwatt commented Oct 13, 2025

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?
https://github.com/SteamDeckHomebrew/decky-plugin-store/blob/main/plugin_store/database/database.py#L224-L227
https://github.com/SteamDeckHomebrew/decky-plugin-store/blob/main/plugin_store/api/__init__.py#L145-L155

@LeonBlade
Copy link
Author

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? https://github.com/SteamDeckHomebrew/decky-plugin-store/blob/main/plugin_store/database/database.py#L224-L227 https://github.com/SteamDeckHomebrew/decky-plugin-store/blob/main/plugin_store/api/__init__.py#L145-L155

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.

@TrainDoctor TrainDoctor added javascript Pull requests that update Javascript code python Pull requests that update Python code labels Oct 16, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in SDH Tracker Oct 16, 2025
@TrainDoctor TrainDoctor moved this from 🆕 New to 🔖 Ready for review in SDH Tracker Oct 16, 2025
@EMERALD0874
Copy link
Member

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.

@LeonBlade
Copy link
Author

LeonBlade commented Oct 16, 2025

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.

@sirwatt
Copy link

sirwatt commented Oct 16, 2025

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.

Is this the right api url currently used? https://plugins.deckbrew.xyz/plugins?sort_by=name&sort_direction=asc
Do you know why asc and desc are returning reversed?
Edit: oh and capitalized letters are showing up first, and lowercase at the end. in this case inverted because every response is inverted

@EMERALD0874
Copy link
Member

Is this the right api url currently used? https://plugins.deckbrew.xyz/plugins?sort_by=name&sort_direction=asc Do you know why asc and desc are returning reversed? Edit: oh and capitalized letters are showing up first, and lowercase at the end. in this case inverted because every response is inverted

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.

@LeonBlade
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code python Pull requests that update Python code

Projects

Status: 🔖 Ready for review

Development

Successfully merging this pull request may close these issues.

4 participants