prop/test/microwaveprop_web
Graham McIntire 6a90d153ca
perf(map): /scores/cells binary endpoint, client-side fetch + band/time prefetch
Apply the same overlay refactor we did for /weather to the propagation
map. Score data used to flow as JSON via LiveView push_event
(update_scores + the 18-hour preload_forecast batch); switching bands
or scrubbing time meant a synchronous server roundtrip + ~MB JSON push
per change.

Now:

1. New /scores/cells endpoint returns a "PSCR" binary cell-pack —
   columnar f32 lats/lons + u8 scores, ~3-4× smaller than JSON and
   parsed via DataView + typed-array views with no JSON.parse.

2. JS hook owns score fetching. mount/moveend/band/time changes
   trigger HTTP fetches against /scores/cells. After the initial
   paint, every other forecast hour for the current band is fetched
   in parallel in the background — timeline scrubs after the prefetch
   finishes are pure cache hits with no network at all.

3. LiveView no longer pushes scores. select_band emits update_band_info
   with band_mhz so the client knows what to refetch; select_time and
   set_selected_time only update server-side state (URL, point detail
   bbox). map_bounds, propagation_updated, and advance_now_cursor all
   skip the score push — pack_scores, schedule_bounds_update,
   schedule_preload_forecast, the :flush_bounds and :preload_forecast
   handle_info clauses, and the start_async :initial_scores lifecycle
   (incl. retry_initial_scores event) are all deleted.

Net result: instant band toggles after the first paint, no LiveView
WebSocket payloads larger than the timeline metadata, and ~370 fewer
lines in MapLive.
2026-04-29 14:27:20 -05:00
..
controllers perf(map): /scores/cells binary endpoint, client-side fetch + band/time prefetch 2026-04-29 14:27:20 -05:00
live perf(map): /scores/cells binary endpoint, client-side fetch + band/time prefetch 2026-04-29 14:27:20 -05:00
plugs fix(remote_ip): log IPv6 in canonical hex via :inet.ntoa 2026-04-25 18:05:46 -05:00
analytics_test.exs feat: harden /map analysis breakdown + move Plausible to root layout 2026-04-21 15:56:30 -05:00
live_helpers_test.exs refactor: deduplicate helpers and simplify Scorer 2026-04-28 14:14:34 -05:00
live_table_footer_test.exs Show windowed page list in live_table footer 2026-04-13 10:02:19 -05:00
location_resolver_test.exs refactor: deduplicate helpers and simplify Scorer 2026-04-28 14:14:34 -05:00
metrics_log_suppression_test.exs fix(web): suppress HEAD request logs 2026-04-22 16:50:58 -05:00
metrics_plug_test.exs test: push line coverage from 71.7% → 78.67% 2026-04-23 18:43:18 -05:00
skew_t_property_test.exs test(property): add property tests for terrain + atmospheric math 2026-04-21 13:56:39 -05:00
skew_t_test.exs Fix credo warnings: length/1 on list and nested module aliases 2026-04-16 08:49:25 -05:00
telemetry_test.exs test: fix async-hydration timeout flake + type warning 2026-04-24 09:28:52 -05:00
user_auth_test.exs Beacon power in mW, settings tweaks 2026-04-08 12:45:35 -05:00