Improve CarPlay settings selection avoiding screen blinks#4820
Conversation
|
Found 21 unused localization strings in the codebase. Click to see detailsTo clean up these strings, manually remove them from the |
There was a problem hiding this comment.
Pull request overview
This PR updates the CarPlay Settings selection flows (main server and quick access layout) to avoid UI “blinks” by deferring persistence until the user leaves the selection list, while keeping the selected checkmark updated in-place.
Changes:
- Introduces pending selection state in
CarPlayServerListViewModelfor server and layout choices, committed when the selection template disappears. - Updates
CarPlayServersListTemplateselection templates to refresh sections in-place (checkmark updates) instead of immediately popping the template. - Commits pending selections in
templateWillDisappearfor server/layout selection templates.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Sources/CarPlay/Templates/Servers/CarPlayServerListViewModel.swift | Adds pending server/layout selection state and commit logic to defer persistence and reduce UI blinking. |
| Sources/CarPlay/Templates/Servers/CarPlayServerListTemplate.swift | Updates CarPlay selection templates to update checkmarks via updateSections and commit on template disappearance. |
| guard pendingLayout != quickAccessLayout else { | ||
| return | ||
| } | ||
|
|
| func commitServerSelection() { | ||
| guard let pendingServer else { | ||
| return | ||
| } | ||
| self.pendingServer = nil | ||
|
|
||
| guard pendingServer.identifier != CarPlayPreferredServer.current?.identifier else { | ||
| return | ||
| } | ||
|
|
||
| setServer(server: pendingServer) | ||
| } |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4820 +/- ##
=======================================
Coverage ? 45.02%
=======================================
Files ? 278
Lines ? 16996
Branches ? 0
=======================================
Hits ? 7652
Misses ? 9344
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Screenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes