sort by search score in plugin installer if opened w/ search text (#2246)

This commit is contained in:
Cytraen 2025-04-15 15:33:28 -04:00 committed by GitHub
parent 3f724170b2
commit af1eb275cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -285,9 +285,13 @@ internal class PluginInstallerWindow : Window, IDisposable
_ = pluginManager.ReloadPluginMastersAsync(); _ = pluginManager.ReloadPluginMastersAsync();
Service<PluginManager>.Get().ScanDevPlugins(); Service<PluginManager>.Get().ScanDevPlugins();
if (!this.isSearchTextPrefilled) this.searchText = string.Empty; if (!this.isSearchTextPrefilled)
this.sortKind = PluginSortKind.Alphabetical; {
this.filterText = Locs.SortBy_Alphabetical; this.searchText = string.Empty;
this.sortKind = PluginSortKind.Alphabetical;
this.filterText = Locs.SortBy_Alphabetical;
}
this.adaptiveSort = true; this.adaptiveSort = true;
if (this.updateStatus == OperationStatus.Complete || this.updateStatus == OperationStatus.Idle) if (this.updateStatus == OperationStatus.Complete || this.updateStatus == OperationStatus.Idle)
@ -363,11 +367,20 @@ internal class PluginInstallerWindow : Window, IDisposable
{ {
this.isSearchTextPrefilled = false; this.isSearchTextPrefilled = false;
this.searchText = string.Empty; this.searchText = string.Empty;
if (this.sortKind == PluginSortKind.SearchScore)
{
this.sortKind = PluginSortKind.Alphabetical;
this.filterText = Locs.SortBy_Alphabetical;
this.ResortPlugins();
}
} }
else else
{ {
this.isSearchTextPrefilled = true; this.isSearchTextPrefilled = true;
this.searchText = text; this.searchText = text;
this.sortKind = PluginSortKind.SearchScore;
this.filterText = Locs.SortBy_SearchScore;
this.ResortPlugins();
} }
} }