Commit Graph

1341 Commits

Author SHA1 Message Date
Matthias
4a7fd46d67 Fix passive zone lookup in zone-only location privacy mode (#4385)
## Bug

When the **Location Sent** setting is set to **Zone Only**, automations
that trigger on entering a passive zone stop working while the same
automations work correctly with **Exact** location.

### Root cause

In zone-only mode, `SubmitLocation` derives the current zone by GPS
lookup via `RLMZone.zone(of:in:)` rather than using the zone associated
with the incoming region event (the event zone may be the one being
*exited*, so a fresh lookup is needed). That lookup filtered using
`trackablePredicate`:

```swift
.init(format: "TrackingEnabled == true && isPassive == false")
```

The `isPassive == false` condition meant that when the device was inside
a passive zone, the lookup returned `nil`, causing the payload to report
`not_home` to Home Assistant instead of the passive zone so no
automation triggered.

In **Exact** mode this doesn't occur because raw GPS coordinates are
sent and Home Assistant resolves the zone server-side, where passive
zones are handled correctly.

Note that passive zones *are* monitored for region enter/exit events by
the iOS app (`ZoneManager` filters only on `TrackingEnabled`, not
`isPassive`), so the region event does fire, the zone is simply lost
during the zone-only lookup step.

## Fix

Remove `isPassive == false` from the filter in `RLMZone.zone(of:in:)`,
replacing `trackablePredicate` with a `TrackingEnabled == true`-only
filter. This method performs a GPS-to-zone lookup and has no reason to
exclude passive zones.

`trackablePredicate` is left unchanged and continues to be used
correctly in `GeocoderSensor`.
2026-02-24 10:47:38 +01:00
Bruno Pantaleão Gonçalves
a21ebf003b Refactor WebViewController (#4383)
Split WebViewController functionality into multiple extension files
(Alerts, EmptyState, Gestures, Navigation, Onboarding, Settings,
StatusBar, URLLoading, WebViewSetup) and add FrontEndConnectionState
enum. Update Xcode project to include the new source files and adjust
several Database test file references and a local Swift package path
(Sources/SharedPush). Also add empty input/output path arrays to several
CocoaPods embed phases. This refactors web view features into modular
components and wires them into the project file.

<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-02-23 11:57:56 +01:00
Copilot
5d88cf34cc Fix: DownloadManagerView traps window on Mac Catalyst with no dismiss path (#4379)
On Mac Catalyst, downloading the emergency kit backup presented
`DownloadManagerView` with no way to dismiss it — no swipe gesture, no
close button — requiring a force-quit to recover the window.

Mac Catalyst has no sheet swipe-to-dismiss, so the view needs an
explicit close affordance via a navigation bar.

## Changes

- **`DownloadManagerView`** — conditionally adds a `CloseButton` as
leading toolbar item when `Current.isCatalyst`, using the existing
`.modify` pattern
- **`WebViewController+WebKitDelegates`** — wraps the
`UIHostingController` in a `UINavigationController` on Mac Catalyst so
the toolbar is rendered

```swift
// WebViewController+WebKitDelegates.swift
if Current.isCatalyst {
    let navigationController = UINavigationController(rootViewController: downloadController)
    presentOverlayController(controller: navigationController, animated: true)
} else {
    presentOverlayController(controller: downloadController, animated: true)
}
```

```swift
// DownloadManagerView.swift
.modify { view in
    if Current.isCatalyst {
        view.toolbar {
            ToolbarItem(placement: .topBarLeading) {
                CloseButton { dismiss() }
            }
        }
    } else {
        view
    }
}
```

Pattern mirrors the existing `WidgetSelectionView` Mac Catalyst handling
in `EntityAddToHandler`.

## Screenshots

Before: "Download finished" overlay with no dismiss control, app window
unresponsive until force-quit.

After: Navigation bar with close button allows dismissal normally.

## Link to pull request in Documentation repository

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

## Any other notes

No documentation change needed — no user-visible feature added, only a
broken interaction fixed.

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Lost window control of HA app after downloading emergency
kit backup</issue_title>
> <issue_description><!-- Please READ THIS FIRST
> If your issue relates to something not looking right on Home Assistant
within the Companion App, please check if the error is present in Safari
on macOS too. If the issue is also seen in Safari, please open an issue
on the frontend repo
(https://github.com/home-assistant/frontend/issues/new?labels=bug&template=BUG_REPORT.md)
instead -->
> 
> **Device model, version and app version**
> <!-- Please include your mac's model and version as listed in 'About
This Mac'. Please also give the app version listed in the Home
Assistant>About Home Assistant, please include the number in brackets.
Safari can be found by launching it in Safari > About Safari. -->
> 
> Model Name: M1 Pro MBP
> macOS Version: 15.7.4
> App Version: 2026.2.1
> Safari Version: n/a
> 
> **Home Assistant Core Version**
> <!-- Please give the version number of Home Assistant Core you are
running -->
> 2026.2.2
> 
> **Describe the bug**
> 
> Downloading the emergency kit through the macOS app results in the app
window staying continually on screen and being unable to click anywhere
else on screen to regain control of the app.
> 
> The app must be force closed via Activity Monitor to regain control of
the app.
> 
> **To Reproduce**
> 
> 1. Open macOS HA app.
> 2. Go to Settings, System, Backups, Settings and History, Download
emergency kit
> 
> **Expected behavior**
> 
> Window to close after the config is downloaded allowing the user to
control the app again.
> 
> **Screenshots**
> <!-- If applicable, add screenshots to help explain your problem. -->
> 
> <img width="692" height="716" alt="Image"
src="https://github.com/user-attachments/assets/0807b43a-5f6c-4651-bbdd-7ff0daf72e94"
/>
> 
> **Additional context**
> <!--Add any other context about the problem here.-->
> </issue_description>
> 
> <agent_instructions>When presenting the DownloadManagerView on Mac
Catalyst we can’t rely on presentation defender and gesture to dismiss,
we need a navigation view with a “CloseButton” as leading toolbar
item</agent_instructions>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes home-assistant/iOS#4378

<!-- START COPILOT CODING AGENT TIPS -->
---

🔒 GitHub Advanced Security automatically protects Copilot coding agent
pull requests. You can protect all pull requests by enabling Advanced
Security for your repositories. [Learn more about Advanced
Security.](https://gh.io/cca-advanced-security)

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
2026-02-23 10:20:26 +00:00
github-actions[bot]
f77c2eafe8 Update Localized Strings (#4380)
Automatically created by zacwest.

Co-authored-by: Home Assistant Bot <hello@home-assistant.io>
2026-02-23 11:17:00 +01:00
Max D
c05233bf63 Bind delayed instruction hide to SwiftUI view lifecycle (#4382) 2026-02-22 21:37:44 +01:00
github-actions[bot]
5c85ffc3c2 Update Localized Strings (#4374)
Automatically created by zacwest.

Co-authored-by: Home Assistant Bot <hello@home-assistant.io>
2026-02-20 06:54:34 +00:00
Bruno Pantaleão Gonçalves
bb273efca4 Only use config defined icon for CarPlay if user explicit set (#4371)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-02-19 10:56:39 +00:00
Copilot
82bed24650 Fix widget builder dismissal on macOS Catalyst (#4370)
## Summary

macOS users cannot dismiss "Add to Widget" flows, requiring force quit.
`NavigationView`/`NavigationStack` missing
`.navigationViewStyle(.stack)` - required for Catalyst dismissal
controls (iOS uses gestures).

**Changed files:**
- `WidgetCreationView.swift` - Added `.stack` style to both
`NavigationStack` (iOS 16+) and `NavigationView` branches
- `WidgetSelectionView.swift` - Added `.stack` style to `NavigationView`

```swift
NavigationView {
    content
}
.navigationViewStyle(.stack)  // ← Enables dismissal controls on macOS
```

Pattern already established in `MagicItemAddView`, `AssistView`,
`SettingsView`, and 20+ other views.

## Screenshots

N/A - Fixes dismissal behavior only, no visual changes

## Link to pull request in Documentation repository

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

## Any other notes

Agent instructions specified this exact fix. 3 lines added across 2
files.

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Unable to Dismiss `Add to Widget` window</issue_title>
> <issue_description><!-- Please READ THIS FIRST
> If your issue relates to something not looking right on Home Assistant
within the Companion App, please check if the error is present in Safari
on macOS too. If the issue is also seen in Safari, please open an issue
on the frontend repo
(https://github.com/home-assistant/frontend/issues/new?labels=bug&template=BUG_REPORT.md)
instead -->
> 
> **Device model, version and app version**
> <!-- Please include your mac's model and version as listed in 'About
This Mac'. Please also give the app version listed in the Home
Assistant>About Home Assistant, please include the number in brackets.
Safari can be found by launching it in Safari > About Safari. -->
> 
> Model Name: MacBook M1
> macOS Version: 26.3
> App Version: 2026.2 (2026.2.1758)
> Safari Version: 26.3 (21623.2.7.11.6)
> 
> **Home Assistant Core Version**
> 2026.2.2
> 
> **Describe the bug**
> There doesn’t appear to be a way to dismiss the “Add to Widget” for
both windows using the macOS app. I have to force close the app to close
the window. This seems like an oversight as on iOS it uses gestures
which isn't supported here.
> 
> **To Reproduce**
> - Select Entity more-info
> - Click Add to Widget
> - See result
> 
> **Expected behavior**
> There should be a close button to get out of the window.
> **Screenshots**
> 
> <img width="732" height="934" alt="Image"
src="https://github.com/user-attachments/assets/12f28cc5-02c9-43ed-88c5-f96d386c17e3"
/>
> <img width="732" height="934" alt="Image"
src="https://github.com/user-attachments/assets/1c0b9b0e-600e-46db-94cf-15c1fbbec6d5"
/>
> 
> **Additional context**
> <!--Add any other context about the problem here.-->
> Unrelated, but I can't seem to be to delete the widgets on this screen
either.</issue_description>
> 
> <agent_instructions>When adding widget from mac catalyst webview, we
are opening the widget screen in a NavigationStack/NavigationView
without navigationViewStyle .stack defined, update
that</agent_instructions>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes home-assistant/iOS#4369

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
2026-02-19 10:03:55 +00:00
Copilot
ab3d3c34a9 Add Common Controls widget (#4365)
## Summary

Adds a new widget called "Common Controls" that displays commonly used
entities based on usage patterns from the
`usage_prediction/common_control` endpoint.

**New Files:**
- `WidgetCommonlyUsedEntities.swift` - Widget definition using
`WidgetBasicContainerView` (same UI as WidgetCustom)
- `WidgetCommonlyUsedEntitiesTimelineProvider.swift` - Timeline provider
with state fetching and caching

**Key Changes:**
- Filters entities to supported domains: `light`, `switch`, `cover`,
`fan`, `climate`, `lock`
- Added `climate` domain to `Domain` enum with thermostat icon
- Added climate interaction in `MagicItem` (opens more info dialog)
- Registered in iOS 17/18 widget bundles
- Added `commonlyUsedEntities` to `WidgetsKind` and `DataWidgetsUpdater`
- Updated `WidgetsKindTests` to include the new widget kind

**Widget Behavior:**
- Fetches entities from the configured server (or first available) via
`usagePredictionCommonControl()`
- Entity info from app database via `MagicItemProvider`
- Entity states via `ControlEntityProvider` (same as WidgetCustom)
- 15-minute refresh policy with 1-second state cache (iOS reload bug
workaround)
- Supports systemSmall/Medium/Large families

## Screenshots

<img
src="https://github.com/user-attachments/assets/ad37542d-b3b4-4476-81b4-8be7425b5f31">

## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#

## Any other notes

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/home-assistant/iOS/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-18 13:45:03 +01:00
github-actions[bot]
1a7ed9fc17 Update Localized Strings (#4366)
Automatically created by zacwest.

Co-authored-by: Home Assistant Bot <hello@home-assistant.io>
Co-authored-by: Bruno Pantaleão Gonçalves <5808343+bgoncal@users.noreply.github.com>
2026-02-18 11:25:17 +00:00
Bruno Pantaleão Gonçalves
65316f2602 Check connection state before auto reload webview (#4364)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
Recently it was introduced a feature to reload webview when app has been
backgrounded for more than 5 minutes, this PR adds a layer on top of it
that only reloads if the webview frontend connection state is not
connected.


## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-18 11:13:20 +01:00
Bruno Pantaleão Gonçalves
9c2a40075c Improve to-do list widget UI, row heights and alignment. (#4367)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
<img width="1366" height="918" alt="CleanShot 2026-02-18 at 10 09 36@2x"
src="https://github.com/user-attachments/assets/993eb9af-1762-414d-96bc-8e85a1691fed"
/>

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-02-18 09:42:46 +00:00
github-actions[bot]
7c458599e8 Update Localized Strings (#4361)
Automatically created by zacwest.

Co-authored-by: Home Assistant Bot <hello@home-assistant.io>
Co-authored-by: Bruno Pantaleão Gonçalves <5808343+bgoncal@users.noreply.github.com>
2026-02-17 15:56:49 +00:00
Copilot
ca986f1e8e Fix widget todo list time display for sub-hour due dates (#4359)
## Summary

Widget todo items due within 1 hour displayed as "in 1 hour" due to
`RelativeDateTimeFormatter` rounding. Now shows minute precision ("in 15
minutes", "in 30 minutes") for better time awareness with full
localization support.

**Implementation:**
- Added `DateComponentsFormatter` for minute-level formatting
- Enhanced `dueDisplay` to detect `abs(timeInterval) < 3600`
- Checks `abs(timeInterval) < 60` directly for "Now" threshold before
calculating minutes
- Uses `ceil()` for future times and `floor()` for past times to avoid
rounding boundary issues
- Displays localized strings via `L10n.Widgets.TodoList.DueDate.now`,
`.inFormat()`, and `.agoFormat()`
- Preserves existing formatter for ≥1 hour durations

**Localization:**
- Added 3 new localization strings to all 34 locale files (English
placeholders for translation team)
- Updated `Strings.swift` with corresponding L10n accessor functions
- All time displays now properly localized via `L10n` infrastructure

**Code Quality:**
- Made `dueDisplay` internal (not private) for testability via
`@testable import`
- Restored family-based widget row spacing logic that was accidentally
removed
- Fixed accessibility issues by replacing `.hidden()` and `.overlay()`
patterns with proper conditional rendering
- Tests made locale-agnostic using helper methods that generate expected
strings with same formatter

**Testing:**
- Added `WidgetTodoListViewTests.swift` with comprehensive coverage for
all time ranges
- Tests validate behavior for items due in 15, 30, 45 minutes, 1 minute,
<1 minute, overdue items, and >1 hour items
- Tests use same `DateComponentsFormatter` and L10n functions as
implementation for locale independence

## Screenshots
N/A - Text-only change

## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#

## Any other notes
Uses `DateComponentsFormatter.allowedUnits = [.minute]` for proper
localization. English placeholder strings have been added to all 34
locale files for the translation team to localize. The implementation
ensures consistent formatting across all supported languages using the
iOS localization system.

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> The widget To-Do List shows items with due dates less than 1 hour as
"in 1 hour" where it should display the time in minutes (e.g., "in x
minutes"). The issue lies in the `dueDisplay` method in the
`WidgetTodoListView` struct (file path:
`Sources/Extensions/Widgets/TodoList/WidgetTodoListView.swift`).
Specifically, this function uses the `numericRelativeFormatter` but does
not account for cases where the remaining due time is less than 1 hour.
> 
> The `numericRelativeFormatter` is currently used in the following
block:
> ```swift
> if item.hasDueTime {
> let text = Self.numericRelativeFormatter.localizedString(for: due,
relativeTo: now)
> return DueDisplay(text: capitalizeLeadingCharacter(in: text),
isPastDateOnly: false)
> }
> ```
> This produces a generic "in 1 hour" string for times under an hour. To
fix this, we need to enhance the logic to check if the remaining time is
less than 1 hour. If so, explicitly calculate and display the remaining
minutes using custom logic.
> 
> ### Proposed Fix:
> 1. Modify the `dueDisplay` method to check if the due time difference
is less than 1 hour.
> 2. If the remaining time is below one hour, calculate the difference
in minutes and format it as "in x minutes."
> 3. Otherwise, use the `numericRelativeFormatter` as before.
> 
> ### Resources for the Fix:
> - `DateComponentsFormatter` for better control over minute formatting.
> - Update the logic in the `dueDisplay` method to handle the special
case explicitly.
> 
> ### Testing
> - Add unit tests or predefined timelines with entries for due dates at
15, 30, and 45 minutes to confirm the enhanced functionality is applied
correctly.


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/home-assistant/iOS/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-17 16:16:13 +01:00
Bruno Pantaleão Gonçalves
af1967b282 Add due date to todo list widget + haptics (#4357)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
<img width="2058" height="1342" alt="CleanShot 2026-02-16 at 10 48
03@2x"
src="https://github.com/user-attachments/assets/49cf17c8-219d-46f6-aa82-eed163f5d03b"
/>

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-02-16 10:18:27 +00:00
github-actions[bot]
dc375b70da Update Localized Strings (#4353)
Automatically created by zacwest.

Co-authored-by: Home Assistant Bot <hello@home-assistant.io>
2026-02-16 09:33:03 +01:00
Copilot
61e4905e96 Add haptic feedback to todo list widget buttons (#4355) 2026-02-14 18:39:47 +00:00
Copilot
76238c3a95 Update AppIntents to use system sound 1520 (Peek) (#4354) 2026-02-14 16:06:50 +00:00
github-actions[bot]
1687181617 Update Localized Strings (#4345)
Automatically created by zacwest.

Co-authored-by: Home Assistant Bot <hello@home-assistant.io>
2026-02-13 14:19:50 +01:00
Bruno Pantaleão Gonçalves
e47b6a2662 Update todo list on app background + fix copy (#4350)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-02-13 12:05:36 +01:00
Bruno Pantaleão Gonçalves
fdb0e2bc03 Todo list widget (#4347) 2026-02-12 23:40:14 +01:00
github-actions[bot]
3e9480ed88 Update Localized Strings (#4339)
Automatically created by zacwest.

Co-authored-by: Home Assistant Bot <hello@home-assistant.io>
Co-authored-by: Bruno Pantaleão Gonçalves <5808343+bgoncal@users.noreply.github.com>
2026-02-11 21:30:44 +01:00
github-actions[bot]
a6c224e251 Update Localized Strings (#4335)
Automatically created by zacwest.

Co-authored-by: Home Assistant Bot <hello@home-assistant.io>
2026-02-10 21:13:10 +00:00
Bruno Pantaleão Gonçalves
2120ef8b79 Add extra padding to DownloadManagerView (#4337) 2026-02-10 21:39:09 +01:00
github-actions[bot]
3c10e9c5aa Update Localized Strings (#4329)
Automatically created by zacwest.

Co-authored-by: Home Assistant Bot <hello@home-assistant.io>
2026-02-10 02:11:23 +00:00
Bruno Pantaleão Gonçalves
c29e9409f3 Fix crash on iOS 15/16 due to @Observable in PassThroughWindow (#4334)
Replace @Observable macro with ObservableObject pattern to fix crash
during app launch on iOS 15-16 devices.

Root cause:
- PassThroughWindow used @Observable macro (iOS 17+ API)
- Despite @available(iOS 18, *), Swift compiled metadata into binary
- During app launch, Realm's objc_copyClassList() triggered metadata
loading for all classes
- @Observable generated code referenced symbols unavailable on iOS 15/16
- Result: null pointer dereference crash at startup

The fix:
- Replace @Observable with ObservableObject + @Published properties
- These patterns work on iOS 13+, safe for iOS 15/16
- No behavioral changes, same observation mechanism
- Maintains @available(iOS 18, *) for class usage

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-09 23:34:35 +00:00
Bruno Pantaleão Gonçalves
82e1ce3daa Use NavigationStack for settings starting on iOS 16 (#4330)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2026-02-09 15:40:17 +01:00
Bruno Pantaleão Gonçalves
120df2a204 Skip sync on Catalyst for load/refresh (#4325)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
Extracted load/refresh blocks and conditionally invoke
Current.connectivity.syncNetworkInformation only on non-Catalyst
targets. On Catalyst the closures are executed immediately to avoid
unnecessary async network syncs and ensure immediate UI behavior.
Applied to WebViewController and its protocol conformance refresh
handling.

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-02-08 15:07:54 +00:00
Bruno Pantaleão Gonçalves
e17f81f64b Organize webview folder (#4324)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-02-08 15:18:43 +01:00
Bruno Pantaleão Gonçalves
37eeabe567 Extract WebViewController delegates & protocol (#4323)
Move WKNavigation/UI delegate logic and WebViewControllerProtocol
conformance into two new files (WebViewController+WebKitDelegates.swift
and WebViewController+ProtocolConformance.swift) for better separation
of concerns. Update WebViewController.swift to make several members
(webView, refreshControl, initialURL, lastNavigationWasServerError,
emptyStateTimer, isConnected) and helper methods non-private so the
split extensions can access them. Add file references to the Xcode
project (project.pbxproj). This reorganizes the code for readability and
easier maintenance without changing runtime behavior.

<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-08 14:34:17 +01:00
github-actions[bot]
eeb8b25003 Update Localized Strings (#4321)
Automatically created by zacwest.

Co-authored-by: Home Assistant Bot <hello@home-assistant.io>
2026-02-07 14:54:02 +01:00
Copilot
1245601cec Present downloads view as bottom sheet with medium detent (#4319) 2026-02-06 09:30:21 +01:00
Bruno Pantaleão Gonçalves
a6e31428bf Display entity picker in large sheet due to keyboard auto focus (#4317) 2026-02-05 17:30:28 +00:00
Bruno Pantaleão Gonçalves
9b015f2a76 Show dynamic island toasts only when debugging (#4318) 2026-02-05 17:54:55 +01:00
github-actions[bot]
53c3424461 Update Localized Strings (#4313)
Automatically created by zacwest.

Co-authored-by: Home Assistant Bot <hello@home-assistant.io>
2026-02-05 11:14:44 +01:00
Bruno Pantaleão Gonçalves
73b690e7be Fix CarPlay configuration not saving for new users (#4314)
When loadDatabase() doesn't find an existing CarPlay configuration, it
was only logging an error without initializing a default config. This
caused isInitialLoad to remain true, which blocked the auto-save
mechanism in setupAutoSave().

Changes:
- Initialize default CarPlayConfig when none exists
- Change log level from error to info (first-time setup isn't an error)

Fixes issue where users could configure CarPlay settings but changes
were never persisted to the database.

<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-02-04 15:07:50 +00:00
github-actions[bot]
33b2412a1e Update Localized Strings (#4303)
Automatically created by bgoncal.

Co-authored-by: Home Assistant Bot <hello@home-assistant.io>
2026-02-03 14:38:31 +01:00
Bruno Pantaleão Gonçalves
d1515b8df7 fix: Preserve URL path when base URL changes due to network switch (#4296)
When the user switches between internal and external networks (SSID
change), the app refreshes with a new base URL. Previously, the current
path was lost and the user was redirected to the home page.

This change preserves the current path by using the existing
adapting(url:) method to apply the new base URL while keeping the path
intact.

Example: If user is on /lovelace/kitchen and switches from internal to
external network, they will stay on /lovelace/kitchen instead of being
redirected to /.

<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->

---------

Co-authored-by: Bruno Gonçalves <bgoncal@users.noreply.github.com>
2026-02-02 11:50:20 +01:00
Bruno Pantaleão Gonçalves
7548c9b4ae fix: Exclude custom widgetFamily environment from widget extension ta… (#4297)
…rget

The custom EnvironmentKey extension for widgetFamily conflicts with
WidgetKit's native \.widgetFamily environment variable when compiled for
the widget extension.

This wraps the custom definition with #if !WIDGET_EXTENSION so it's only
available in the main app target (for widget preview in the widget
creator).

<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->

---------

Co-authored-by: Bruno Gonçalves <bgoncal@users.noreply.github.com>
2026-02-02 11:24:21 +01:00
Copilot
9b887b3669 Make EntityPicker auto focus on search field when it appears (#4294) 2026-01-30 20:23:41 +01:00
Copilot
7efea47b07 Add Safari toolbar button to CameraPlayerView for opening more info dialog (#4288)
## Summary

Adds a Safari icon toolbar button to `CameraPlayerView` that opens the
camera entity's more info dialog using
`AppConstants.openEntityDeeplinkURL`.

Changes:
- Added Safari SF Symbol button as a separate toolbar item (displayed
individually, not combined with close button for iOS 26 liquid glass
compatibility)
- Button triggers `openEntityDeeplinkURL` deep link with camera's
`entityId` and `serverId`
- Uses `URLOpener.shared` to open the deep link URL
- Includes accessibility label using existing
`L10n.Widgets.Action.Name.moreInfoDialog` localization

```swift
ToolbarItem(placement: .primaryAction) {
    if controlsVisible {
        Button {
            openMoreInfo()
        } label: {
            Image(systemSymbol: .safari)
        }
        .accessibilityLabel(L10n.Widgets.Action.Name.moreInfoDialog)
    }
}
```

## Screenshots


## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#

## Any other notes

<!-- START COPILOT CODING AGENT SUFFIX -->



<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> In CameraPlayerView, add one more toolbar button with safari sfsymbol
icon, when user taps on it we use our AppConstants link that open it's
entityId in a more info dialog


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
2026-01-30 15:50:53 +00:00
Bruno Pantaleão Gonçalves
dad9d9ff86 Improve loader handling in camera player views (#4292)
Refactored loader visibility logic by introducing a showLoader state in
CameraPlayerView and passing it to WebRTCVideoPlayerView. The loader is
now displayed at the top level, and its state is synchronized with the
WebRTC view model. Also updated a connection security tip string for
clarity.

<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-01-30 14:41:47 +00:00
Bruno Pantaleão Gonçalves
b118b4c2c6 Remove network disclaimer from HomeNetworkInputView (#4286)
The network disclaimer view and its usage have been removed from
HomeNetworkInputView, simplifying the UI and reducing on-screen
information.

<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-01-30 12:36:21 +00:00
Bruno Pantaleão Gonçalves
208fe1136f Remove legacy CarPlay config conversion logic (#4284)
Eliminated the convertLegacyActionsToCarPlayConfig method and its
invocation. This streamlines the CarPlayConfigurationViewModel by
removing support for migrating legacy actions, likely because such
migration is no longer needed.

<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-01-30 11:12:10 +00:00
Bruno Pantaleão Gonçalves
3d48af0a8b Add tip to connection block screen to mention points of attention (#4283)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
<img width="1206" height="2622" alt="Simulator Screenshot - iPhone 17 -
2026-01-30 at 11 22 13"
src="https://github.com/user-attachments/assets/7035aa1f-f6ff-4edf-8be3-7ea6169730b5"
/>

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-30 11:08:13 +00:00
Bruno Pantaleão Gonçalves
6f15fddc33 Remove legacy actions migration for watch config (#4285)
Deleted the convertLegacyActionsToWatchConfig method and its invocation,
as legacy action migration to watch configuration is no longer needed.

<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-01-30 11:03:27 +00:00
Bruno Pantaleão Gonçalves
d73ea40df4 Implement auto-save CarPlay configuration (#4282)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-01-30 10:50:00 +00:00
Bruno Pantaleão Gonçalves
cd502a3ee1 Display entity picker as bottom sheet (#4278)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

<img width="1658" height="1142" alt="CleanShot 2026-01-30 at 11 00
58@2x"
src="https://github.com/user-attachments/assets/a06062c9-f373-499e-b42a-1b07b244019c"
/>


## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-01-30 10:38:18 +00:00
Bruno Pantaleão Gonçalves
fc06463235 Fix widget systemSmall preview (#4274)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2026-01-30 08:46:38 +00:00
Bruno Pantaleão Gonçalves
057b67ca97 Refactor camera player UI and remove legacy WebRTC views (#4277) 2026-01-29 21:00:18 +01:00