Migrate from iOS 17 Observation to iOS 16-compatible Combine architecture.

Lower deployment target to iOS 16, replace @Observable with ObservableObject, add navigation and UI compatibility shims, and include login smoke UI tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-26 10:16:35 +08:00
parent c32a610ee0
commit 26f4d0e671
127 changed files with 2320 additions and 1465 deletions

View File

@ -14,14 +14,14 @@ import UIKit
///
struct CloudStorageView: View {
@Environment(AccountContext.self) private var accountContext
@Environment(AssetsAPI.self) private var assetsAPI
@Environment(OSSUploadService.self) private var uploadService
@Environment(RouterPath.self) private var router
@Environment(ToastCenter.self) private var toastCenter
@EnvironmentObject private var accountContext: AccountContext
@Environment(\.assetsAPI) private var assetsAPI
@Environment(\.ossUploadService) private var uploadService
@EnvironmentObject private var router: RouterPath
@EnvironmentObject private var toastCenter: ToastCenter
@Environment(\.globalLoading) private var globalLoading
@State private var viewModel = CloudStorageViewModel()
@StateObject private var viewModel = CloudStorageViewModel()
@State private var transferStore = CloudTransferStore.shared
@State private var selectedItems: [PhotosPickerItem] = []
@State private var actionItem: CloudDriveFile?
@ -70,7 +70,7 @@ struct CloudStorageView: View {
guard viewModel.files.isEmpty else { return }
await reload(showLoading: true)
}
.onChange(of: selectedItems) { _, items in
.onChange(of: selectedItems) { items in
Task { await upload(items) }
}
.confirmationDialog("文件操作", isPresented: actionDialogBinding, presenting: actionItem) { item in
@ -176,7 +176,7 @@ struct CloudStorageView: View {
}
}
.pickerStyle(.segmented)
.onChange(of: viewModel.selectedFilter) { _, _ in
.onChange(of: viewModel.selectedFilter) { _ in
Task { await reload(showLoading: true) }
}
@ -186,7 +186,7 @@ struct CloudStorageView: View {
}
}
.pickerStyle(.segmented)
.onChange(of: viewModel.selectedSort) { _, _ in
.onChange(of: viewModel.selectedSort) { _ in
Task { await reload(showLoading: true) }
}
}