From c775eb2611c34d0b799f57b4071ddf16e5c52d11 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Tue, 31 Mar 2026 16:28:38 -0500 Subject: [PATCH] Preserve detail panel and range circle across score updates - Add phx-update="ignore" to detail-panel so LiveView patches don't wipe it - Re-request point_detail after scores update to refresh with new data - Range circles persist across updates since they're on a separate layer --- assets/js/propagation_map_hook.js | 5 +++++ lib/microwaveprop_web/live/map_live.ex | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/js/propagation_map_hook.js b/assets/js/propagation_map_hook.js index 9442b405..20c5ecc7 100644 --- a/assets/js/propagation_map_hook.js +++ b/assets/js/propagation_map_hook.js @@ -329,6 +329,11 @@ export const PropagationMap = { this.handleEvent("update_scores", ({ scores }) => { topbar.hide() this.renderScores(scores) + + // If a point was selected, refresh its detail with the new data + if (this.clickedLatLng && this.detailPanel && this.detailPanel.style.display !== "none") { + this.pushEvent("point_detail", { lat: this.clickedLatLng[0], lon: this.clickedLatLng[1] }) + } }) this.bandInfo = JSON.parse(this.el.dataset.bandInfo || "{}") diff --git a/lib/microwaveprop_web/live/map_live.ex b/lib/microwaveprop_web/live/map_live.ex index e2ace4fa..93d319c9 100644 --- a/lib/microwaveprop_web/live/map_live.ex +++ b/lib/microwaveprop_web/live/map_live.ex @@ -280,9 +280,10 @@ defmodule MicrowavepropWeb.MapLive do - <%!-- Point detail panel (populated by JS on click) --%> + <%!-- Point detail panel (populated by JS on click, ignored by LiveView patches) --%>