From 8fb12d03e02838190060b816c585b7e0a09c5d93 Mon Sep 17 00:00:00 2001 From: Vincent van der Wal Date: Sat, 25 Jul 2026 10:31:11 +0200 Subject: [PATCH] past weather --- src/lib/components/navigation/header.svelte | 2 +- .../weather/14-day/[location]/+page.svelte | 29 +++++++++++++++++++ .../weather/week/[location]/DailyCards.svelte | 17 +++++++---- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/src/lib/components/navigation/header.svelte b/src/lib/components/navigation/header.svelte index fb33194..265301b 100644 --- a/src/lib/components/navigation/header.svelte +++ b/src/lib/components/navigation/header.svelte @@ -81,7 +81,7 @@ {location.name} {#if location.admin1 || location.country} - · {#if location.admin1}{location.admin1}, + · {#if location.admin1}{location.admin1},  {/if}{location.country ?? ''} {/if} diff --git a/src/routes/weather/14-day/[location]/+page.svelte b/src/routes/weather/14-day/[location]/+page.svelte index 873b0c4..3af2a0f 100644 --- a/src/routes/weather/14-day/[location]/+page.svelte +++ b/src/routes/weather/14-day/[location]/+page.svelte @@ -154,6 +154,11 @@ fetchedData ? fetchedData.timestamps.slice(0, validLength).map((t) => t / 1000) : [] ); + // Surface a note when the chosen model's ensemble stops short of the request. + let fullHours = $derived(fetchedData?.timestamps.length ?? 0); + let validDays = $derived(Math.max(0, Math.round(validLength / 24))); + let isTrimmed = $derived(!!fetchedData && validLength > 0 && validLength < fullHours - 1); + interface ChartDef { title?: string; subtitle?: string; @@ -285,6 +290,30 @@ +{#if isTrimmed} +
+ + + + + This model's ensemble only reaches about {validDays} days ahead — the spread + is trimmed to its available range. + +
+{/if} + {#if loadError}
{ + const b = btn.getBoundingClientRect(); + const c = el.getBoundingClientRect(); + // scroll so the button's right edge sits just past the left edge (a small + // gap of extra margin keeps the first day card from hugging the edge) + el.scrollLeft += b.right - c.left + 6; + }); }); function getDaylightSeconds(index: number): number { @@ -112,7 +117,7 @@ lines up with the page content edge -->
{#if daily}