Skip to content

feat: use configurable fixed times for auto light/dark theme (#70)#74

Merged
klay2000 merged 1 commit into
mainfrom
issue-70
Jun 15, 2026
Merged

feat: use configurable fixed times for auto light/dark theme (#70)#74
klay2000 merged 1 commit into
mainfrom
issue-70

Conversation

@klay2000

Copy link
Copy Markdown
Owner

Summary

  • Replace geolocation + sunrise-sunset.org API with user-configurable fixed times for the "Auto" theme — no more location permission prompt or network call for theme switching
  • New Settings → Appearance fields "Dark from" / "Light from" (default 20:00 / 07:00), stored in localStorage, shown when "Auto" is selected
  • Renamed sunTimes.jsthemeSchedule.js with new pure isDarkAt/timeToMinutes helpers and tests covering wrap-around, same-day, and equal-times cases
  • Theme re-evaluates immediately when the configured times change, plus existing hourly re-check while the app is open

Closes #70

Test plan

  • npm run build passes
  • npm test passes (35/35)
  • Manually verified: Settings → Appearance → Auto shows time fields, theme flips immediately on time change, no geolocation/sunrise-sunset network calls

🤖 Generated with Claude Code

Replace the geolocation + sunrise-sunset.org lookup with user-set
"dark from"/"light from" times (Settings > Appearance), stored in
localStorage via the new themeTimes store. No network calls or
location permission are needed for auto mode anymore.

sunTimes.js/sunTimes.test.js are renamed to themeSchedule.js/
themeSchedule.test.js, repurposed with a pure isDarkAt(now, darkStart,
lightStart) helper that handles dark periods wrapping midnight.
@klay2000 klay2000 merged commit f6d0f06 into main Jun 15, 2026
1 check passed
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.

Use Set Times For Light/Dark

1 participant