From 3dfa83e4073f841e6c4ad4bfc6151faffc3ddfd0 Mon Sep 17 00:00:00 2001 From: Andrew <159703254+andrewsoonqn@users.noreply.github.com> Date: Thu, 9 Jul 2026 18:59:11 +0800 Subject: [PATCH] Add search count indication --- resources/web/dialog/SpeedDial/index.html | 1 + resources/web/dialog/SpeedDial/speeddial.js | 12 +++++++++--- resources/web/dialog/SpeedDial/style.css | 7 +++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/resources/web/dialog/SpeedDial/index.html b/resources/web/dialog/SpeedDial/index.html index 0a3b9f6947..0947bf3085 100644 --- a/resources/web/dialog/SpeedDial/index.html +++ b/resources/web/dialog/SpeedDial/index.html @@ -23,6 +23,7 @@ +
diff --git a/resources/web/dialog/SpeedDial/speeddial.js b/resources/web/dialog/SpeedDial/speeddial.js index 60652463a5..48ffcfab91 100644 --- a/resources/web/dialog/SpeedDial/speeddial.js +++ b/resources/web/dialog/SpeedDial/speeddial.js @@ -18,7 +18,7 @@ function NormChar(ch) { } // element handles, assigned in OnInit (kept null so load-time touches no DOM) -var qEl = null, listEl = null, favEl = null, clearEl = null, eyeEl = null; +var qEl = null, listEl = null, favEl = null, clearEl = null, eyeEl = null, countEl = null; // ---- pure helpers (no DOM; unit-tested) ------------------------------------- function fuzzyRanges(text, query) { @@ -239,16 +239,22 @@ function renderList() { // non-empty query with zero hits earns the "No actions match" message. if (!q) { listEl.className = "dial-list empty"; + if (countEl) countEl.hidden = true; return; } listEl.className = "dial-list" + (!arr.length ? " empty" : ""); if (!arr.length) { + if (countEl) countEl.hidden = true; var empty = document.createElement("div"); empty.className = "dial-empty"; - empty.textContent = "No actions match"; + empty.textContent = "No actions match (Total: " + ACTIONS.length + ")"; listEl.appendChild(empty); return; } + if (countEl) { + countEl.hidden = false; + countEl.textContent = "Showing " + arr.length + " of " + ACTIONS.length + " actions"; + } arr.forEach(function (a, i) { var on = FAVS.indexOf(a.id) !== -1; var row = document.createElement("div"); @@ -361,7 +367,7 @@ function focusInput() { setTimeout(function () { qEl.focus(); }, 0); } // ---- init -------------------------------------------------------------------- function OnInit() { - qEl = $("q"); listEl = $("list"); favEl = $("favBar"); clearEl = $("clear"); eyeEl = $("favEyebrow"); + qEl = $("q"); listEl = $("list"); favEl = $("favBar"); clearEl = $("clear"); eyeEl = $("favEyebrow"); countEl = $("count"); syncClearButton(); $("clear").onclick = function () { diff --git a/resources/web/dialog/SpeedDial/style.css b/resources/web/dialog/SpeedDial/style.css index 5a0ba0f023..7c6fb5ffc1 100644 --- a/resources/web/dialog/SpeedDial/style.css +++ b/resources/web/dialog/SpeedDial/style.css @@ -86,6 +86,13 @@ body { background: rgba(127,127,127,.20); } .plugin-search-clear[hidden] { display: none; } +.dial-count { + padding: 4px 4px 0; + text-align: left; + font-size: 11px; + color: var(--muted, var(--orca-muted, #6b7280)); +} +.dial-count[hidden] { display: none; } .dial-list { flex: 0 1 auto; min-height: 0;