Skip to content

Add rooms layout option to native dashboard#4220

Merged
bgoncal merged 10 commits intomainfrom
rooms-layout
Jan 14, 2026
Merged

Add rooms layout option to native dashboard#4220
bgoncal merged 10 commits intomainfrom
rooms-layout

Conversation

@bgoncal
Copy link
Member

@bgoncal bgoncal commented Jan 14, 2026

Summary

Screenshots

CleanShot 2026-01-14 at 14 45 37@2x

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

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.
@bgoncal bgoncal self-assigned this Jan 14, 2026
Copilot AI review requested due to automatic review settings January 14, 2026 13:45
Copy link
Contributor

Copilot AI left a 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 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
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 15.78947% with 16 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@5546cbe). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...hared/Environment/HomeViewConfigurationTable.swift 27.27% 8 Missing ⚠️
Sources/Shared/HATypedRequest+App.swift 0.00% 4 Missing ⚠️
...urces/Shared/Database/Tables/HAppEntityTable.swift 0.00% 2 Missing ⚠️
...Shared/Models/HAUsagePredictionCommonControl.swift 0.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bgoncal bgoncal merged commit 6f577eb into main Jan 14, 2026
16 of 17 checks passed
@bgoncal bgoncal deleted the rooms-layout branch January 14, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants