rc/android-ios-parity #1

Merged
admin merged 81 commits from rc/android-ios-parity into master 2026-04-20 19:43:34 -05:00
Showing only changes of commit f56d854acc - Show all commits

View File

@@ -0,0 +1,31 @@
import SwiftUI
import ComposeApp
/// SwiftUI `@Environment` mirror of Compose's `LocalDataManager` ambient.
///
/// Production views resolve `@Environment(\.dataManager)` to
/// `DataManagerObservable.shared` the existing Swift-side mirror of the
/// shared Kotlin `DataManager` singleton. Tests, previews, and the
/// parity-gallery override via:
///
/// ```swift
/// MyView()
/// .environment(\.dataManager, FakeDataManagerObservable())
/// ```
///
/// This key is intentionally introduced without migrating any SwiftUI
/// screens yet. Views continue to access `DataManagerObservable.shared`
/// directly; the actual view-level migration lands when parity-gallery
/// fixtures arrive (P1), at which point ViewModels will gain an optional
/// init param that accepts a `DataManagerObservable` resolved from this
/// environment key.
struct DataManagerEnvironmentKey: EnvironmentKey {
static let defaultValue: DataManagerObservable = DataManagerObservable.shared
}
extension EnvironmentValues {
var dataManager: DataManagerObservable {
get { self[DataManagerEnvironmentKey.self] }
set { self[DataManagerEnvironmentKey.self] = newValue }
}
}