mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
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:
@@ -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;
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -133,7 +133,6 @@ RowLayout {
|
||||
if (typeof FuzzySort !== 'undefined') {
|
||||
var fuzzyResults = FuzzySort.go(query, items, {
|
||||
"key": "name",
|
||||
"threshold": -1000,
|
||||
"limit": 50
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user