prop/test/microwaveprop_web/live
Graham McIntire 3a81d05b4e
perf(skewt): load profile + sounding asynchronously via start_async
URL-parameter loads (`/skewt?q=…`) were blocking the initial mount
on three serial steps: geocoder/grid resolve, ProfilesFile or
HrrrProfileLookup read, and the SkewtParams/SoundingParams/SkewtSvg
derivation. The address path in particular hits an external API,
which made the page take "forever" to load on first paint.

Restructure SkewtLive so the page chrome (header, search bar) renders
synchronously on mount, and the heavy work runs in a single
`start_async(:load_skewt, …)` task that calls SkewtLocationResolver,
walks the on-disk profile store with a DB fallback, and produces the
SVG. A new `loading?` assign drives a small spinner + "Resolving
location and loading HRRR profile…" message that shows while the task
is in flight; previous data stays on screen so navigation between
forecast hours doesn't blank out the diagram.

handle_async/3 covers three landings:

  * `{:ok, {:ok, result}}` — apply assigns from the resolver
  * `{:ok, {:error, reason}}` — surface as the existing error alert
    (geocoder failure, unknown callsign, etc.)
  * `{:exit, reason}` — log a warning and show a generic retry message

start_async/3 cancels any prior task with the same name on each call,
so a rapid-fire URL patch (e.g. clicking through forecast-hour
buttons before the first response returns) never lands stale data.

Tests: extended SkewtLiveTest from 3 to 4 cases — the URL-param
initial render now asserts the chrome + spinner appear pre-async,
and a separate case `render_async/2`s the view to confirm the
location label arrives once the task completes. 4/4 green.
2026-04-25 14:36:30 -05:00
..
admin test: push line coverage from 71.7% → 78.67% 2026-04-23 18:43:18 -05:00
contact_live test: push line coverage from 71.7% → 78.67% 2026-04-23 18:43:18 -05:00
algo_live_test.exs Show topbar loading indicator while scores are loading 2026-03-31 09:30:20 -05:00
beacon_live_test.exs test: coverage round 3 (83.96% → 84.39%) + 10 new property tests 2026-04-24 10:15:37 -05:00
contact_live_test.exs test: coverage round 4 (84.39% → 84.44%) + 6 new property tests 2026-04-24 10:32:05 -05:00
contact_map_live_test.exs test: silence expected warnings/errors during test runs 2026-04-24 09:27:17 -05:00
eme_live_test.exs test: coverage round 3 (83.96% → 84.39%) + 10 new property tests 2026-04-24 10:15:37 -05:00
import_live_test.exs feat(import): live /imports/:id progress page + gate upload bars on submit 2026-04-17 09:31:22 -05:00
map_live_test.exs test: coverage round 3 (83.96% → 84.39%) + 10 new property tests 2026-04-24 10:15:37 -05:00
path_live_test.exs test: coverage round 4 (84.39% → 84.44%) + 6 new property tests 2026-04-24 10:32:05 -05:00
rover_live_test.exs test: push line coverage from 71.7% → 78.67% 2026-04-23 18:43:18 -05:00
skewt_live_test.exs perf(skewt): load profile + sounding asynchronously via start_async 2026-04-25 14:36:30 -05:00
skewt_location_resolver_test.exs feat(skewt): add /skewt LiveView with HRRR-backed Skew-T-Log-P plot 2026-04-25 12:13:46 -05:00
skewt_svg_test.exs feat(skewt): add /skewt LiveView with HRRR-backed Skew-T-Log-P plot 2026-04-25 12:13:46 -05:00
status_live_test.exs feat(status): show Rust prop-grid-rs work queue alongside Oban panel 2026-04-19 17:07:38 -05:00
submit_live_test.exs fix(submit): allowlist switch_tab values instead of trusting client input 2026-04-25 10:10:42 -05:00
user_management_live_test.exs Drop gridmap.org dependency, resolve callsigns locally 2026-04-12 17:43:29 -05:00
user_profile_live_test.exs test: coverage round 3 (83.96% → 84.39%) + 10 new property tests 2026-04-24 10:15:37 -05:00
weather_map_live_test.exs feat(weather): ?layer= URL param to deep-link a specific overlay 2026-04-25 08:57:59 -05:00