3 Commits

Author SHA1 Message Date
Bruno Pantaleão Gonçalves
5f1ae83d05
Make app database update in settings on-demand trigger (#4244)
<!-- 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-21 12:58:22 +01:00
Bruno Pantaleão Gonçalves
ff2372f2df
Log URL to be opened on URLOpener (#4063)
<!-- 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. -->
2025-12-08 14:56:06 +00:00
Copilot
8aa8e728fc
Migrate ConnectionSettingsViewController to SwiftUI with ViewModel (#3962)
## Summary

Migrates `ConnectionSettingsViewController` from UIKit+Eureka to SwiftUI
with proper business logic separation. The new implementation follows
established patterns in the codebase (`ClientEventsLogView`/`ViewModel`)
while preserving all existing functionality.

**Changes:**
- **ConnectionSettingsViewModel** - Extracted business logic: server
observation, state management, user actions (share/activate/delete).
Fixed NotificationCenter observer memory leak by properly storing and
removing observer token in deinit.
- **ConnectionSettingsView** - SwiftUI replacement with sections for
Status, Details, Privacy, and Actions. Uses `SFSafeSymbols` for
type-safe SF Symbol references. Includes convenience
`embedInHostingController()` extension for cleaner UIKit integration
syntax. Added error alert to display deletion failures to users.
- **SettingsViewController** - Updated to instantiate SwiftUI view via
`embeddedInHostingController()`
- **ConnectionURLViewController** - Added convenience initializer with
optional `row` parameter for SwiftUI navigation compatibility

The old `ConnectionSettingsViewController.swift` remains but is
unreferenced.

## Screenshots

N/A - Functional equivalence maintained

## Link to pull request in Documentation repository

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

## Any other notes

All features preserved: connection status display, URL configuration,
privacy settings, server management (activate/share/delete). The
ViewModel uses `@MainActor` with proper lifecycle management and
reactive `@Published` properties. Code follows project conventions
including SFSafeSymbols usage and proper memory management.

Error handling improved: deletion failures are now displayed to users in
an alert with the error's localized description, providing better user
feedback compared to the original implementation which silently
suppressed errors with `.cauterize()`.

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



<details>

<summary>Original prompt</summary>

> Migrate ConnectionSettingsViewController to SwiftUI, extract business
logic to a separate viewModel


</details>



<!-- 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>
2025-11-12 17:59:44 +00:00