Skip to content

feat(ambient): día/noche vivo desde Open-Meteo (sin chorradas) - #121

Open
Blackleets wants to merge 3 commits into
mainfrom
feat/ambient-day-night-weather
Open

Blackleets wants to merge 3 commits into
mainfrom
feat/ambient-day-night-weather

Conversation

@Blackleets

Copy link
Copy Markdown
Owner

Summary

  • AmbientSky: lavado sutil del viewport según fase real (dawn / day / golden / dusk / night) a partir de isDay + sunrise/sunset de Open-Meteo.
  • Cielo despejado = solo wash (sin inventar nubes). Lluvia/nubes/etc. siguen en WeatherAtmosphere.
  • En navegación se atenúa para no tapar el HUD.
  • WeatherCapsule pasa a tokens de diseño (--bg-panel, --text-*, --border-secondary).
  • Docs: docs/ambient-sky.md. Tests de fase en ambient-sky.test.ts.

Constraints

  • Sin métricas inventadas; fail-closed si no hay weather live.
  • Mobile: opacity más baja; prefers-reduced-motion sin transición animada del wash.

Test plan

  • Con GPS + weather live: al mediodía wash day; de noche night.
  • Cerca de amanecer/atardecer: dawn / golden / dusk.
  • Despejado: no aparecen nubes decorativas.
  • Con lluvia/tormenta: atmósfera + wash; en ruta ambos muy tenues.
  • PC y móvil: mapa legible, cápsula de clima usable.
  • vitest ambient-sky + weather-atmosphere verdes; lint OK.

Subtle AmbientSky phases (dawn/day/golden/dusk/night) over the map
without inventing weather. Clear sky stays wash-only; existing
WeatherAtmosphere still handles precip/clouds. Dims during navigation.
WeatherCapsule uses design tokens for theme-friendly chrome.
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

Deployment failed for project aegis with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/nfyns-projects-b0cc0f41?upgradeToPro=build-rate-limit

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd7f117f5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


function AmbientSky({ weather, navigationActive, visible }: AmbientSkyProps) {
const sky = useMemo(
() => (visible ? getAmbientSky(weather, navigationActive) : null),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Hide the wash when weather is no longer live

After any successful load, a refresh failure makes useLocalWeather set its status to unavailable without clearing the previous weather object, but this component receives no status and continues rendering that cached phase indefinitely; similarly, a new GPS grid can temporarily reuse weather from the previous location. Gate the wash on weather correlated to the current grid and a live status, or clear stale weather when loading fails.

AGENTS.md reference: AGENTS.md:L17-L18

Useful? React with 👍 / 👎.

Comment thread src/lib/ambient-sky.ts
Comment on lines +17 to +20
function parseTime(iso: string | null | undefined): number | null {
if (!iso) return null;
const ms = new Date(iso).getTime();
return Number.isFinite(ms) ? ms : null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Parse solar times in the reported timezone

When the browser timezone differs from the GPS location timezone, these offsetless Open-Meteo timestamps are interpreted in the browser's local timezone by new Date(iso). The API route requests timezone=auto and forwards daily.sunrise and daily.sunset unchanged, so the calculated dawn, golden, and dusk windows can be shifted by several hours; parse them using weather.timezone or return absolute timestamps from the server.

Useful? React with 👍 / 👎.

Night uses screen-blend so it reads on dark basemap (mobile).
Mood tint from live icon; soft horizon band; html data-ambient-* hooks.
No particles/stars; still dims hard during navigation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant