5 Commits

Author SHA1 Message Date
97b676093a Add moon phase card to Weather Details
All checks were successful
Test, Build & Deploy / test-and-build (push) Successful in 23s
Test, Build & Deploy / deploy (push) Successful in 21s
- New src/lib/api/moon.js: fetches daily moon_phase from Open-Meteo
  (independent of the NWS/Open-Meteo weather source, since NWS has no moon
  data), plus pure helpers: moonName (8 phases), illumination fraction, and
  nextMoonPhase, which unwraps the ~29.5-day cycle and interpolates the next
  quarter boundary (new/first quarter/full/last quarter), returning its name,
  date, and days until it.
- New MoonPhaseCard.svelte: renders an SVG moon (two-circle terminator that
  correctly shows crescent/quarter/gibbous shapes), the current phase name,
  percent illuminated, and the next phase with date. Caches per-location via
  an effect; degrades gracefully when unavailable.
- Wired into WeatherDetail between Sun and UV and Temperature Range.
- 11 unit tests for moonName/illumination/interpolation/nextMoonPhase.
- Verified in headless Chromium: card renders, moon shape correct, no errors.
2026-09-08 02:25:01 +00:00
6c7fbf68eb Show a visible source icon for Open-Meteo fallback values on NWS
Replace the hidden hover-only native title with a dedicated SourceTooltip
component: a small ⓘ badge rendered inline next to Pressure and UV values
(Current + Details views) that reveals a styled tooltip on hover/focus,
so it is obvious the value came from the non-selected source (Open-Meteo)
instead of requiring discovery by hovering the data.
2026-08-16 21:15:10 +00:00
c0ec45f170 Backfill NWS's missing pressure & UV from Open-Meteo (with source tooltip)
NWS doesn't publish pressure (its pressure series is empty) or a UV index.
When the selected source is NWS, merge current.pressure_msl, current.uv_index
and daily.uv_index_max from Open-Meteo and tag them via data._fallback so the
Current + Details views show a tooltip noting the value came from the
non-selected source (Open-Meteo) instead of showing 0 hPa / --.
2026-08-16 21:05:07 +00:00
32f749444e Add NWS (National Weather Service) as a selectable data source preference
- New Settings > Data source toggle (Open-Meteo global / NWS US); NWS
  falls back to Open-Meteo when unavailable or outside its coverage.
- src/lib/api/nws.js: /points -> forecast/hourly/grid normalizer producing
  the app's shared shape, with realistic air highs (NWS reports 104 for the
  day Open-Meteo over-forecasts at 116); heat-index/feels-like falls back to
  air temp since NWS returns apparentTemperature as null here.
- NWS requires a User-Agent contact; email is a build-time Vite env
  (VITE_NWS_EMAIL), read from gitignored .env.local, never committed.
- Details view now shows which provider served the data.
- Fixes the identical UTC date-parse shift for NWS naive local times.
- Tests (8) + recorded live fixtures for Rogers County, OK.
2026-08-16 20:14:07 +00:00
4ffb44e107 First pass 2026-07-24 01:53:36 +00:00