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)infrontend/src/lib/format.tsreturnsHH:MM:SSin a given timezone (parallel to the existingnowTimeInTzwhich stays onHH:MMfor 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/loadingRefpattern inPanchangPagelets the long-lived interval always call the latestrun()without tearing down and re-creating itself on every render.
Files touched
frontend/src/pages/PanchangPage.tsxfrontend/src/lib/format.tsfrontend/src/i18n/locales/{en,hi,ta,bn,ne,de,es,fr,pt,ru,zh,ja,ar,fa,he}.tsfrontend/package.json(version bump to 1.1.0)