Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637import Foundation
struct SettingsControl: Hashable, Identifiable, Sendable { let id: String let section: SettingsSection let searchText: SettingsSearchText
init(_ id: String, section: SettingsSection, title: String, help: String = "", synonyms: [String] = []) { self.id = id self.section = section searchText = SettingsSearchText(title: title, help: help, synonyms: synonyms) }
var title: String { searchText.title }
func scoped(to section: SettingsSection) -> Self { guard self.section != section else { return self } return Self( "\(section.rawValue).\(id)", section: section, title: title, help: searchText.help, synonyms: searchText.synonyms) }}
@MainActorprotocol SearchableSettingsPane { static var searchControls: [SettingsControl] { get }}
extension SearchableSettingsPane { static func control(_ id: String) -> SettingsControl { guard let control = searchControls.first(where: { $0.id == id }) else { preconditionFailure("Missing settings control: \(id)") } return control }}