prop/lib/microwaveprop_web/live
Graham McIntire aa8b789d2e
feat(weather/map): persist viewport to URL for reload-stable view
Adds lat/lon/zoom URL params to /weather so reload / share-link
restores the exact map state. The existing ?layer= param keeps
working alongside.

LiveView side:

- mount() reads lat/lon/zoom from query params, clamps to valid
  ranges (lat -90..90, lon -180..180, zoom 4..10), and falls back
  to DFW@z7 when missing or invalid. Initial values flow to the
  hook via three new data attributes.
- handle_event("viewport_changed", ...) accepts {lat, lon, zoom}
  pushed by the hook on debounced moveend, clamps + rounds, and
  push_patches the URL with replace: true so browser history
  doesn't grow an entry per pan tick.
- build_path/2 helper centralises URL construction so select_layer
  and viewport_changed both produce a deterministic param order
  (layer, lat, lon, zoom). Tests assert exact URLs.

JS hook side:

- mounted() reads data-initial-lat/lon/zoom from the el dataset
  with parseFloat/parseInt + Number.isFinite gates, then seeds
  Leaflet's center/zoom from those instead of the previous
  hardcoded (32.897, -97.038, 7).
- moveend handler now also schedules a 400 ms-debounced
  pushEvent("viewport_changed", {lat, lon, zoom}) so the URL
  catches up with whatever the user panned/zoomed to. Separate
  debounce timer from the cells fetch since the URL push and the
  network fetch have different cadence sweet spots.

Tests cover: initial seeding from URL params, clamping of bad
values, viewport_changed event producing the right patched URL,
and the original layer-shareability test (now expecting the full
viewport in the URL).
2026-04-30 09:10:36 -05:00
..
admin docs/tests: moduledocs on 18 LiveViews, MapLive event coverage, Rust pipeline roundtrip 2026-04-21 17:16:12 -05:00
beacon_live docs/tests: moduledocs on 18 LiveViews, MapLive event coverage, Rust pipeline roundtrip 2026-04-21 17:16:12 -05:00
contact_live feat(contact): link grid squares to gridmap.org 2026-04-27 09:32:01 -05:00
user_management_live docs/tests: moduledocs on 18 LiveViews, MapLive event coverage, Rust pipeline roundtrip 2026-04-21 17:16:12 -05:00
about_live.ex docs/tests: moduledocs on 18 LiveViews, MapLive event coverage, Rust pipeline roundtrip 2026-04-21 17:16:12 -05:00
algo_live.ex docs/tests: moduledocs on 18 LiveViews, MapLive event coverage, Rust pipeline roundtrip 2026-04-21 17:16:12 -05:00
contact_map_live.ex docs/tests: moduledocs on 18 LiveViews, MapLive event coverage, Rust pipeline roundtrip 2026-04-21 17:16:12 -05:00
eme_live.ex refactor: deduplicate helpers and simplify Scorer 2026-04-28 14:14:34 -05:00
import_live.ex fix(dialyzer): clear 125+ warnings under strict flags 2026-04-21 10:30:06 -05:00
live_stash_guard.ex feat(nav): add EME menu item to map + weather sidebars 2026-04-25 09:49:06 -05:00
map_live.ex feat(hrdps): activate Canadian propagation chain end-to-end 2026-04-29 17:29:37 -05:00
path_live.ex refactor: deduplicate helpers and simplify Scorer 2026-04-28 14:14:34 -05:00
privacy_live.ex docs/tests: moduledocs on 18 LiveViews, MapLive event coverage, Rust pipeline roundtrip 2026-04-21 17:16:12 -05:00
rover_live.ex refactor: deduplicate helpers and simplify Scorer 2026-04-28 14:14:34 -05:00
rover_locations_live.ex feat(rover-locations): inline satellite map per location 2026-04-26 13:55:08 -05:00
skewt_live.ex feat(skewt): fetch full 25-level profile and drop valid_time URL param 2026-04-25 15:19:34 -05:00
skewt_location_resolver.ex feat(skewt): add /skewt LiveView with HRRR-backed Skew-T-Log-P plot 2026-04-25 12:13:46 -05:00
skewt_svg.ex fix(path): handle ProfilesFile cell shape correctly + log async exits 2026-04-25 15:57:20 -05:00
status_live.ex fix(status): mobile layout — tables no longer truncate column headers 2026-04-24 15:45:01 -05:00
submit_live.ex fix(submit): allowlist switch_tab values instead of trusting client input 2026-04-25 10:10:42 -05:00
user_profile_live.ex docs/tests: moduledocs on 18 LiveViews, MapLive event coverage, Rust pipeline roundtrip 2026-04-21 17:16:12 -05:00
weather_map_live.ex feat(weather/map): persist viewport to URL for reload-stable view 2026-04-30 09:10:36 -05:00