Commit Graph

3 Commits

Author SHA1 Message Date
Bruno Pantaleão Gonçalves
8aa807c61c WebView wrapper improvements (#4811)
<!-- 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 -->
- Reduce UIKit usage
- Each server has it's own self-healing webview with connectivity
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. -->

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-06-23 14:39:49 +02:00
Copilot
59aabcef31 Fix themed status-bar/notch color rendering as white after SwiftUI migration (#4761)
## Summary
After the SwiftUI migration (#4748), the themed status-bar bar moved
from a UIKit `statusBarView` to a SwiftUI `themedStatusBar` in
`HomeAssistantView`. The new implementation rendered nothing, exposing
the white window background in the notch/status-bar area instead of the
theme color.

Root cause: the bar was built as

```swift
Color(uiColor: color)
    .frame(maxWidth: .infinity)
    .frame(height: 0)
    .ignoresSafeArea(edges: .top)
```

The rigid `.frame(height: 0)` collapses the colored region to zero
height — `ignoresSafeArea` can't grow a fixed-size frame — so the top
safe-area inset stayed empty and showed white (the web view is inset
below it when the bar is enabled).

Changes (`Sources/App/Frontend/WebView/HomeAssistantView.swift`):
- Draw the theme color as a full-bleed
`Color(uiColor:).ignoresSafeArea()` layer applied via
`.background(themedStatusBar)` instead of a zero-height `.overlay`. The
opaque, top-inset web view covers everything below the status bar, so
only the top inset shows the color.
- Behavior unchanged for edge-to-edge/full-screen (`statusBarColor ==
nil` → no bar) and empty-state overlays (respect the safe area, so the
themed inset still shows).

## 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
Documentation: home-assistant/companion.home-assistant#

## Any other notes
Verified on Linux without Xcode, so the iOS target was not compiled; the
change is confined to SwiftUI status-bar rendering.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-06-17 15:15:23 +00:00
Bruno Pantaleão Gonçalves
6e84ff4cb6 Migrate app from UIKit based app to SwiftUI (#4748)
<!-- 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 -->
This PR is a massive refactor of how the app handles UI presentation and
navigation, goin from the UIKit based apps style to SwiftUI.

## 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: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 10:33:17 +02:00