mirror of
https://github.com/home-assistant/iOS.git
synced 2026-07-02 14:29:42 -05:00
## Summary Reopening kiosk mode PR (previously #4218) after addressing all review feedback from @bgoncal. Apologies for the delay — some family matters pulled me away, but I'm excited to get this implemented and am fully committed to seeing it through. This PR adds the foundational infrastructure for **kiosk mode** — a feature designed for wall-mounted iPad displays running Home Assistant dashboards. ### What's included: - **KioskModeManager** — Central coordinator singleton with KioskModeObserver protocol (no NotificationCenter) - **KioskSettings** — Comprehensive settings model with GRDB persistence (camelCase columns, Codable) - **Screensaver system** — Clock screensaver with 4 styles, pixel shift for OLED burn-in prevention - **Secret exit gesture** — Configurable corner tap to access settings when locked down - **Status bar hiding** — StatusBarForwardingNavigationController for proper UIKit integration - **Settings UI** — SwiftUI settings accessible via Settings menu and secret gesture - **28 unit tests** — Covering settings serialization, time logic, orientations, enums ### Changes since #4218 (all review feedback addressed): - ✅ Fixed settings modal dismissal on iOS 15 (UINavigationController + explicit onDismiss closure) - ✅ Fixed status bar hiding (StatusBarForwardingNavigationController + statusBarView integration) - ✅ Removed non-functional settings (navigationLockdown, TouchFeedbackManager, IconMapper) - ✅ Replaced `Date()` with `Current.date()` for testability - ✅ GRDB persistence follows CarPlayConfig/WatchConfig pattern with DatabaseTableProtocol - ✅ All strings localized via L10n (SwiftGen) - ✅ SFSafeSymbols used throughout (no string-based systemName) - ✅ KioskModeObserver protocol (no NotificationCenter) - ✅ Kiosk files prefixed with `Kiosk` - ✅ UIKit screensaver container (required for status bar/home indicator control) - ✅ macCatalyst filtered out - ✅ Merged with latest upstream/main (adapted to Frontend/ directory restructure) - ✅ Idle timer pauses when settings view is open - ✅ TODO comments (no PR-specific comments) ### Testing Instructions 1. **Settings → Companion App → Kiosk Mode** → Enable "Enable Kiosk Mode" 2. Set screensaver timeout to **30 seconds** for quick testing 3. Wait for screensaver → tap to wake 4. Use secret gesture (default: 3 taps in top-left corner) to access settings ### Previous review context All feedback from @bgoncal in #4218 has been addressed. See that PR for full discussion history. ## Test plan - [ ] Enable/disable kiosk mode from Settings - [ ] Screensaver activates after timeout - [ ] Tap to wake from screensaver - [ ] Secret gesture opens settings - [ ] Status bar hides when kiosk mode active (full-screen iPad only) - [ ] Device authentication toggle works - [ ] Settings persist across app restart - [ ] Clock screensaver styles (large, minimal, digital, analog) - [ ] Pixel shift moves clock position periodically - [ ] Kiosk entry hidden on macCatalyst 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Nick Stefanelli <nstefanelli@users.noreply.github.com>