Open universal search modal instantly via client-side JS

Replace phx-click server event with Fluxon.open_dialog for zero-latency
modal opening. The modal DOM is now always present (no :if conditional) so
it can be shown instantly; the server syncs state in the background.

Fix test selectors that now match the always-present modal form by scoping
to forms without phx-target (which the modal form always has).
This commit is contained in:
Claudio Ortolina
2026-05-07 20:43:15 +01:00
parent fa7a01b489
commit 621b35d824
6 changed files with 12 additions and 11 deletions
@@ -23,7 +23,7 @@ defmodule MusicLibraryWeb.UniversalSearchLive.IndexTest do
test "modal is hidden by default", %{conn: conn} do
conn
|> visit(~p"/collection")
|> refute_has("#universal-search-root")
|> assert_has("#universal-search-root[hidden]")
end
test "modal opens when search button is clicked", %{conn: conn} do