Implement plugin sorting functionality

Add support for sorting plugins by status, name,
or source in both ascending and descending order.
This commit is contained in:
Andrew
2026-07-02 17:29:54 +08:00
parent 5d8aa9610a
commit b724cb6631
12 changed files with 696 additions and 107 deletions

View File

@@ -118,6 +118,10 @@ function ShowExploreMenu() {
if (!exploreMenu || !exploreMenuButton)
return;
// why: our stopPropagation blocks the outside-click handler, so close the sibling sort menu ourselves (mirror of ToggleSortMenu).
if (typeof HideSortMenu === "function")
HideSortMenu();
exploreMenu.hidden = false;
exploreMenuButton.setAttribute("aria-expanded", "true");
}
@@ -214,6 +218,10 @@ function HandleStudio(value) {
if (payload.command === "list_plugins") {
SetSelectedInstallAction(payload.install_action, false);
if (typeof NormalizePluginSort === "function") {
pluginSort = NormalizePluginSort(payload.sort_key, payload.sort_order);
RenderSortMenuState();
}
ApplyPlugins(payload.data || []);
} else if (payload.command === "status_message") {
ShowStatusMessage(String(payload.message || ""), String(payload.level || "info"));