Skip to content

Add summaries and area context to native dashboard#4221

Merged
bgoncal merged 16 commits intomainfrom
summaries
Jan 14, 2026
Merged

Add summaries and area context to native dashboard#4221
bgoncal merged 16 commits intomainfrom
summaries

Conversation

@bgoncal
Copy link
Member

@bgoncal bgoncal commented Jan 14, 2026

Summary

Screenshots

Simulator Screenshot - iPhone 17 - 2026-01-14 at 16 42 40

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.
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.
Entity tiles now visually indicate when an entity is unavailable or unknown by using a gray, dashed border, reduced opacity, and a gray icon color. This improves clarity for users when entities are not accessible.
EntityTileView is now a pure UI component, decoupled from Home Assistant-specific logic. Introduced HomeEntityTileView to encapsulate business logic such as device class lookup, icon color computation, and AppIntents integration. Updated EntityDisplayComponents to use HomeEntityTileView for Home Assistant entities.
Replaces DomainSummaryCard's custom layout with EntityTileView for consistency and code reuse. Updates DomainSummariesSection to use a Section header and adjusts grid spacing to use DesignSystem constants. Refactors icon mapping for domain summaries and removes redundant padding in HomeView. Cleans up formatting and improves maintainability.
Introduces localized strings for summaries, lights, and covers. Refactors DomainSummary to use a Domain enum instead of String, updates summary generation logic, and integrates new localization keys throughout the HomeViewModel and UI components.
Adds optional area name display to entity tiles by passing areaName to HomeEntityTileView and updating grid builders to support areaNameProvider. HomeViewModel now provides areaName lookup for entities, and HomeView passes this for usage prediction sections. Also improves text truncation for tile state display.
Made DomainSummary conform to Equatable and updated the logic to assign domainSummaries only if the new value differs from the current one. Logging now occurs only when domainSummaries is actually updated, reducing unnecessary log noise.
@bgoncal bgoncal self-assigned this Jan 14, 2026
Copilot AI review requested due to automatic review settings January 14, 2026 15:41
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 PR adds domain summaries and area context display to the native dashboard in the Home Assistant iOS app. It refactors the EntityTileView into a pure UI component and creates a new HomeEntityTileView for Home Assistant-specific logic, while introducing domain summary cards that show aggregate status for entities like lights and covers.

Changes:

  • Refactored EntityTileView to be a pure UI component with business logic extracted to HomeEntityTileView
  • Added domain summary functionality to compute and display aggregate entity states (lights, covers)
  • Enhanced entity tiles to show area context information in the usage prediction section
  • Added localized strings for summary titles

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Sources/Shared/Resources/Swiftgen/Strings.swift Generated localization strings for summaries feature
Sources/App/WebView/ExperimentalSpace/Shared/EntityDisplayComponents.swift Updated entity grid components to support area name provider
Sources/App/WebView/ExperimentalSpace/Home/HomeViewModel.swift Added domain summary computation logic and area name lookup
Sources/App/WebView/ExperimentalSpace/Home/HomeView.swift Integrated summaries section and area context into home view
Sources/App/WebView/ExperimentalSpace/Home/DomainSummaryCard.swift New component for displaying domain summary cards
Sources/App/WebView/ExperimentalSpace/EntityTile/HomeEntityTileView.swift New Home Assistant-specific entity tile with business logic
Sources/App/WebView/ExperimentalSpace/EntityTile/EntityTileView.swift Refactored to pure UI component
Sources/App/Resources/en.lproj/Localizable.strings Added English localization for summaries
HomeAssistant.xcodeproj/project.pbxproj Added new files to Xcode project

Introduces new localized strings for Home view summaries, including lights, covers, and active counts. Updates DomainSummaryCard and HomeViewModel to use these localized strings via Swiftgen, improving internationalization and consistency.
@bgoncal bgoncal enabled auto-merge (squash) January 14, 2026 15:50
Introduces a new 'showSummaries' option in HomeViewConfiguration, allowing users to enable or disable the display of summaries in the Home view. Updates the UI to include a toggle for this setting and adds necessary localization and database support.
@bgoncal bgoncal merged commit 9ee8ac4 into main Jan 14, 2026
13 of 14 checks passed
@bgoncal bgoncal deleted the summaries branch January 14, 2026 16:39
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@6f577eb). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff           @@
##             main   #4221   +/-   ##
======================================
  Coverage        ?       0           
======================================
  Files           ?       0           
  Lines           ?       0           
  Branches        ?       0           
======================================
  Hits            ?       0           
  Misses          ?       0           
  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.

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