From 14a4ab585e520d3e0de0250afe188e4f38be0e4d Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 14 Mar 2024 16:46:49 +0000 Subject: [PATCH 1/5] Add confirmation that the user would like to discard unsaved changes. --- .../RoomChangePermissionsScreenModels.swift | 4 ++++ .../RoomChangePermissionsScreenViewModel.swift | 10 ++++++++++ .../View/RoomChangePermissionsScreen.swift | 9 +++++++++ .../RoomChangeRolesScreenModels.swift | 4 ++++ .../RoomChangeRolesScreenViewModel.swift | 10 ++++++++++ .../View/RoomChangeRolesScreen.swift | 8 ++++++++ 6 files changed, 45 insertions(+) diff --git a/ElementX/Sources/Screens/RoomChangePermissionsScreen/RoomChangePermissionsScreenModels.swift b/ElementX/Sources/Screens/RoomChangePermissionsScreen/RoomChangePermissionsScreenModels.swift index 8351798405..24a3d56873 100644 --- a/ElementX/Sources/Screens/RoomChangePermissionsScreen/RoomChangePermissionsScreenModels.swift +++ b/ElementX/Sources/Screens/RoomChangePermissionsScreen/RoomChangePermissionsScreenModels.swift @@ -43,6 +43,8 @@ struct RoomChangePermissionsScreenViewStateBindings: BindableState { } enum RoomChangePermissionsScreenAlertType { + /// A confirmation that the user would like to discard any unsaved changes. + case discardChanges /// The generic error message. case generic } @@ -50,6 +52,8 @@ enum RoomChangePermissionsScreenAlertType { enum RoomChangePermissionsScreenViewAction { /// Save the permissions. case save + /// Discard any changes and hide the screen. + case cancel } extension RoomChangePermissionsScreenViewState { diff --git a/ElementX/Sources/Screens/RoomChangePermissionsScreen/RoomChangePermissionsScreenViewModel.swift b/ElementX/Sources/Screens/RoomChangePermissionsScreen/RoomChangePermissionsScreenViewModel.swift index f5751d01c7..b377cf922f 100644 --- a/ElementX/Sources/Screens/RoomChangePermissionsScreen/RoomChangePermissionsScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomChangePermissionsScreen/RoomChangePermissionsScreenViewModel.swift @@ -49,6 +49,8 @@ class RoomChangePermissionsScreenViewModel: RoomChangePermissionsScreenViewModel switch viewAction { case .save: Task { await save() } + case .cancel: + confirmDiscardChanges() } } @@ -83,6 +85,14 @@ class RoomChangePermissionsScreenViewModel: RoomChangePermissionsScreenViewModel } } + private func confirmDiscardChanges() { + state.bindings.alertInfo = AlertInfo(id: .discardChanges, + title: L10n.screenRoomChangeRoleUnsavedChangesTitle, + message: L10n.screenRoomChangeRoleUnsavedChangesDescription, + primaryButton: .init(title: L10n.actionSave) { Task { await self.save() } }, + secondaryButton: .init(title: L10n.actionDiscard, role: .cancel) { self.actionsSubject.send(.complete) }) + } + // MARK: Loading indicator private static let indicatorID = "SavingRoomPermissions" diff --git a/ElementX/Sources/Screens/RoomChangePermissionsScreen/View/RoomChangePermissionsScreen.swift b/ElementX/Sources/Screens/RoomChangePermissionsScreen/View/RoomChangePermissionsScreen.swift index a3a0203b31..6cab5e0863 100644 --- a/ElementX/Sources/Screens/RoomChangePermissionsScreen/View/RoomChangePermissionsScreen.swift +++ b/ElementX/Sources/Screens/RoomChangePermissionsScreen/View/RoomChangePermissionsScreen.swift @@ -35,6 +35,7 @@ struct RoomChangePermissionsScreen: View { .compoundList() .navigationTitle(context.viewState.title) .navigationBarTitleDisplayMode(.inline) + .navigationBarBackButtonHidden(context.viewState.hasChanges) .toolbar { toolbar } .alert(item: $context.alertInfo) } @@ -47,6 +48,14 @@ struct RoomChangePermissionsScreen: View { } .disabled(!context.viewState.hasChanges) } + + if context.viewState.hasChanges { + ToolbarItem(placement: .cancellationAction) { + Button(L10n.actionCancel) { + context.send(viewAction: .cancel) + } + } + } } } diff --git a/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenModels.swift b/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenModels.swift index 76a710a4a0..54327bacbf 100644 --- a/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenModels.swift +++ b/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenModels.swift @@ -89,6 +89,8 @@ struct RoomChangeRolesScreenViewStateBindings { enum RoomChangeRolesScreenAlertType { /// A warning that a particular promotion can't be undone. case promotionWarning + /// A confirmation that the user would like to discard any unsaved changes. + case discardChanges /// The generic error message. case error } @@ -100,4 +102,6 @@ enum RoomChangeRolesScreenViewAction { case demoteMember(RoomMemberDetails) /// Save all the changes that the user has made. case save + /// Discard any changes and hide the screen. + case cancel } diff --git a/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenViewModel.swift b/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenViewModel.swift index d35ffdb1f2..9c169aadef 100644 --- a/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenViewModel.swift @@ -74,6 +74,8 @@ class RoomChangeRolesScreenViewModel: RoomChangeRolesScreenViewModelType, RoomCh } else { Task { await save() } } + case .cancel: + confirmDiscardChanges() } } @@ -148,6 +150,14 @@ class RoomChangeRolesScreenViewModel: RoomChangeRolesScreenViewModelType, RoomCh } } + private func confirmDiscardChanges() { + state.bindings.alertInfo = AlertInfo(id: .discardChanges, + title: L10n.screenRoomChangeRoleUnsavedChangesTitle, + message: L10n.screenRoomChangeRoleUnsavedChangesDescription, + primaryButton: .init(title: L10n.actionSave) { Task { await self.save() } }, + secondaryButton: .init(title: L10n.actionDiscard, role: .cancel) { self.actionsSubject.send(.complete) }) + } + // MARK: Loading indicator private static let indicatorID = "SavingRoomRoles" diff --git a/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreen.swift b/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreen.swift index 9194588b17..13bf4eed9a 100644 --- a/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreen.swift +++ b/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreen.swift @@ -123,6 +123,14 @@ struct RoomChangeRolesScreen: View { } .disabled(!context.viewState.hasChanges) } + + if context.viewState.hasChanges { + ToolbarItem(placement: .cancellationAction) { + Button(L10n.actionCancel) { + context.send(viewAction: .cancel) + } + } + } } } From dd632750470e90827dcf00607184c9f14c9d158d Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 14 Mar 2024 16:54:35 +0000 Subject: [PATCH 2/5] Update string on permissions screen. --- ElementX/Resources/Localizations/en.lproj/Localizable.strings | 2 +- ElementX/Sources/Generated/Strings.swift | 2 +- ...hangePermissionsScreen-iPad-en-GB.Messages-and-Content.png | 4 ++-- ...angePermissionsScreen-iPad-pseudo.Messages-and-Content.png | 4 ++-- ...PermissionsScreen-iPhone-15-en-GB.Messages-and-Content.png | 4 ++-- ...ermissionsScreen-iPhone-15-pseudo.Messages-and-Content.png | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index a08118ab3e..55794b14fe 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -499,7 +499,7 @@ "screen_room_attachment_text_formatting" = "Text Formatting"; "screen_room_change_permissions_administrators" = "Admins only"; "screen_room_change_permissions_ban_people" = "Ban people"; -"screen_room_change_permissions_delete_messages" = "Delete messages"; +"screen_room_change_permissions_delete_messages" = "Remove messages"; "screen_room_change_permissions_invite_people" = "Invite people"; "screen_room_change_permissions_moderators" = "Admins and moderators"; "screen_room_change_permissions_remove_people" = "Remove people"; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index 4638d9ffd4..c84393abd9 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -1215,7 +1215,7 @@ internal enum L10n { internal static var screenRoomChangePermissionsAdministrators: String { return L10n.tr("Localizable", "screen_room_change_permissions_administrators") } /// Ban people internal static var screenRoomChangePermissionsBanPeople: String { return L10n.tr("Localizable", "screen_room_change_permissions_ban_people") } - /// Delete messages + /// Remove messages internal static var screenRoomChangePermissionsDeleteMessages: String { return L10n.tr("Localizable", "screen_room_change_permissions_delete_messages") } /// Everyone internal static var screenRoomChangePermissionsEveryone: String { return L10n.tr("Localizable", "screen_room_change_permissions_everyone") } diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPad-en-GB.Messages-and-Content.png b/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPad-en-GB.Messages-and-Content.png index f215553b22..d1a1d3ac2e 100644 --- a/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPad-en-GB.Messages-and-Content.png +++ b/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPad-en-GB.Messages-and-Content.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a65b0ae7ecaf2479ca6615154b59c613bb7c0a0c457c0660a285285732b8f6d -size 157299 +oid sha256:88fd16ff426bf0a0d611aac81f9f7a7b0e88051ca992a0ce0d6a268e53cdd10d +size 158559 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPad-pseudo.Messages-and-Content.png b/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPad-pseudo.Messages-and-Content.png index b28e3e0ee7..b3124a07c0 100644 --- a/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPad-pseudo.Messages-and-Content.png +++ b/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPad-pseudo.Messages-and-Content.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e6f9ff85795b3adf88a5aa68a1c3fc38f38e5520c7996f105d4616bddcf0799d -size 213902 +oid sha256:b8503be3cd71675cc2b9014ca2aed33fac140fdeb14b060b86847e9ca7ed8b15 +size 215884 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPhone-15-en-GB.Messages-and-Content.png b/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPhone-15-en-GB.Messages-and-Content.png index 5441041d6f..9c41a5ac7e 100644 --- a/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPhone-15-en-GB.Messages-and-Content.png +++ b/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPhone-15-en-GB.Messages-and-Content.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:77a8e52fa0472c7526891562f29441e932ca9eb12a2a2929875c4cdeb9ccddac -size 105619 +oid sha256:e30b22313140bc11e9bb17ce3c973f2f8a5056a55427efe6ac05fd2280a2e5b0 +size 106733 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPhone-15-pseudo.Messages-and-Content.png b/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPhone-15-pseudo.Messages-and-Content.png index f5f123bb9b..35f770e3f3 100644 --- a/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPhone-15-pseudo.Messages-and-Content.png +++ b/PreviewTests/__Snapshots__/PreviewTests/test_roomChangePermissionsScreen-iPhone-15-pseudo.Messages-and-Content.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5014e5e525409afbafeafd3e5a0cc9d87739a4124167a21f288bcd8a3d6d7673 -size 154115 +oid sha256:67338270442eb5c113765956d6c8522ab2ee7a1010edc9c9261061294090d060 +size 155977 From bf8a6399b31bb18c89a598e50581e1b0622b1a27 Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 14 Mar 2024 17:02:34 +0000 Subject: [PATCH 3/5] Fix UI tests and update snapshots. --- UITests/Sources/AuthenticationFlowCoordinatorUITests.swift | 6 +++--- UITests/Sources/AuthenticationStartScreenUITests.swift | 4 ++-- .../en-GB-iPad-9th-generation.authenticationStartScreen.png | 3 +++ .../Application/en-GB-iPad-9th-generation.onboarding.png | 3 --- ...GB-iPad-9th-generation.roomRolesAndPermissionsFlow-4.png | 4 ++-- .../en-GB-iPhone-14.authenticationStartScreen.png | 3 +++ .../Application/en-GB-iPhone-14.onboarding.png | 3 --- .../en-GB-iPhone-14.roomRolesAndPermissionsFlow-4.png | 4 ++-- ...pseudo-iPad-9th-generation.authenticationStartScreen.png | 3 +++ .../Application/pseudo-iPad-9th-generation.onboarding.png | 3 --- ...do-iPad-9th-generation.roomRolesAndPermissionsFlow-4.png | 4 ++-- .../pseudo-iPhone-14.authenticationStartScreen.png | 3 +++ .../Application/pseudo-iPhone-14.onboarding.png | 3 --- .../pseudo-iPhone-14.roomRolesAndPermissionsFlow-4.png | 4 ++-- 14 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.authenticationStartScreen.png delete mode 100644 UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.onboarding.png create mode 100644 UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.authenticationStartScreen.png delete mode 100644 UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.onboarding.png create mode 100644 UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.authenticationStartScreen.png delete mode 100644 UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.onboarding.png create mode 100644 UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.authenticationStartScreen.png delete mode 100644 UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.onboarding.png diff --git a/UITests/Sources/AuthenticationFlowCoordinatorUITests.swift b/UITests/Sources/AuthenticationFlowCoordinatorUITests.swift index c0f8152364..bc56f97e00 100644 --- a/UITests/Sources/AuthenticationFlowCoordinatorUITests.swift +++ b/UITests/Sources/AuthenticationFlowCoordinatorUITests.swift @@ -23,7 +23,7 @@ class AuthenticationFlowCoordinatorUITests: XCTestCase { let app = Application.launch(.authenticationFlow) // Splash Screen: Tap get started button - app.buttons[A11yIdentifiers.onboardingScreen.signIn].tap() + app.buttons[A11yIdentifiers.authenticationStartScreen.signIn].tap() // Server Confirmation: Tap continue button app.buttons[A11yIdentifiers.serverConfirmationScreen.continue].tap() @@ -45,7 +45,7 @@ class AuthenticationFlowCoordinatorUITests: XCTestCase { let app = Application.launch(.authenticationFlow) // Splash Screen: Tap get started button - app.buttons[A11yIdentifiers.onboardingScreen.signIn].tap() + app.buttons[A11yIdentifiers.authenticationStartScreen.signIn].tap() // Server Confirmation: Tap continue button app.buttons[A11yIdentifiers.serverConfirmationScreen.continue].tap() @@ -69,7 +69,7 @@ class AuthenticationFlowCoordinatorUITests: XCTestCase { let app = Application.launch(.authenticationFlow) // Splash Screen: Tap get started button - app.buttons[A11yIdentifiers.onboardingScreen.signIn].tap() + app.buttons[A11yIdentifiers.authenticationStartScreen.signIn].tap() // Server Confirmation: Tap change server button app.buttons[A11yIdentifiers.serverConfirmationScreen.changeServer].tap() diff --git a/UITests/Sources/AuthenticationStartScreenUITests.swift b/UITests/Sources/AuthenticationStartScreenUITests.swift index 306a55f4c8..a83dc55fc5 100644 --- a/UITests/Sources/AuthenticationStartScreenUITests.swift +++ b/UITests/Sources/AuthenticationStartScreenUITests.swift @@ -19,7 +19,7 @@ import XCTest @MainActor class AuthenticationStartScreenUITests: XCTestCase { func testInitialStateComponents() async throws { - let app = Application.launch(.onboarding) - try await app.assertScreenshot(.onboarding) + let app = Application.launch(.authenticationStartScreen) + try await app.assertScreenshot(.authenticationStartScreen) } } diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.authenticationStartScreen.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.authenticationStartScreen.png new file mode 100644 index 0000000000..7ab2dfcd47 --- /dev/null +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.authenticationStartScreen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:635a5752e1bf1f0ee91688b59e853b1537db70c7cf67eda9dd5c6d6e1c29bd6e +size 1273769 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.onboarding.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.onboarding.png deleted file mode 100644 index 94ae8ff483..0000000000 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.onboarding.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b0df6a86517b6c8c5e45d7a77ad323c7730178fdc6523f52068748b5d81eca3b -size 1276372 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomRolesAndPermissionsFlow-4.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomRolesAndPermissionsFlow-4.png index 0d9c8c0c58..9c37f20bd6 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomRolesAndPermissionsFlow-4.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomRolesAndPermissionsFlow-4.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c25af572834b339745080f03d4ce2318a30f5f79ad37144b522aaa2b32d6833 -size 95336 +oid sha256:9c28498ab66df551d50e211b046ec39767c650b29825c026f83f3b3bd234b217 +size 96303 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.authenticationStartScreen.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.authenticationStartScreen.png new file mode 100644 index 0000000000..2cad790185 --- /dev/null +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.authenticationStartScreen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d20dfc70cf78d1ad362a9e3081fd1011183af14aaf4644b5547dbf801f142eb1 +size 999538 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.onboarding.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.onboarding.png deleted file mode 100644 index b0585fcf76..0000000000 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.onboarding.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:279e06e9fbfb8670fecd2ad88f6486402067e5eb1788a5db2f7420a88adaf2d4 -size 1000272 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomRolesAndPermissionsFlow-4.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomRolesAndPermissionsFlow-4.png index 07e24afe09..bb5e83afd5 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomRolesAndPermissionsFlow-4.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomRolesAndPermissionsFlow-4.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:be5ada770c951e7483f2b1c101774e7e2077cc844eaf2013f2113ee3f3cab558 -size 109500 +oid sha256:d2eb0ec552742a8d22d3808c7479b32d36a224a32f22c67aaf0d30e225cdbd4b +size 112700 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.authenticationStartScreen.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.authenticationStartScreen.png new file mode 100644 index 0000000000..66df192d37 --- /dev/null +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.authenticationStartScreen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3cc3f4ecd03b5a651792c3fdea276b0e984edc6eec2689cece5f3e2a519a4c4 +size 1296859 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.onboarding.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.onboarding.png deleted file mode 100644 index b1b8ea036a..0000000000 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.onboarding.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d2de5fced9093eeef584c2c1ee3b2296e9201cb0c8132672bce778389bbae036 -size 1298519 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomRolesAndPermissionsFlow-4.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomRolesAndPermissionsFlow-4.png index 6481c860e1..f70392c379 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomRolesAndPermissionsFlow-4.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomRolesAndPermissionsFlow-4.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:37640f16e3b52c138bffd571ef0567d673384131cc9c2a7a3fa703662b9dc58e -size 99735 +oid sha256:b3fccd3407b2ceeaa781d21c958448fa08e5dd327528508eee01a3280fec0236 +size 101238 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.authenticationStartScreen.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.authenticationStartScreen.png new file mode 100644 index 0000000000..13b3a74b54 --- /dev/null +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.authenticationStartScreen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7d223d25fce1e943f24df2d1ad595c63a0b3c3ae2a71b9dfb1be0a6ddef0e5c +size 1026703 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.onboarding.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.onboarding.png deleted file mode 100644 index 824423fcc4..0000000000 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.onboarding.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b829d6b34f1bb1600e5ccefbf4f7c04fba4b1fad73671cf648ab72ae49e012de -size 1025995 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomRolesAndPermissionsFlow-4.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomRolesAndPermissionsFlow-4.png index f79d815fe9..c2498aab20 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomRolesAndPermissionsFlow-4.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomRolesAndPermissionsFlow-4.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0ddce2faa0548cb422fa3204725e96fbc1414f065e1b444fcf8cdac1e6df02c2 -size 124452 +oid sha256:546d0d7b9d6779d36fdf0d6c1eab3fa3e846854b9439a7f3d88c00ede2b8d7d3 +size 125838 From 70f9966921ed0ddd5d5137aa147a8a9b6e8259d2 Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 14 Mar 2024 17:07:40 +0000 Subject: [PATCH 4/5] Fix integration tests. --- IntegrationTests/Sources/Common.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IntegrationTests/Sources/Common.swift b/IntegrationTests/Sources/Common.swift index f7b5bf0a23..d0a02000e3 100644 --- a/IntegrationTests/Sources/Common.swift +++ b/IntegrationTests/Sources/Common.swift @@ -18,7 +18,7 @@ import XCTest extension XCUIApplication { func login(currentTestCase: XCTestCase) { - let getStartedButton = buttons[A11yIdentifiers.onboardingScreen.signIn] + let getStartedButton = buttons[A11yIdentifiers.authenticationStartScreen.signIn] XCTAssertTrue(getStartedButton.waitForExistence(timeout: 10.0)) getStartedButton.tap() @@ -128,7 +128,7 @@ extension XCUIApplication { alertLogoutButton.tap() // Check that we're back on the login screen - let getStartedButton = buttons[A11yIdentifiers.onboardingScreen.signIn] + let getStartedButton = buttons[A11yIdentifiers.authenticationStartScreen.signIn] XCTAssertTrue(getStartedButton.waitForExistence(timeout: 10.0)) } } From f27b1f73a97ff2d44143febd5f17f29520acde93 Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 14 Mar 2024 17:14:15 +0000 Subject: [PATCH 5/5] Run periphery for Moderation feature. --- .../Sources/FlowCoordinators/RoomFlowCoordinator.swift | 1 + .../View/RoomChangeRolesScreen.swift | 9 --------- .../RoomRolesAndPermissionsScreenViewModel.swift | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift index 3b692a2bac..f0eeb8ce9b 100644 --- a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift @@ -50,6 +50,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol { private let analytics: AnalyticsService private let userIndicatorController: UserIndicatorControllerProtocol + // periphery:ignore - used to avoid deallocation private var rolesAndPermissionsFlowCoordinator: RoomRolesAndPermissionsFlowCoordinator? private let stateMachine: StateMachine = .init(state: .initial) diff --git a/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreen.swift b/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreen.swift index 13bf4eed9a..017a60ff1a 100644 --- a/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreen.swift +++ b/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreen.swift @@ -61,15 +61,6 @@ struct RoomChangeRolesScreen: View { } } - private var noResultsContent: some View { - Text(L10n.commonNoResults) - .font(.compound.bodyLG) - .foregroundColor(.compound.textSecondary) - .frame(maxWidth: .infinity) - .listRowBackground(Color.clear) - .accessibilityIdentifier(A11yIdentifiers.startChatScreen.searchNoResults) - } - @ViewBuilder private var membersSection: some View { if !context.viewState.visibleMembers.isEmpty { diff --git a/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/RoomRolesAndPermissionsScreenViewModel.swift b/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/RoomRolesAndPermissionsScreenViewModel.swift index a4723f6dd0..88d78cf3b5 100644 --- a/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/RoomRolesAndPermissionsScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/RoomRolesAndPermissionsScreenViewModel.swift @@ -66,7 +66,7 @@ class RoomRolesAndPermissionsScreenViewModel: RoomRolesAndPermissionsScreenViewM case .editRoles(let role): actionsSubject.send(.editRoles(role)) case .editOwnUserRole: - state.bindings.alertInfo = AlertInfo(id: .resetConfirmation, + state.bindings.alertInfo = AlertInfo(id: .editOwnRole, title: L10n.screenRoomRolesAndPermissionsChangeMyRole, message: L10n.screenRoomChangeRoleConfirmDemoteSelfDescription, primaryButton: .init(title: L10n.actionCancel, role: .cancel) { },