From ffec2710f8140805b4779dadd23803c907ac1f58 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 18 Nov 2026 22:37:12 -0500 Subject: [PATCH] Quick search across the library (Ctrl+K) with link and online search shortcuts --- README.md | 4 +- ui/app.js | 6 ++- ui/index.html | 4 +- ui/search.js | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++ ui/styles.css | 24 +++++++++ 5 files changed, 179 insertions(+), 3 deletions(-) create mode 100644 ui/search.js diff --git a/README.md b/README.md index 78cf448..fd094e2 100644 --- a/README.md +++ b/README.md @@ -173,8 +173,10 @@ cargo tauri build | `L` | Lyrics | | `Q` | Queue | | `F` | TV mode | +| `Ctrl K` | Search your library, or paste a link | +| `Ctrl L` | Get: the link and online search bar | +| `Ctrl B` | Collapse or expand the sidebar | | `P` | Mini player | -| `Ctrl K` | Link or search bar | | `Ctrl F` | Search the current view | | `Delete` | Delete the selected songs (with confirmation) | | `Ctrl A` | Select all in the current list | diff --git a/ui/app.js b/ui/app.js index 33dbda2..687d28c 100644 --- a/ui/app.js +++ b/ui/app.js @@ -239,6 +239,7 @@ async function init() { bindConnect(); bindUpdates(); bindPlaybackSettings(); + bindSearch(); bindStats(); await listen("atmosphere://job", (e) => onJob(e.payload)); await listen("atmosphere://probe", (e) => onProbe(e.payload)); @@ -435,7 +436,10 @@ function go(view) { function onKey(e) { const mod = e.ctrlKey || e.metaKey; - if (mod && (e.key === "k" || e.key === "l")) { + if (mod && e.key.toLowerCase() === "k") { + e.preventDefault(); + openSearch(); + } else if (mod && e.key.toLowerCase() === "l") { e.preventDefault(); go("get"); $("#commandInput").focus(); diff --git a/ui/index.html b/ui/index.html index cb8f230..f9be39d 100644 --- a/ui/index.html +++ b/ui/index.html @@ -28,7 +28,8 @@