From e3cbb769f63813a2a2e90aa9607dcc7359a18903 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 21 Oct 2026 10:33:48 +0200 Subject: settings: a keyword hit stays out when a row matches too Searching "zoom" listed Mail twice: once for the module keyword, which opens the page at the top, and once for the Message zoom row, which scrolls to it and flashes it. The keyword hit looked like a reveal that failed. It now shows only when none of the page's rows match. Co-Authored-By: Claude Opus 5.5 --- desktop/Settings.qml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'desktop/Settings.qml') diff --git a/desktop/Settings.qml b/desktop/Settings.qml index 607d6a3..e73445c 100644 --- a/desktop/Settings.qml +++ b/desktop/Settings.qml @@ -54,16 +54,17 @@ Scope { const q = root.query.trim().toLowerCase(); const out = []; for (const m of root.pages) { + // ponytail: the first perPage rows per page; a narrower query finds the rest. + const rows = q === "" ? [] : m.searchItems.filter(it => it.text.toLowerCase().includes(q)).slice(0, root.perPage); if (q === "" || m.label.toLowerCase().includes(q) || m.name.includes(q)) out.push({ mod: m, hit: "", key: "" }); - else { + else if (rows.length === 0) { + // A keyword that a row also matches would only repeat that + // row as a hit that opens at the top, so it shows alone. const k = Array.from(m.keywords).find(w => w.toLowerCase().includes(q)); if (k !== undefined) out.push({ mod: m, hit: k, key: "" }); } - if (q === "") continue; - // ponytail: the first perPage rows per page; a narrower query finds the rest. - for (const it of m.searchItems.filter(it => it.text.toLowerCase().includes(q)).slice(0, root.perPage)) - out.push({ mod: m, hit: it.text, key: it.key }); + for (const it of rows) out.push({ mod: m, hit: it.text, key: it.key }); } return out; } -- cgit v1.2.3