Two fixes cover the blank "analysis breakdown" panel the user reported:
1. Bound the point_detail fallback lookback to 24h. Previously
factors_from_fallback_profile would happily use a week-old analysis
profile when no current one existed — now anything older than 24h
returns an empty factor map so the UI can surface "breakdown
unavailable" instead of silently misattributing.
2. Move the Plausible analytics snippet from Layouts.app into
root.html.heex. Full-bleed LiveViews (/map, /contacts/map,
/weather, home) bypass Layouts.app, so the snippet only loaded on
the navbar-wrapped pages. root.html.heex is loaded once per HTTP
document so coverage is now universal.
Added ~30 tests locking both down:
• point_detail fallback: exact-time wins, 24h boundary accepted,
30h-stale rejected, multi-band coverage, missing-cell degrades to
empty factors, default-valid_time path
• analytics_test.exs: Plausible script present on 12 representative
pages, exactly once, loaded async, surviving a login round-trip
Also fixed pre-existing credo issues per standing rule: shortened the
map_live_test ETS match_delete call, extracted a function from the
deeply-nested hrrr_point_enqueuer.enqueue_for_contacts/1 cond, and
swapped Mix.Tasks.Rust.Golden's IO.inspect for Mix.shell().info.
57 lines
2.5 KiB
Text
57 lines
2.5 KiB
Text
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<meta name="csrf-token" content={get_csrf_token()} />
|
|
<%!--
|
|
OpenStreetMap's tile usage policy requires a Referer header identifying
|
|
the site using their tiles. strict-origin-when-cross-origin sends just
|
|
the origin (e.g. https://prop.w5isp.com) on cross-origin HTTPS requests,
|
|
which is the minimum OSM asks for. Explicit so we don't silently lose
|
|
the Referer if a future browser default changes.
|
|
--%>
|
|
<meta name="referrer" content="strict-origin-when-cross-origin" />
|
|
<.live_title default="Microwave Propagation" suffix=" · Microwave Propagation">
|
|
{assigns[:page_title]}
|
|
</.live_title>
|
|
<link rel="preconnect" href="https://a.tile.openstreetmap.org" crossorigin />
|
|
<link rel="preconnect" href="https://b.tile.openstreetmap.org" crossorigin />
|
|
<link rel="preconnect" href="https://c.tile.openstreetmap.org" crossorigin />
|
|
<link rel="dns-prefetch" href="https://a.tile.openstreetmap.org" />
|
|
<link rel="dns-prefetch" href="https://b.tile.openstreetmap.org" />
|
|
<link rel="dns-prefetch" href="https://c.tile.openstreetmap.org" />
|
|
<link phx-track-static rel="stylesheet" href={~p"/assets/css/app.css"} />
|
|
<script defer phx-track-static type="text/javascript" src={~p"/assets/js/app.js"}>
|
|
</script>
|
|
<script>
|
|
(() => {
|
|
const setTheme = (theme) => {
|
|
if (theme === "system") {
|
|
localStorage.removeItem("phx:theme");
|
|
document.documentElement.removeAttribute("data-theme");
|
|
} else {
|
|
localStorage.setItem("phx:theme", theme);
|
|
document.documentElement.setAttribute("data-theme", theme);
|
|
}
|
|
};
|
|
if (!document.documentElement.hasAttribute("data-theme")) {
|
|
setTheme(localStorage.getItem("phx:theme") || "system");
|
|
}
|
|
window.addEventListener("storage", (e) => e.key === "phx:theme" && setTheme(e.newValue || "system"));
|
|
|
|
window.addEventListener("phx:set-theme", (e) => setTheme(e.target.dataset.phxTheme));
|
|
})();
|
|
</script>
|
|
</head>
|
|
<body>
|
|
{@inner_content}
|
|
<script async src="https://a.w5isp.com/js/pa-3eKACFxtbw6MHrTDA28wG.js">
|
|
</script>
|
|
<script>
|
|
window.plausible = window.plausible || function () { (plausible.q = plausible.q || []).push(arguments) };
|
|
plausible.init = plausible.init || function (i) { plausible.o = i || {} };
|
|
plausible.init();
|
|
</script>
|
|
</body>
|
|
</html>
|