-
Notifications
You must be signed in to change notification settings - Fork 354
Migrate "Settings > Sensors" to SwiftUI #3577
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
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.
Pull Request Overview
This PR migrates the “Settings > Sensors” UI from UIKit/Eureka to SwiftUI by removing legacy view controllers and introducing new SwiftUI views and view models. Key changes include:
- Removal of SensorListViewController and SensorDetailViewController and their associated UIKit code.
- Introduction of SwiftUI screens (SensorRow, SensorListView, SensorDetailView, etc.) and corresponding view models.
- Updates to localization strings and UI components to support the new SwiftUI design.
Reviewed Changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
Tests/App/Settings/SensorRow.test.swift | Added unit tests for the new SensorRow SwiftUI view. |
Sources/Shared/Resources/Swiftgen/Strings.swift | Added new localization entries for Unknown sensor, FocusPermission, and other sensor settings. |
Sources/Shared/Environment/Environment.swift | Updated comment to accurately describe the Date provider. |
Sources/App/Settings/SettingsRootDataSource.swift | Replaced legacy sensor view controller with SwiftUI view embedded in a hosting controller. |
Sources/App/Settings/Sensors/* | Removed obsolete UIKit-based sensor view controllers and introduced SwiftUI views and view models. |
Sources/App/Settings/Gestures/AppleLikeListTopRowHeader.swift | Modified initializer to allow for an optional subtitle for better flexibility. |
Files not reviewed (2)
- HomeAssistant.xcodeproj/project.pbxproj: Language not supported
- Sources/App/Resources/en.lproj/Localizable.strings: Language not supported
Comments suppressed due to low confidence (1)
Sources/Shared/Resources/Swiftgen/Strings.swift:62
- [nitpick] The key 'unknownLabel' is inconsistent with the snake_case convention used for other keys (e.g., 'save_label'). Consider aligning the naming convention.
public static var unknownLabel: String { return L10n.tr("Localizable", "unknownLabel") }
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3577 +/- ##
==========================================
+ Coverage 44.72% 45.08% +0.36%
==========================================
Files 232 232
Lines 13911 13916 +5
==========================================
+ Hits 6221 6274 +53
+ Misses 7690 7642 -48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Screenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes