mirror of
https://github.com/home-assistant/iOS.git
synced 2026-04-12 14:30:51 -05:00
## 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>