fuzzy-sort/launcher: no more insane threshold, default to 0.35. gives a +1 boost to apps. to ensure they get on top.

This commit is contained in:
Lemmy
2026-01-23 12:01:02 -05:00
parent ee2e9cdb0c
commit 90340f71a3
7 changed files with 2 additions and 8 deletions
+1 -1
View File
@@ -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;
-1
View File
@@ -443,7 +443,6 @@ SmartPanel {
// Use fuzzy search to filter commands
const fuzzyResults = FuzzySort.go(query, allCommands, {
"keys": ["name"],
"threshold": -1000,
"limit": 50
});
@@ -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.
@@ -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;
@@ -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
@@ -133,7 +133,6 @@ ColumnLayout {
if (query !== "") {
var results = FuzzySort.go(query, filtered, {
"keys": ["name", "description"],
"threshold": 0.35,
"limit": 50
});
filtered = [];
-1
View File
@@ -133,7 +133,6 @@ RowLayout {
if (typeof FuzzySort !== 'undefined') {
var fuzzyResults = FuzzySort.go(query, items, {
"key": "name",
"threshold": -1000,
"limit": 50
});