diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0098963..8fa865a 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -138,4 +138,4 @@ jobs: with: coveragereports: 'SpeziLLM-iOS.xcresult SpeziLLM-visionOS.xcresult SpeziLLM-macOS.xcresult TestApp-iOS.xcresult TestApp-iPad.xcresult TestApp-visionOS.xcresult' secrets: - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/Package.swift b/Package.swift index f623f23..b285f1b 100644 --- a/Package.swift +++ b/Package.swift @@ -30,10 +30,10 @@ let package = Package( .package(url: "https://github.com/StanfordBDHG/OpenAI", .upToNextMinor(from: "0.2.9")), .package(url: "https://github.com/StanfordBDHG/llama.cpp", .upToNextMinor(from: "0.3.3")), .package(url: "https://github.com/StanfordSpezi/Spezi", from: "1.2.1"), - .package(url: "https://github.com/StanfordSpezi/SpeziFoundation", from: "1.0.4"), + .package(url: "https://github.com/StanfordSpezi/SpeziFoundation", from: "2.0.0-beta.3"), .package(url: "https://github.com/StanfordSpezi/SpeziStorage", from: "1.0.2"), .package(url: "https://github.com/StanfordSpezi/SpeziOnboarding", from: "1.1.1"), - .package(url: "https://github.com/StanfordSpezi/SpeziChat", .upToNextMinor(from: "0.2.0")), + .package(url: "https://github.com/StanfordSpezi/SpeziChat", .upToNextMinor(from: "0.2.1")), .package(url: "https://github.com/StanfordSpezi/SpeziViews", from: "1.3.1") ], targets: [ diff --git a/Tests/UITests/TestApp/LLMFog/Account/AccountSheet.swift b/Tests/UITests/TestApp/LLMFog/Account/AccountSheet.swift index 16740a2..dcf8c19 100644 --- a/Tests/UITests/TestApp/LLMFog/Account/AccountSheet.swift +++ b/Tests/UITests/TestApp/LLMFog/Account/AccountSheet.swift @@ -18,47 +18,22 @@ struct AccountSheet: View { @Environment(\.accountRequired) var accountRequired @State var isInSetup = false - @State var overviewIsEditing = false var body: some View { NavigationStack { ZStack { if account.signedIn && !isInSetup { - AccountOverview(isEditing: $overviewIsEditing) - .onDisappear { - overviewIsEditing = false - } - .toolbar { - if !overviewIsEditing { - closeButton - } - } + AccountOverview(close: .showCloseButton) } else { AccountSetup { _ in dismiss() // we just signed in, dismiss the account setup sheet } header: { AccountSetupHeader() } - .onAppear { - isInSetup = true - } - .toolbar { - if !accountRequired { - closeButton - } - } } } } } - - var closeButton: some ToolbarContent { - ToolbarItem(placement: .cancellationAction) { - Button("CLOSE") { - dismiss() - } - } - } } #endif diff --git a/Tests/UITests/TestApp/LLMFog/LLMFogChatTestView.swift b/Tests/UITests/TestApp/LLMFog/LLMFogChatTestView.swift index afd1ae7..0f7f9c2 100644 --- a/Tests/UITests/TestApp/LLMFog/LLMFogChatTestView.swift +++ b/Tests/UITests/TestApp/LLMFog/LLMFogChatTestView.swift @@ -55,7 +55,6 @@ struct LLMFogChatTestView: View { .accountRequired { AccountSheet() } - .verifyRequiredAccountDetails() #endif .accentColor(.orange) // Fog Orange } diff --git a/Tests/UITests/TestApp/Resources/Localizable.xcstrings b/Tests/UITests/TestApp/Resources/Localizable.xcstrings index a1e70b6..f73edbb 100644 --- a/Tests/UITests/TestApp/Resources/Localizable.xcstrings +++ b/Tests/UITests/TestApp/Resources/Localizable.xcstrings @@ -41,16 +41,6 @@ } } }, - "CLOSE" : { - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Close" - } - } - } - }, "LLM_DOWNLOAD_DESCRIPTION" : { "localizations" : { "en" : { diff --git a/Tests/UITests/TestApp/TestAppDelegate.swift b/Tests/UITests/TestApp/TestAppDelegate.swift index 0b86691..2f4d84a 100644 --- a/Tests/UITests/TestApp/TestAppDelegate.swift +++ b/Tests/UITests/TestApp/TestAppDelegate.swift @@ -9,8 +9,10 @@ import Foundation import Spezi #if os(iOS) +import FirebaseFirestore import SpeziAccount import SpeziFirebaseAccount +import SpeziFirebaseAccountStorage #endif import SpeziLLM import SpeziLLMFog @@ -33,14 +35,12 @@ class TestAppDelegate: SpeziAppDelegate { Configuration { // As SpeziAccount, SpeziFirebase and the firebase-ios-sdk currently don't support visionOS and macOS, perform fog node token authentication only on iOS #if os(iOS) - AccountConfiguration(configuration: [ - .requires(\.userId), - .requires(\.password) - ]) - - FirebaseAccountConfiguration( - authenticationMethods: .emailAndPassword, - emulatorSettings: (host: "localhost", port: 9099) // Use Firebase emulator for development purposes + AccountConfiguration( + service: FirebaseAccountService(providers: [.emailAndPassword], emulatorSettings: (host: "localhost", port: 9099)), + storageProvider: FirestoreAccountStorage(storeIn: Firestore.firestore().collection("users")), + configuration: [ + .requires(\.userId) + ] ) #endif diff --git a/Tests/UITests/TestAppUITests/TestAppLLMLocalUITests.swift b/Tests/UITests/TestAppUITests/TestAppLLMLocalUITests.swift index 6b75e69..d089935 100644 --- a/Tests/UITests/TestAppUITests/TestAppLLMLocalUITests.swift +++ b/Tests/UITests/TestAppUITests/TestAppLLMLocalUITests.swift @@ -44,9 +44,9 @@ class TestAppLLMLocalUITests: XCTestCase { // Chat #if !os(macOS) - try app.textViews["Message Input Textfield"].enter(value: "New Message!", dismissKeyboard: false) + try app.textViews["Message Input Textfield"].enter(value: "New Message!", options: [.disableKeyboardDismiss]) #else - try app.textFields["Message Input Textfield"].enter(value: "New Message!", dismissKeyboard: false) + try app.textFields["Message Input Textfield"].enter(value: "New Message!", options: [.disableKeyboardDismiss]) #endif XCTAssert(app.buttons["Send Message"].waitForExistence(timeout: 2)) diff --git a/Tests/UITests/TestAppUITests/TestAppLLMOpenAIUITests.swift b/Tests/UITests/TestAppUITests/TestAppLLMOpenAIUITests.swift index 1781f10..134ad9e 100644 --- a/Tests/UITests/TestAppUITests/TestAppLLMOpenAIUITests.swift +++ b/Tests/UITests/TestAppUITests/TestAppLLMOpenAIUITests.swift @@ -151,9 +151,9 @@ class TestAppLLMOpenAIUITests: XCTestCase { XCTAssert(app.buttons["Record Message"].isEnabled) #if !os(macOS) - try app.textViews["Message Input Textfield"].enter(value: "New Message!", dismissKeyboard: false) + try app.textViews["Message Input Textfield"].enter(value: "New Message!", options: [.disableKeyboardDismiss]) #else - try app.textFields["Message Input Textfield"].enter(value: "New Message!", dismissKeyboard: false) + try app.textFields["Message Input Textfield"].enter(value: "New Message!", options: [.disableKeyboardDismiss]) #endif XCTAssert(app.buttons["Send Message"].waitForExistence(timeout: 2)) diff --git a/Tests/UITests/UITests.xcodeproj/project.pbxproj b/Tests/UITests/UITests.xcodeproj/project.pbxproj index 7a794d0..e271b19 100644 --- a/Tests/UITests/UITests.xcodeproj/project.pbxproj +++ b/Tests/UITests/UITests.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 2F6D139A28F5F386007C25D6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2F6D139928F5F386007C25D6 /* Assets.xcassets */; }; 2F8A431329130A8C005D2B8F /* TestAppLLMOpenAIUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F8A431229130A8C005D2B8F /* TestAppLLMOpenAIUITests.swift */; }; 2FA7382C290ADFAA007ACEB9 /* TestApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FA7382B290ADFAA007ACEB9 /* TestApp.swift */; }; + 2FAD21CB2CBDC82500C9665B /* SpeziFirebaseAccountStorage in Frameworks */ = {isa = PBXBuildFile; platformFilter = ios; productRef = 2FAD21CA2CBDC82500C9665B /* SpeziFirebaseAccountStorage */; }; 2FD590522A19E9F000153BE4 /* XCTestExtensions in Frameworks */ = {isa = PBXBuildFile; productRef = 2FD590512A19E9F000153BE4 /* XCTestExtensions */; }; 63EF9CF02BA7398C001D92D7 /* TestAppTestingSetup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63EF9CEF2BA7398C001D92D7 /* TestAppTestingSetup.swift */; }; 9722A5A02B5B5CB20005645E /* SpeziLLM in Frameworks */ = {isa = PBXBuildFile; productRef = 9722A59F2B5B5CB20005645E /* SpeziLLM */; }; @@ -96,6 +97,7 @@ buildActionMask = 2147483647; files = ( 9722A5A02B5B5CB20005645E /* SpeziLLM in Frameworks */, + 2FAD21CB2CBDC82500C9665B /* SpeziFirebaseAccountStorage in Frameworks */, 9770F2912BB3C40C00478571 /* SpeziFirebaseAccount in Frameworks */, 97A36E152B999EA60034D821 /* SpeziLLMFog in Frameworks */, 9722A5A22B5B5CB20005645E /* SpeziLLMLocal in Frameworks */, @@ -284,6 +286,7 @@ 97A36E142B999EA60034D821 /* SpeziLLMFog */, 9770F2902BB3C40C00478571 /* SpeziFirebaseAccount */, 979D418F2BB3EBD8001953BD /* SpeziAccount */, + 2FAD21CA2CBDC82500C9665B /* SpeziFirebaseAccountStorage */, ); productName = Example; productReference = 2F6D139228F5F384007C25D6 /* TestApp.app */; @@ -318,7 +321,7 @@ attributes = { BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1410; - LastUpgradeCheck = 1510; + LastUpgradeCheck = 1600; TargetAttributes = { 2F6D139128F5F384007C25D6 = { CreatedOnToolsVersion = 14.1; @@ -599,6 +602,8 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_INTEROP_MODE = objcxx; SWIFT_STRICT_CONCURRENCY = complete; @@ -640,6 +645,8 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_INTEROP_MODE = objcxx; SWIFT_STRICT_CONCURRENCY = complete; @@ -651,7 +658,6 @@ 2F6D13BD28F5F386007C25D6 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 637867499T; @@ -673,7 +679,6 @@ 2F6D13BE28F5F386007C25D6 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 637867499T; @@ -729,29 +734,34 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/StanfordBDHG/XCTestExtensions.git"; requirement = { - kind = upToNextMinorVersion; - minimumVersion = 0.4.13; + kind = upToNextMajorVersion; + minimumVersion = 1.0.0; }; }; 9770F28F2BB3C40C00478571 /* XCRemoteSwiftPackageReference "SpeziFirebase" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/StanfordSpezi/SpeziFirebase"; requirement = { - kind = upToNextMinorVersion; - minimumVersion = 1.0.1; + kind = upToNextMajorVersion; + minimumVersion = "2.0.0-beta.4"; }; }; 979D418E2BB3EBD8001953BD /* XCRemoteSwiftPackageReference "SpeziAccount" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/StanfordSpezi/SpeziAccount"; requirement = { - kind = upToNextMinorVersion; - minimumVersion = 1.2.1; + kind = upToNextMajorVersion; + minimumVersion = "2.0.0-beta.8"; }; }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ + 2FAD21CA2CBDC82500C9665B /* SpeziFirebaseAccountStorage */ = { + isa = XCSwiftPackageProductDependency; + package = 9770F28F2BB3C40C00478571 /* XCRemoteSwiftPackageReference "SpeziFirebase" */; + productName = SpeziFirebaseAccountStorage; + }; 2FD590512A19E9F000153BE4 /* XCTestExtensions */ = { isa = XCSwiftPackageProductDependency; package = 2FD590502A19E9F000153BE4 /* XCRemoteSwiftPackageReference "XCTestExtensions" */; diff --git a/Tests/UITests/UITests.xcodeproj/xcshareddata/xcschemes/TestApp.xcscheme b/Tests/UITests/UITests.xcodeproj/xcshareddata/xcschemes/TestApp.xcscheme index 64ae972..7392fb2 100644 --- a/Tests/UITests/UITests.xcodeproj/xcshareddata/xcschemes/TestApp.xcscheme +++ b/Tests/UITests/UITests.xcodeproj/xcshareddata/xcschemes/TestApp.xcscheme @@ -1,6 +1,6 @@