From 97bd93ed5cd3ff6bd5c6f0eb60bcbc4086b8b0b3 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Mon, 30 Mar 2026 17:27:21 -0500 Subject: [PATCH] Make /map full-page Leaflet with band dropdown - Remove Layouts.app wrapper so map fills entire viewport - Replace band buttons with daisyUI dropdown selector - Overlay controls (home button, band picker, timestamp) on top-left - Keep Leaflet's standard zoom controls --- lib/microwaveprop_web/live/map_live.ex | 76 ++++++++++++------- test/microwaveprop_web/live/map_live_test.exs | 17 ++--- 2 files changed, 57 insertions(+), 36 deletions(-) diff --git a/lib/microwaveprop_web/live/map_live.ex b/lib/microwaveprop_web/live/map_live.ex index b637816f..6c5f7176 100644 --- a/lib/microwaveprop_web/live/map_live.ex +++ b/lib/microwaveprop_web/live/map_live.ex @@ -57,40 +57,62 @@ defmodule MicrowavepropWeb.MapLive do {:noreply, socket} end + defp selected_label(bands, selected_band) do + case Enum.find(bands, &(&1.freq_mhz == selected_band)) do + nil -> "Select Band" + band -> band.label + end + end + @impl true def render(assigns) do ~H""" - -
-
-

Propagation Map

-
- -
-
- Updated: {Calendar.strftime(@valid_time, "%Y-%m-%d %H:%M UTC")} +
+ <%!-- Full-page map --%> +
+
+ + <%!-- Top-left controls overlay --%> +
+ <.link navigate="/" class="btn btn-sm bg-base-100/90 shadow border-base-300"> + <.icon name="hero-home" class="size-4" /> + + + -
+ +
+ {Calendar.strftime(@valid_time, "%H:%M UTC")}
- +
+ + """ end end diff --git a/test/microwaveprop_web/live/map_live_test.exs b/test/microwaveprop_web/live/map_live_test.exs index b3678bd7..2e2b5316 100644 --- a/test/microwaveprop_web/live/map_live_test.exs +++ b/test/microwaveprop_web/live/map_live_test.exs @@ -4,30 +4,29 @@ defmodule MicrowavepropWeb.MapLiveTest do import Phoenix.LiveViewTest describe "mount" do - test "renders the propagation map page", %{conn: conn} do + test "renders full-page map", %{conn: conn} do {:ok, _lv, html} = live(conn, ~p"/map") - assert html =~ "Propagation Map" - assert html =~ "propagation-map" + assert html =~ ~s(id="propagation-map") + assert html =~ ~s(phx-hook="PropagationMap") end - test "renders all band selector buttons", %{conn: conn} do + test "renders band dropdown with all bands", %{conn: conn} do {:ok, _lv, html} = live(conn, ~p"/map") assert html =~ "10 GHz" assert html =~ "24 GHz" assert html =~ "47 GHz" assert html =~ "75 GHz" + assert html =~ "241 GHz" end - test "defaults to 10 GHz band selected", %{conn: conn} do + test "defaults to 10 GHz selected", %{conn: conn} do {:ok, _lv, html} = live(conn, ~p"/map") - assert html =~ "btn-primary" + assert html =~ ~s(class="active") end - test "includes map container with data-scores", %{conn: conn} do + test "includes data-scores attribute", %{conn: conn} do {:ok, _lv, html} = live(conn, ~p"/map") - assert html =~ ~s(id="propagation-map") assert html =~ "data-scores" - assert html =~ "phx-hook" end end