Fix CarPlay Settings screen freezing#4478
Fix CarPlay Settings screen freezing#4478llkenny wants to merge 2 commits intohome-assistant:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fixes issue #4439 where the CarPlay Settings screen would freeze immediately upon opening. The root cause was a NavigationLink destination implemented as an inline computed view property, which caused SwiftUI to continuously re-evaluate the view and triggered an infinite recomposition loop. The fix extracts this destination into a separate CarPlayTabsSelectionView struct, creating a stable identity boundary that prevents the recomposition cycle.
Changes:
- Creates new
CarPlayTabsSelectionView.swiftwith the extracted tabs selection UI - Updates
CarPlayConfigurationView.swiftto use the new extracted view instead of an inline computed property - Updates the Xcode project file to include the new file in the build configuration
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Sources/App/Settings/CarPlay/CarPlayTabsSelectionView.swift | New view struct that encapsulates the tabs selection UI, replacing the inline computed view |
| Sources/App/Settings/CarPlay/CarPlayConfigurationView.swift | Refactored to instantiate CarPlayTabsSelectionView directly in the NavigationLink |
| HomeAssistant.xcodeproj/project.pbxproj | Added file reference and build phase entry for the new view |
b26908b to
cfe853a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4478 +/- ##
=======================================
Coverage ? 42.33%
=======================================
Files ? 268
Lines ? 15758
Branches ? 0
=======================================
Hits ? 6671
Misses ? 9087
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Fix #4439
Freeze caused by NavigationLink destination implemented as inline computed view inside parent:
Fix: extract destination into separate View struct (CarPlayTabsSelectionView):
How to reproduce the bug:
Screenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes
Before fix





After fix