Conversation
Introduces a new Usage Prediction Common Control section at the top of the Home view, displaying commonly used entities. Adds HAUsagePredictionCommonControl model, request, and integration in HomeViewModel. Also moves entity and area registry models to a dedicated Models folder.
Added a conditional branch to render the section header for 'usage-prediction-common-control' without a chevron, distinguishing it from other grouped entities.
Added a new localization key for the controls prediction section label in the customization view. Updated the Swiftgen strings and HomeViewCustomizationView to use the localized string.
Introduces an 'areas layout' option (list or grid) to the Home view configuration, including localization, UI picker, and database support. Updates relevant models, views, and database schema to support user selection and persistence of the layout preference.
Introduces a grid layout for displaying area sections in HomeView, selectable via configuration. Adds the AreaGridButton component for grid presentation and refactors the view logic to support both list and grid layouts.
Extracted AreaGridButton into its own file and enhanced it to support custom icons for each area. Updated HomeView to display a section header for areas and improved the layout of the areas grid. Modified HomeViewModel.RoomSection to include an optional icon property and updated related logic. Added a new localization key for the areas section title.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds a rooms layout option (grid vs list) and a usage prediction section to the native dashboard. The changes enable users to customize how areas are displayed and show commonly used controls based on usage prediction.
Changes:
- Added grid layout option for displaying areas alongside the existing list layout
- Introduced usage prediction section that displays commonly used entity controls
- Added customization UI for toggling the usage prediction section and selecting areas layout
- Created new data models for usage prediction and areas registry responses
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/Shared/Resources/Swiftgen/Strings.swift | Added localization string constants for new UI elements (areas title, customization options, welcome message) |
| Sources/Shared/Models/HAUsagePredictionCommonControl.swift | New model for usage prediction common control API response |
| Sources/Shared/Models/HAAreasRegistryResponse.swift | New model for areas registry API response with icon and picture support |
| Sources/Shared/Models/EntityRegistryListForDisplay.swift | New model for entity registry display list with categories and metadata |
| Sources/Shared/HATypedRequest+App.swift | Added API request method for usage prediction common control |
| Sources/Shared/Environment/HomeViewConfigurationTable.swift | Added database columns for new configuration options with migration logic |
| Sources/Shared/Database/Tables/HAppEntityTable.swift | Fixed variable naming (shouldCreateTable → shouldCreateColumn) |
| Sources/Shared/Database/DatabaseTables.swift | Added enum cases for new configuration columns and made HomeViewConfiguration CaseIterable |
| Sources/App/WebView/ExperimentalSpace/Home/HomeViewModel.swift | Added usage prediction loading logic, icon property to RoomSection, and caching for user name |
| Sources/App/WebView/ExperimentalSpace/Home/HomeViewCustomizationView.swift | Implemented customization UI with toggles for usage prediction section and areas layout picker |
| Sources/App/WebView/ExperimentalSpace/Home/HomeViewConfiguration.swift | Added AreasLayout enum and configuration properties for new features |
| Sources/App/WebView/ExperimentalSpace/Home/HomeView.swift | Implemented grid and list view layouts with usage prediction section display |
| Sources/App/WebView/ExperimentalSpace/Home/AreaGridButton.swift | New component for displaying area buttons in grid layout |
| Sources/App/Resources/en.lproj/Localizable.strings | Added English localization strings for new features |
| HomeAssistant.xcodeproj/project.pbxproj | Added new source files to build configuration |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4220 +/- ##
=======================================
Coverage ? 44.72%
=======================================
Files ? 252
Lines ? 14467
Branches ? 0
=======================================
Hits ? 6470
Misses ? 7997
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Screenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes