From 90340f71a3ad9581e3969c973eb3d0fcbd48d38b Mon Sep 17 00:00:00 2001 From: Lemmy Date: Fri, 23 Jan 2026 12:01:02 -0500 Subject: [PATCH] fuzzy-sort/launcher: no more insane threshold, default to 0.35. gives a +1 boost to apps. to ensure they get on top. --- Commons/FuzzySort.qml | 2 +- Modules/Panels/Launcher/Launcher.qml | 1 - Modules/Panels/Launcher/Providers/ApplicationsProvider.qml | 3 +-- Modules/Panels/Launcher/Providers/SettingsProvider.qml | 1 - Modules/Panels/Settings/SettingsContent.qml | 1 - Modules/Panels/Settings/Tabs/Plugins/AvailableSubTab.qml | 1 - Widgets/NSearchableComboBox.qml | 1 - 7 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Commons/FuzzySort.qml b/Commons/FuzzySort.qml index fdf335975..d729e2ac3 100644 --- a/Commons/FuzzySort.qml +++ b/Commons/FuzzySort.qml @@ -708,7 +708,7 @@ Singleton { var searchBitflags = preparedSearch.bitflags; var containsSpace = preparedSearch.containsSpace; - var threshold = _denormalizeScore(options?.threshold || 0); + var threshold = _denormalizeScore(options?.threshold ?? 0.35); var limit = options?.limit || _INFINITY; var resultsLen = 0; diff --git a/Modules/Panels/Launcher/Launcher.qml b/Modules/Panels/Launcher/Launcher.qml index 4ebb834e9..f9aae8e55 100644 --- a/Modules/Panels/Launcher/Launcher.qml +++ b/Modules/Panels/Launcher/Launcher.qml @@ -443,7 +443,6 @@ SmartPanel { // Use fuzzy search to filter commands const fuzzyResults = FuzzySort.go(query, allCommands, { "keys": ["name"], - "threshold": -1000, "limit": 50 }); diff --git a/Modules/Panels/Launcher/Providers/ApplicationsProvider.qml b/Modules/Panels/Launcher/Providers/ApplicationsProvider.qml index 45c1c7693..12a7b4e52 100644 --- a/Modules/Panels/Launcher/Providers/ApplicationsProvider.qml +++ b/Modules/Panels/Launcher/Providers/ApplicationsProvider.qml @@ -478,7 +478,6 @@ Item { if (typeof FuzzySort !== 'undefined') { const fuzzyResults = FuzzySort.go(query, filteredEntries, { "keys": ["name", "comment", "genericName", "executableName"], - "threshold": -1000, "limit": 20 }); @@ -538,7 +537,7 @@ Item { "description": app.genericName || app.comment || "", "icon": app.icon || "application-x-executable", "isImage": false, - "_score": score !== undefined ? score : 0, + "_score": (score !== undefined ? score : 0) + 1, "provider": root, "onActivate": function () { // Close the launcher/SmartPanel immediately without any animations. diff --git a/Modules/Panels/Launcher/Providers/SettingsProvider.qml b/Modules/Panels/Launcher/Providers/SettingsProvider.qml index 1c023d633..8c01b9ce9 100644 --- a/Modules/Panels/Launcher/Providers/SettingsProvider.qml +++ b/Modules/Panels/Launcher/Providers/SettingsProvider.qml @@ -62,7 +62,6 @@ Item { const results = FuzzySort.go(trimmed, items, { "keys": ["label", "subTabName", "description"], - "threshold": 0.35, "limit": 3, "scoreFn": function (r) { const labelScore = r[0].score; diff --git a/Modules/Panels/Settings/SettingsContent.qml b/Modules/Panels/Settings/SettingsContent.qml index a4d28c939..ba8469595 100644 --- a/Modules/Panels/Settings/SettingsContent.qml +++ b/Modules/Panels/Settings/SettingsContent.qml @@ -125,7 +125,6 @@ Item { const results = FuzzySort.go(searchText.trim(), items, { "keys": ["label", "subTabName", "description"], - "threshold": 0.35, "limit": 20, "scoreFn": function (r) { // r[0]=label, r[1]=subTabName, r[2]=description diff --git a/Modules/Panels/Settings/Tabs/Plugins/AvailableSubTab.qml b/Modules/Panels/Settings/Tabs/Plugins/AvailableSubTab.qml index 6f1ffaddc..6e3529cb1 100644 --- a/Modules/Panels/Settings/Tabs/Plugins/AvailableSubTab.qml +++ b/Modules/Panels/Settings/Tabs/Plugins/AvailableSubTab.qml @@ -133,7 +133,6 @@ ColumnLayout { if (query !== "") { var results = FuzzySort.go(query, filtered, { "keys": ["name", "description"], - "threshold": 0.35, "limit": 50 }); filtered = []; diff --git a/Widgets/NSearchableComboBox.qml b/Widgets/NSearchableComboBox.qml index 4080f1482..9200d3c35 100644 --- a/Widgets/NSearchableComboBox.qml +++ b/Widgets/NSearchableComboBox.qml @@ -133,7 +133,6 @@ RowLayout { if (typeof FuzzySort !== 'undefined') { var fuzzyResults = FuzzySort.go(query, items, { "key": "name", - "threshold": -1000, "limit": 50 });