Skip to content

Releases: bidyashish/vedicpanchanga.com

v1.1.0 - Live Mode on Panchang

Choose a tag to compare

@bidyashish bidyashish released this 17 May 06:05

New: Live Mode on the Panchang page

Toggle Live mode on the Panchang page to auto-refresh the panchang data and the lagna kundali every minute, with a wall-clock time displayed inline next to the date that ticks every second.

What's new

  • Auto-refresh every 60s. Panchang data and the lagna kundali re-fetch in the background. The chart re-anchors to the current time on every tick, so it actually progresses through the houses while the page is open.
  • Inline live clock (HH:MM:SS). Wall-clock time in the panchang's location timezone, updated every second, rendered with the exact typography of the date heading (same font, weight, size, color).
  • Green pulsing "Live" indicator. Uses the project's existing --success (leaf) token so it tracks the auspicious-window palette and flips correctly in dark mode.
  • localStorage persistence (jk_panchang_live). Toggle state survives reloads.
  • Concurrent-fetch guard. A slow network can't stack overlapping refresh requests; if a tick fires while the previous fetch is still in flight, it's skipped.

Internationalization

live_mode, live_mode_hint, and live_badge keys added across all 15 supported locales:

  • English, Hindi (Devanagari), Tamil, Bengali, Nepali (Devanagari)
  • Chinese (Simplified), Japanese
  • Spanish, German, Portuguese, French, Russian (Cyrillic)
  • Arabic, Persian (Perso-Arabic), Hebrew

Native scripts only, no transliteration.

Under the hood

  • New helper nowTimeWithSecondsInTz(tz) in frontend/src/lib/format.ts returns HH:MM:SS in a given timezone (parallel to the existing nowTimeInTz which stays on HH:MM for chart API calls).
  • The two clocks (60s data poll, 1s wall-clock tick) are decoupled. React's primitive-equality skip keeps the 1s ticker effectively free between minute boundaries.
  • runRef / loadingRef pattern in PanchangPage lets the long-lived interval always call the latest run() without tearing down and re-creating itself on every render.

Files touched

  • frontend/src/pages/PanchangPage.tsx
  • frontend/src/lib/format.ts
  • frontend/src/i18n/locales/{en,hi,ta,bn,ne,de,es,fr,pt,ru,zh,ja,ar,fa,he}.ts
  • frontend/package.json (version bump to 1.1.0)