-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Replace "Force Dark Mode" with dynamic Appearance setting (System/Light/Dark) #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Change to follow system settings and switch without restart
Fix dataString unreliability issue
Update BGData.swift
|
Thank you for your contribution.
Please read the README file: https://github.com/loopandlearn/LoopFollow?tab=readme-ov-file#for-developers |
marionbarker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this and it works as expected. The selection of system, light and dark is immediately updated.
I am assuming it was a design choice that the Snooze screen should always be dark.
Remove mixed pull request
remove incorrect edits to DEVELOPMENT_TEAM variables
marionbarker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes. I approve this based on test and review.
One small nit for LoopFollow.xcodeproj/project.pbxproj
- You added white space at the end of "$(LF_DEVELOPMENT_TEAM)";.
- If you want to fix that, it will be a touch cleaner but I won't hold the merge
- Thanks for finding and fixing the duplicate lines for URLTokenValidationView.swift
Summary
This PR replaces the legacy "Force Dark Mode (restart app)" toggle with a proper Appearance picker offering three options: System, Light, and Dark. Changes now apply immediately without requiring an app restart, and the app properly responds to iOS/MacOS system appearance changes when in "System" mode.
Before:
After:
Test plan
Technical Details
New File:
AppearanceMode.swiftNew enum providing helpers for both SwiftUI and UIKit:
Reactive Updates
UIKit view controllers subscribe to appearance changes via Combine for immediate updates without restart.
System Appearance Detection
When in "System" mode,
MainViewControllerdetects iOS/MacOS appearance changes viatraitCollectionDidChangeand broadcasts a notification so all other view controllers update accordingly.Migration
forceDarkMode = true→appearanceMode = .darkforceDarkMode = false→appearanceMode = .system.systemFiles Changed
Helpers/AppearanceMode.swiftStorage/Storage.swiftforceDarkModeBool →appearanceModeenumStorage/Storage+Migrate.swiftSettings/GeneralSettingsView.swiftpreferredColorSchememodifierSwiftUI Views Updated (16 files)
AddAlarmSheet.swiftAlarmEditor.swiftAlarmListView.swiftAlarmSettingsView.swiftAlarmsContainerView.swiftBackgroundRefreshSettingsView.swiftSimpleQRCodeScannerView.swiftInfoDisplaySettingsView.swiftLogView.swiftNightscoutSettingsView.swiftRemoteSettingsView.swiftAdvancedSettingsView.swiftCalendarSettingsView.swiftContactSettingsView.swiftDexcomSettingsView.swiftGraphSettingsView.swiftTabCustomizationModal.swiftUIKit View Controllers Updated (7 files)
MainViewController.swift- Central coordinator, updates window-level styleSettingsViewController.swiftMoreMenuViewController.swiftNightscoutViewController.swiftAlarmViewController.swiftRemoteViewController.swiftSnoozerViewController.swift