Skip to content

Keep stay-awake dim on transient .inactive scene phase - #27

Merged
adborbas merged 2 commits into
mainfrom
fix/screen-dim-inactive
Jul 16, 2026
Merged

Keep stay-awake dim on transient .inactive scene phase#27
adborbas merged 2 commits into
mainfrom
fix/screen-dim-inactive

Conversation

@adborbas

Copy link
Copy Markdown
Owner

Changes

Split the combined .background, .inactive case in ScreenManager.handleScenePhase(_:). A true .background trip still cancels the inactivity timer and clears isDimmed; .inactive now does nothing.

Why

.inactive is emitted for transient interruptions that don't background the app — pulling down Control Center or Notification Center, incoming-call banners, the app-switcher preview. Lumping it with .background cleared the stay-awake dim overlay while the app was still foreground, defeating kiosk/stay-awake mode. This mirrors the sibling SessionManager.handleScenePhase, which already distinguishes the two (case .inactive: break).

Notes

  • Added two ScreenManagerTests cases: .inactive while dimmed keeps the dim; .background while dimmed clears it.
  • Full HemeraTests suite green (369 tests).
  • Leaving the inactivity timer running during .inactive is intentional — a dim firing behind Control Center is harmless (and arguably desired in kiosk mode); on return, .active re-arms only when not already dimmed.

adborbas and others added 2 commits July 16, 2026 18:32
ScreenManager.handleScenePhase lumped .inactive with .background and
cleared isDimmed for both, so pulling down Control/Notification Center
(which yields .inactive without backgrounding) defeated the stay-awake
dim while the app was still foreground.

Only clear the dim on a true .background trip; .inactive now does
nothing, mirroring SessionManager.handleScenePhase's treatment.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@adborbas
adborbas merged commit 0e1f2b8 into main Jul 16, 2026
1 check passed
@adborbas
adborbas deleted the fix/screen-dim-inactive branch July 16, 2026 20:35
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