Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 0 additions & 56 deletions HomeAssistant.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions Sources/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
sceneManager.activateAnyScene(for: .settings)
}

@objc func openActionsPreferences() {
precondition(Current.sceneManager.supportsMultipleScenes)
let delegate: Guarantee<SettingsSceneDelegate> = sceneManager.scene(for: .init(activity: .settings))
delegate.done { $0.pushActions(animated: true) }
}

@objc func openHelp() {
openURLInBrowser(
URL(string: "https://companion.home-assistant.io")!,
Expand Down Expand Up @@ -418,7 +412,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
private func setupModels() {
// Force Realm migration to happen now
_ = Realm.live()
Action.setupObserver()
NotificationCategory.setupObserver()
Comment thread
bgoncal marked this conversation as resolved.
}

Expand Down
6 changes: 0 additions & 6 deletions Sources/App/Scenes/SettingsSceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,4 @@ import UIKit
}
#endif
}

func pushActions(animated: Bool) {
// SwiftUI SettingsView handles navigation internally
// This method is kept for compatibility but no longer does anything
Current.Log.info("pushActions called on SwiftUI SettingsView - navigation handled internally")
}
}
47 changes: 0 additions & 47 deletions Sources/App/Settings/MagicItem/Add/MagicItemAddView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ struct MagicItemAddView: View {
case entities
case scripts
case scenes
case legacyiOSActions
case assistPipelines
}

Expand Down Expand Up @@ -41,7 +40,6 @@ struct MagicItemAddView: View {
options.append(.scripts)
options.append(.scenes)
}
options.append(.legacyiOSActions)
}
if context == .carPlay, #available(iOS 26.0, *) {
options.append(.assistPipelines)
Expand All @@ -54,12 +52,6 @@ struct MagicItemAddView: View {
NavigationView {
Group {
switch viewModel.selectedItemType {
case .actions:
List {
pickerView
actionsList
}
.searchable(text: $viewModel.searchText)
case .entities:
VStack {
pickerView
Expand Down Expand Up @@ -91,7 +83,6 @@ struct MagicItemAddView: View {
}
.onAppear {
autoSelectItemType()
viewModel.loadContent()

if viewModel.selectedServerId == nil {
viewModel.selectedServerId = Current.servers.all.first?.identifier.rawValue
Expand Down Expand Up @@ -127,9 +118,6 @@ struct MagicItemAddView: View {
case .entities:
Text(verbatim: L10n.MagicItem.ItemType.Entity.List.title)
.tag(MagicItemAddType.entities)
case .legacyiOSActions:
Text(verbatim: L10n.MagicItem.ItemType.Action.List.title)
.tag(MagicItemAddType.actions)
case .scripts:
Text(verbatim: L10n.MagicItem.ItemType.Script.List.title)
.tag(MagicItemAddType.scripts)
Expand Down Expand Up @@ -158,35 +146,6 @@ struct MagicItemAddView: View {
}
}

@ViewBuilder
private var actionsList: some View {
actionsDeprecationDisclaimer
ForEach(viewModel.actions, id: \.ID) { action in
if visibleForSearch(title: action.Text, entityId: action.ID) {
Button(action: {
itemToAdd(.init(id: action.ID, serverId: action.serverIdentifier, type: .action))
dismiss()
}, label: {
EntityRowView(optionalTitle: action.Text, accessoryImageSystemSymbol: .plusCircleFill)
})
.tint(Color(uiColor: .label))
}
}
}

private var actionsDeprecationDisclaimer: some View {
Section {
Button {
viewModel.selectedItemType = .scripts
} label: {
Text(verbatim: L10n.MagicItem.ItemType.Action.List.Warning.title)
}
.buttonStyle(.bordered)
.tint(.red)
.listRowBackground(Color.clear)
}
}

@ViewBuilder
private func entitiesPerServerList(domainFilter: Domain? = nil) -> some View {
EntityPicker(
Expand Down Expand Up @@ -219,12 +178,6 @@ struct MagicItemAddView: View {
}
)
}

private func visibleForSearch(title: String, entityId: String) -> Bool {
viewModel.searchText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ||
title.lowercased().contains(viewModel.searchText.lowercased()) ||
entityId.lowercased().contains(viewModel.searchText.lowercased())
}
}

#Preview {
Expand Down
19 changes: 0 additions & 19 deletions Sources/App/Settings/MagicItem/Add/MagicItemAddViewModel.swift
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
import Combine
import Foundation
import GRDB
import HAKit
import PromiseKit
import Shared

enum MagicItemAddType {
case scripts
case actions
case scenes
case entities
case assistPipelines
Comment thread
bgoncal marked this conversation as resolved.
}

final class MagicItemAddViewModel: ObservableObject {
@Published var selectedItemType = MagicItemAddType.scripts
@Published var actions: [Action] = []
@Published var searchText: String = ""
@Published var selectedServerId: String?

@MainActor
func loadContent() {
loadActions()
}

@MainActor
private func loadActions() {
actions = Current.realm().objects(Action.self)
.filter({ $0.Scene == nil })
.sorted(by: { $0.Position < $1.Position })
}
}
51 changes: 0 additions & 51 deletions Sources/App/Settings/Observation/Action+Observation.swift

This file was deleted.

Loading