Skip to content

Claude/night shift app toggle 6cm vk#9

Merged
adamdexter merged 5 commits into
mainfrom
claude/night-shift-app-toggle-6cmVK
Mar 25, 2026
Merged

Claude/night shift app toggle 6cm vk#9
adamdexter merged 5 commits into
mainfrom
claude/night-shift-app-toggle-6cmVK

Conversation

@adamdexter
Copy link
Copy Markdown
Owner

No description provided.

claude added 5 commits March 25, 2026 01:31
…e schedule

The restore logic used `wasEnabled || hasSchedule` to decide whether to
re-enable Night Shift after leaving an excluded app. This meant that if a
schedule existed (e.g. Sunset to Sunrise) but wasn't currently active
(e.g. 6pm before a 7:25pm sunset), ShiftChange would still call
setNightShiftEnabled(true) on restore — force-toggling "Turn On Until
Sunrise" and warming the display unexpectedly.

Fix: use the `active` field from BlueLightStatus (whether the display is
actually being warmed right now) instead of checking whether a schedule
merely exists. Night Shift is only restored if it was actively warming
the display when the excluded app gained focus.

https://claude.ai/code/session_014Sj5CVs9WfTHtp5NhaK8sw
…o About

The previous fix used `status.active` from CoreBrightness, but `active`
likely means "the Night Shift feature is running" (schedule is configured
and monitoring) rather than "the display is currently being warmed." This
meant `active` was true at 6pm with a sunset schedule, causing the same
false-restore bug.

Now uses `isEnabled` only — the manual/schedule-triggered enabled state.
If Night Shift wasn't enabled when entering an excluded app, we don't
touch it on restore. The `|| hasSchedule` from the original code was the
sole cause of the bug.

Also adds version string to the About window (reads CFBundleShortVersionString
from Info.plist, falls back to "dev" for debug builds) so it's easy to
confirm which build is running.

https://claude.ai/code/session_014Sj5CVs9WfTHtp5NhaK8sw
Adds Resources/VERSION read by both the Swift About screen (via
Bundle.module) and create-dmg.sh. Eliminates the need to pass a
version argument to create-dmg.sh or hardcode it in Swift — just
update the one file for each release.

https://claude.ai/code/session_014Sj5CVs9WfTHtp5NhaK8sw
Includes key technical details about the CoreBrightness bridge struct
fields, the Night Shift restore logic (and past bug), build instructions,
and a release checklist covering version bumps and regression tests.

https://claude.ai/code/session_014Sj5CVs9WfTHtp5NhaK8sw
@adamdexter adamdexter merged commit 3b1bce5 into main Mar 25, 2026
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.

2 participants