Commit Graph

16 Commits

Author SHA1 Message Date
Copilot
aae751f4b2 Fix macOS menu bar text not updating after connection loss (#4106) 2026-01-12 23:49:32 +01:00
Copilot
8d818d2276 Add Command+F search functionality to WebViewController (#4102)
## Summary
Implements native web content search using WKWebView's find interaction
API (iOS 16+). Pressing Command+F on macCatalyst now opens the standard
iOS find panel with search, navigation, and match highlighting.

**Implementation:**
- Enabled `isFindInteractionEnabled` on WKWebView in `viewDidLoad()`
- Added Command+F key command that calls `showFindInteraction()` to
present find navigator
- Added "Find" menu item to View menu with keyboard shortcut
- Localized in English only (base localization)

**Platform availability:**
- macCatalyst only (keyboard shortcuts conditionally compiled)
- iOS 16.0+ (graceful fallback for older versions)

## Screenshots
N/A - Uses native iOS system UI

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

## Any other notes
Leverages Apple's native find interaction rather than implementing
custom search UI. The find panel, keyboard navigation, match counting,
and accessibility support are all provided by the system.

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



<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> Implement "search content" feature (aka command + F) to
WebViewController


</details>



<!-- 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>
2025-12-17 11:28:16 +00:00
Bruno Pantaleão Gonçalves
972201a3da Use Swift generated assets for colors instead of using SwiftGen (#3587) 2025-05-08 21:19:04 +02:00
Bruno Pantaleão Gonçalves
13ac4e4a87 Making API connection optional given activeURL is now optional as well (#3169)
<!-- 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. -->
2024-11-18 15:07:18 +01:00
Michal Šrůtek
08781c19f0 Remove default options parameter (#2621)
<!-- 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 removes the `options` parameters which use the default value.

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

<img width="1014" alt="Screenshot 2024-03-03 at 21 17 55"
src="https://github.com/home-assistant/iOS/assets/35694712/85324caf-c36d-4366-a9f8-9c349192a361">
<img width="1049" alt="Screenshot 2024-03-03 at 21 17 17"
src="https://github.com/home-assistant/iOS/assets/35694712/cebddbe6-8ea4-415e-b12a-0e35f86bf5a3">
<img width="1022" alt="Screenshot 2024-03-03 at 21 16 53"
src="https://github.com/home-assistant/iOS/assets/35694712/ccccb902-9791-42f6-8868-5900093c40ae">
<img width="991" alt="Screenshot 2024-03-03 at 21 16 28"
src="https://github.com/home-assistant/iOS/assets/35694712/f2f33685-a55c-47ed-a555-8cc0fc1561ce">
<img width="1329" alt="Screenshot 2024-03-03 at 21 16 00"
src="https://github.com/home-assistant/iOS/assets/35694712/2dc156da-29d6-44e4-a064-4fbdb79139bd">
<img width="1130" alt="Screenshot 2024-03-03 at 21 14 53"
src="https://github.com/home-assistant/iOS/assets/35694712/628dd2ff-5bba-4ee7-912b-cdbdf73f18b2">
2024-03-04 09:28:53 +01:00
Bruno Pantaleão Gonçalves
e9c85b3f7a Drop iOS 12, 13 and 14 support (#2469)
<!-- 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 -->
Drop support for iOS 12 and 13.

## 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. -->
2023-12-27 16:50:11 +01:00
Bruno Pantaleão Gonçalves
65244eb4c8 Fix mac reference to asset, move design system folder to shared and fix color init reference passing bundle (#2468)
<!-- 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 -->
Fix mac reference to asset, move design system folder to shared and fix
color init reference passing bundle
## 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. -->
2023-12-04 14:55:56 +00:00
Bruno Pantaleão Gonçalves
9f9179178c Thread credentials sharing (#2456) 2023-12-04 07:18:41 -03:00
Zac West
5c104f76e9 Multi-server (#1906)
## Summary
Most, but not all, of the changes necessary to support multi-server throughout the app and all its features.

## Screenshots
| Light | Dark |
| ----- | ---- |
| ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 52 24](https://user-images.githubusercontent.com/74188/143670011-9b9905ac-1b5b-4a82-b9f3-1490465c4ec5.png) | ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 52 26](https://user-images.githubusercontent.com/74188/143670012-0080230a-8f68-4f34-9691-db9f5e825a83.png) |
| ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 52 30](https://user-images.githubusercontent.com/74188/143670015-ceeac558-e039-4639-a186-b5001ab418b8.png) | ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 52 29](https://user-images.githubusercontent.com/74188/143670016-d72bb69d-83f5-4197-a742-59d208467258.png) |
| ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 52 47](https://user-images.githubusercontent.com/74188/143670021-6c90c40f-c2f1-4a33-aad9-da6626e99d9d.png) | ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 52 45](https://user-images.githubusercontent.com/74188/143670024-e99de69d-61d8-4e12-be73-a172242806a0.png) |
| ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 53 05](https://user-images.githubusercontent.com/74188/143670033-1a41ac7e-d4d1-458b-974e-2efdaf8e2288.png) | ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 53 03](https://user-images.githubusercontent.com/74188/143670049-baf4db64-64db-4bfb-88cf-4930f9e5661b.png) |
| ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 53 21](https://user-images.githubusercontent.com/74188/143670053-7ec794f1-857c-4ef6-a92a-5318e90ac6b6.png) | ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 53 19](https://user-images.githubusercontent.com/74188/143670056-a6a5207c-3bba-49fc-b5c6-fc6fa8141f9c.png) |

## Any other notes
- Encapsulates all connectivity, token & server-specific knowledge in a Server model object which gets passed around.
- Updates various places throughout the app to know about and use Server rather than accessing said information through non-server-specific methods.
- Visually requests/notes server in places where it's ambiguous. For example, the Open Page widget will gain a subtitle if multiple servers are set up.
- Allows switching which server is shown in the WebViews. Note that this doesn't take into account multi-window support on iPad/macOS yet.

Most things will migrate successfully however adding an additional server causes things like Shortcuts to start erroring requiring you specify which to use in the particular Shortcut.

Future work necessary:
- Model objects currently clobber each other if their identifiers match. For example, both servers having a zone named `home` means one of them wins the fight for which is known to the app.
- Being remotely logged out on any account causes the app to require onboarding again, when instead it should only do that if the last known server is logged out.
2021-11-27 12:33:46 -08:00
Zac West
d3cd7f492c Add live-updating menu bar text template (#1529)
## Summary
Adds title configuration and template editing, based on the section used for editing complication templates. Whenever the subscription updates the text, we immediately update the status item.

## Screenshots
<img width="728" alt="image" src="https://user-images.githubusercontent.com/74188/110993976-ea70e900-832c-11eb-8476-454fb77a1981.png">
<img width="728" alt="image" src="https://user-images.githubusercontent.com/74188/110993710-7c2c2680-832c-11eb-8b35-50c72c9c23cc.png">
<img width="367" alt="image" src="https://user-images.githubusercontent.com/74188/110993728-851cf800-832c-11eb-885d-1787a2e5443b.png">
2021-03-12 12:47:47 -08:00
Zac West
15c32431af Fix Preferences… not showing up on macOS 11.3 (#1509)
## Summary
Another macOS 11.3-ism, it appears to already have created a `.preferences` menu and doesn't at all like inserting another one.

## Any other notes
This also resolves some issues I was ignoring where it would complain about menu changes via insert rather than replace in some cases. I'm guessing 11.3 is more sensitive about these things now.
2021-03-05 09:34:33 -08:00
Zac West
640cca884b Add SwiftFormat to project (#1463)
Adds new fastlane lanes:
- `fastlane lint` which checks the linters
- `fastlane autocorrect` which applies the linters which can autocorrect (Rubocop, SwiftFormat)

Adds a build step to the Codegen abstract target which runs SwiftFormat in lint mode, pointing out what it's going to change when run.

Applies SwiftFormat to nearly all code -- exempts a few externally-sourced files and generated code.
2021-02-05 22:06:25 -08:00
Zac West
194cc154a7 Add menu to status item on right-click (#1420)
## Summary
Adds a basic menu structure to the status item. This includes:

- Toggling the app (e.g. activate or deactivate)
- Performing actions
- Opening About, Checking for Updates, opening Preferences and Quitting

## Screenshots
<img width="259" alt="Screen Shot 2021-01-24 at 22 51 24" src="https://user-images.githubusercontent.com/74188/105670916-b59cf580-5e96-11eb-9143-19ac5d4af92c.png"><img width="260" alt="Screen Shot 2021-01-24 at 22 51 16" src="https://user-images.githubusercontent.com/74188/105670921-b6ce2280-5e96-11eb-9c25-eddf4bb7ae12.png">

## Any other notes
There's not a clean way to do the left/right click handling. There's a few ways, all with their own pluses and negatives:
- Calling `popUpMenu(_:)` programmatically works, but it's marked as deprecated and it's tough to get Swift to not care.
- Handling `menuWillOpen` to instead do the left-click behavior and abort the menu display.
2021-01-25 15:26:56 -08:00
Zac West
d8355646a9 Allow showing in the menu bar, either additionally or exclusively (#1385)
Fixes #949 (the menu bar part).

## Summary
Allows configuring 2 potentially-mutually-exclusive things: whether to show the app in the dock, and whether to show a status item in the menu bar. Wraps them into one setting.

## Screenshots
<img width="400" alt="Screen Shot 2021-01-17 at 20 55 54" src="https://user-images.githubusercontent.com/74188/104874016-b833a400-5906-11eb-9269-4f65f6327173.png"><img width="400" alt="Screen Shot 2021-01-17 at 20 56 03" src="https://user-images.githubusercontent.com/74188/104874022-b964d100-5906-11eb-86b6-bc8836893638.png">
<img width="400" alt="Screen Shot 2021-01-17 at 20 56 19" src="https://user-images.githubusercontent.com/74188/104874044-cd103780-5906-11eb-9d83-19a2831fd859.png"><img width="400" alt="Screen Shot 2021-01-17 at 20 56 26" src="https://user-images.githubusercontent.com/74188/104874045-ce416480-5906-11eb-8b01-d22cf8b823c8.png">

Worth noting there seem to be something like 16 different permutations for the look of the menu bar. Here's some more!

<img width="311" alt="image" src="https://user-images.githubusercontent.com/74188/104874449-db128800-5907-11eb-851f-9b3383225dd3.png"><img width="442" alt="image" src="https://user-images.githubusercontent.com/74188/104874474-e8c80d80-5907-11eb-963f-a7ec2d28802d.png">

## Any other notes
- Positions the status item handling (routed through the Mac Bridge) in the same place that we handle menus on Catalyst, since the ultimate fate of the status item will be offering menus of some sort.
- Clicking on the status item hides or shows the app, depending on the current state. Effectively acts like a toggle. If there are no windows open when the app needs to be activated, creates a new webview window.
- Doesn't allow disabling both the menu bar item and the dock item, since the app isn't really set up for success with that.
2021-01-18 10:09:54 -08:00
Zac West
15462b5557 Hide "Check for Updates…" menu item in App Store build (#1341)
Forgot to hide the item in #1321. Fixes #1338.
2021-01-03 15:00:27 -08:00
Zac West
4d9a530637 Reorganize files in repo, pull out build settings from pbxproj (#1140)
This is somewhat in prep of being able to make the project file generated, but also just organizes things into more concrete directory structures.

This pulls out _all_ of the build settings from the root level, and most from the target level, into xcconfigs.

The new directory structure looks like:

- Sources
  - App
    - (everything from HomeAssistant/)
  - WatchApp
  - Shared
  - MacBridge
  - Extensions
    - Intents
    - NotificationContent
    - NotificationService
    - Share
    - Today
    - Watch
    - Widgets
- Tests
  - App
  - UI
  - Shared

Somewhat intentionally, the file structure under these is not yet standardized/organized.

The project targets are now:

- App
- WatchApp
- Shared-iOS
- Shared-watchOS
- MacBridge
- Tests-App
- Tests-UI
- Tests-Shared
- Extension-Intents
- Extension-NotificationContent
- Extension-NotificationService
- Extension-Share
- Extension-Today
- Extension-Widget
- WatchExtension-Watch

This does not yet clean up resources vs. sources, nor does it handle some of the "it's in Sources/App but it's part of Shared" crossover directory issues.
2020-10-03 00:15:04 -07:00