prop/lib/microwaveprop_web/live/algo_live.ex
Graham McIntire ff950f9e40
docs/tests: moduledocs on 18 LiveViews, MapLive event coverage, Rust pipeline roundtrip
- Add one-line moduledocs to 18 LiveViews that were carrying
  @moduledoc false. Each line names the route and summarizes what
  the page does so a future reader knows where to look before
  opening the file.
- Add MapLive handle_event tests for toggle_radar, select_time /
  set_selected_time, point_detail, map_bounds, retry_initial_scores.
  Assertions focus on socket-state transitions and "didn't crash"
  rather than raw HTML — map_bounds in particular has no visible
  render-side effect (it push_events the new scores to the JS hook).
- Rust pipeline: integration-shaped test that hand-builds a 2-cell
  surface + pressure grid, runs merge → cell_to_conditions →
  precompute_band_invariants → composite_score_with → write_atomic
  → decode, asserting header + body length round-trip. Closes the
  'pipeline's happy path is only covered by unit tests' gap.
2026-04-21 17:16:12 -05:00

23 lines
629 B
Elixir

defmodule MicrowavepropWeb.AlgoLive do
@moduledoc "Renders `algo.md` as HTML at `/algo` — documents the scoring algorithm."
use MicrowavepropWeb, :live_view
@external_resource "algo.md"
@algo_html "algo.md" |> File.read!() |> Microwaveprop.Markdown.to_html!()
@impl true
def mount(_params, _session, socket) do
{:ok, assign(socket, page_title: "Algorithm", content: @algo_html)}
end
@impl true
def render(assigns) do
~H"""
<Layouts.app flash={@flash} current_scope={@current_scope}>
<div class="markdown-content">
{raw(@content)}
</div>
</Layouts.app>
"""
end
end