Enable Ctrl/Meta+K to trigger universal search

This commit is contained in:
Claudio Ortolina
2025-07-07 11:36:41 +01:00
parent 1492b197ce
commit ad74560cf9
6 changed files with 34 additions and 11 deletions
@@ -39,10 +39,12 @@
</div>
<div class="flex space-x-2 md:space-x-4 items-center">
<.button
id="universal-search-button"
variant="ghost"
title={gettext("Search (Ctrl+K)")}
phx-click="open_modal"
phx-target="#universal-search"
phx-hook="SearchGlobalShortcut"
>
<span class="sr-only">{gettext("Search (Ctrl+K)")}</span>
<.icon name="hero-magnifying-glass" class="h-5 w-5" />
@@ -201,7 +201,8 @@ defmodule MusicLibraryWeb.SearchComponents do
<div class="p-8 text-center">
<.icon name="hero-magnifying-glass" class="h-12 w-12 text-zinc-400 mx-auto mb-4" />
<p class="text-sm text-zinc-500 dark:text-zinc-500 mt-2">
{gettext("Search records and artists...")}
<kbd class="px-2 py-1 bg-zinc-100 dark:bg-zinc-700 rounded text-xs">Ctrl+K</kbd>
{gettext("to open this search")}
</p>
</div>
"""