mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Add the multi-account announcement screen (#6263)
* Add the multi-account announcement screen A self-sizing bottom sheet telling users they can now add multiple accounts, matching the designs. Close and Add account both report back to the coordinator; nothing presents it yet. * Use the Localazy strings for the multi-account announcement The copy now lives in Localazy as screen.multi_account_announcement.*, named after the screen rather than the room list. * Apply review suggestions to the multi-account announcement - Use an ElementNavigationStack with a toolbar close button, like RedactConfirmationView, instead of an overlaid glass button. * Remove the large text preview from the multi-account announcement Other sheets built the same way don't snapshot Dynamic Type sizes, and the iOS 26 bar material it would show isn't rendered in snapshots. * Use TitleAndIcon for the multi-account announcement TitleAndIcon now takes an attributed subtitle (#6274), so the sheet no longer needs to rebuild its layout by hand. The snapshots are unchanged.
This commit is contained in:
@@ -391,6 +391,10 @@ extension AccessibilityTests {
|
||||
try await performAccessibilityAudit(named: "MessageText_Previews")
|
||||
}
|
||||
|
||||
func testMultiAccountAnnouncementScreen() async throws {
|
||||
try await performAccessibilityAudit(named: "MultiAccountAnnouncementScreen_Previews")
|
||||
}
|
||||
|
||||
func testNoticeRoomTimelineView() async throws {
|
||||
try await performAccessibilityAudit(named: "NoticeRoomTimelineView_Previews")
|
||||
}
|
||||
|
||||
@@ -528,6 +528,7 @@
|
||||
52BE121FC21CE88803D2D8B5 /* GalleryItemTileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7927284C6F70D60BE5949F8C /* GalleryItemTileView.swift */; };
|
||||
5341D48F833E3E30F16FA2A3 /* SeparatorRoomTimelineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2910422CB628D3B2BBE47449 /* SeparatorRoomTimelineView.swift */; };
|
||||
5375902175B2FEA2949D7D74 /* LoginScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDDDDD9FE1A699D23A5E096 /* LoginScreen.swift */; };
|
||||
53A182049BEEC6195B91DD79 /* MultiAccountAnnouncementScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69630272FD26D4E5974CC88E /* MultiAccountAnnouncementScreenViewModelProtocol.swift */; };
|
||||
53A59720F4729D9BBFFB7CAB /* NotificationSettingsEditScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD9CB3B9DFA353AB2B7CD9F8 /* NotificationSettingsEditScreenCoordinator.swift */; };
|
||||
53C1E7F6A7D6409D89F36ED7 /* AggregatedReactionMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69CB8242D69B7E4D0B32E18D /* AggregatedReactionMock.swift */; };
|
||||
53DEF39F0C4DE02E3FC56D91 /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = 800631D7250B7F93195035F1 /* KeychainAccess */; };
|
||||
@@ -1033,6 +1034,7 @@
|
||||
A0646F23876D6326AD27FF52 /* LiveLocationSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA2FEFA393FC7D2870263012 /* LiveLocationSession.swift */; };
|
||||
A07178337F3C0B208B5A77A8 /* NotificationHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB6ED50FE104992419310EEB /* NotificationHandler.swift */; };
|
||||
A076E0A9338FD2D950C3C4A1 /* ChatsSpaceFiltersScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E63072981793CCA84EE12798 /* ChatsSpaceFiltersScreenViewModelProtocol.swift */; };
|
||||
A0790A97DAD44E8895035704 /* MultiAccountAnnouncementScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD46D21FF370EDF6BE87F8A7 /* MultiAccountAnnouncementScreenCoordinator.swift */; };
|
||||
A0861B727B273B5B3DD7FBF6 /* KnockRequestsListScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09227E671DB30795C43FFFD /* KnockRequestsListScreenViewModel.swift */; };
|
||||
A0868BDE84D2140A885BE3C9 /* EncryptionResetScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E8562F4D7DE073BC32902AB /* EncryptionResetScreenViewModelProtocol.swift */; };
|
||||
A0D7E5BD0298A97DCBDCE40B /* Sentry in Frameworks */ = {isa = PBXBuildFile; productRef = 7731767AE437BA3BD2CC14A8 /* Sentry */; };
|
||||
@@ -1270,6 +1272,7 @@
|
||||
C8E11A335456FCF94A744E6E /* SpaceFlowCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDDE826EAB1BAB80C1104980 /* SpaceFlowCoordinator.swift */; };
|
||||
C8E1E4E06B7C7A3A8246FC9B /* MediaEventsTimelineScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8512B82404B1751D0BCC82D2 /* MediaEventsTimelineScreenCoordinator.swift */; };
|
||||
C900127318820AD04D6C90B8 /* LabsScreenModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E43D8784B0054C048060FEB /* LabsScreenModels.swift */; };
|
||||
C90A5ABB868F7DDEE2DFD653 /* MultiAccountAnnouncementScreenModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DB71240A4E855DE7B9201FD /* MultiAccountAnnouncementScreenModels.swift */; };
|
||||
C915347779B3C7FDD073A87A /* AVMetadataMachineReadableCodeObjectExtensionsTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93E1FF0DFBB3768F79FDBF6D /* AVMetadataMachineReadableCodeObjectExtensionsTest.swift */; };
|
||||
C95ABC529E0009926BDE5664 /* preview_image.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 44688A16934827A0D1668253 /* preview_image.jpg */; };
|
||||
C960BACE42A9D8C535E8CB34 /* Pagination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1912062B53CE95E6F700DA60 /* Pagination.swift */; };
|
||||
@@ -1399,6 +1402,7 @@
|
||||
DCFE7CB3B9A104330BBB96AD /* AnalyticsPromptScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B67DF223EEB8DCAF178A1D4 /* AnalyticsPromptScreenCoordinator.swift */; };
|
||||
DD21CE51DF9BD04FC8155972 /* LeaveSpaceHandleSDKMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 580BDCD23DD02481AB5FFB47 /* LeaveSpaceHandleSDKMock.swift */; };
|
||||
DD4D8B5D668197D345A3ED42 /* TimelineControllerMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = F933BB25FC426D5C67E1D812 /* TimelineControllerMock.swift */; };
|
||||
DD66C863B4232BCDEBE883C8 /* MultiAccountAnnouncementScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94B5FD54003D9527FE347516 /* MultiAccountAnnouncementScreen.swift */; };
|
||||
DDE7B4771452300C103B1EB8 /* RoomDirectoryCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F6210134203BE1F2DD5C679 /* RoomDirectoryCell.swift */; };
|
||||
DDFBDEE1DC32BDD5488F898C /* ClientProxyMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2F96CCBEAAA7F2185BFA354 /* ClientProxyMock.swift */; };
|
||||
DE3BF0ED68E56BF625591D49 /* LinkNewDeviceScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72C4A2D279386A811BDC6DAE /* LinkNewDeviceScreen.swift */; };
|
||||
@@ -1559,6 +1563,7 @@
|
||||
F519DE17A3A0F760307B2E6D /* InviteUsersScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02D155E09BF961BBA8F85263 /* InviteUsersScreenViewModel.swift */; };
|
||||
F54E2D6CAD96E1AC15BC526F /* MessageForwardingScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8E60332509665C00179ACF6 /* MessageForwardingScreenViewModel.swift */; };
|
||||
F58BF3BD3233A03F013816E4 /* ClassicAppAccountManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98F4DFFFC62187D9A4D2030D /* ClassicAppAccountManager.swift */; };
|
||||
F5A74869B9899FB178EDCDF9 /* MultiAccountAnnouncementScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42F6FA4E8F2A0D6947AA44C2 /* MultiAccountAnnouncementScreenViewModel.swift */; };
|
||||
F5D2270B5021D521C0D22E11 /* FlowCoordinatorProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B9FCA1CFD07B8CF9BD21266 /* FlowCoordinatorProtocol.swift */; };
|
||||
F656F92A63D3DC1978D79427 /* Macros in Frameworks */ = {isa = PBXBuildFile; productRef = 401E93551F7792B0179907CF /* Macros */; };
|
||||
F65F3909769E7C48B3309D9D /* RemoteSettingsHook.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5D186A6DB8FAC5C9D0E4D61 /* RemoteSettingsHook.swift */; };
|
||||
@@ -2053,6 +2058,7 @@
|
||||
2DA3DBE1A42EAFF93889FA04 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/SAS.strings; sourceTree = "<group>"; };
|
||||
2DA4F09CB613C54FDC73AE6A /* ThreadDecorator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreadDecorator.swift; sourceTree = "<group>"; };
|
||||
2DB0E533508094156D8024C3 /* TimelineStyler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineStyler.swift; sourceTree = "<group>"; };
|
||||
2DB71240A4E855DE7B9201FD /* MultiAccountAnnouncementScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiAccountAnnouncementScreenModels.swift; sourceTree = "<group>"; };
|
||||
2E11E7C396ED06A154CF6DF3 /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/SAS.strings; sourceTree = "<group>"; };
|
||||
2F06F70B9C433BAD4BC6B9F5 /* EncryptedRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptedRoomTimelineView.swift; sourceTree = "<group>"; };
|
||||
2F36C5D9B37E50915ECBD3EE /* RoomMemberProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomMemberProxy.swift; sourceTree = "<group>"; };
|
||||
@@ -2168,6 +2174,7 @@
|
||||
42C58159916ABD7F454CE689 /* AdvancedSettingsScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsScreenCoordinator.swift; sourceTree = "<group>"; };
|
||||
42C64A14EE89928207E3B42B /* AnalyticsSettingsScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsSettingsScreenModels.swift; sourceTree = "<group>"; };
|
||||
42C8C368A611B9CB79C7F5FA /* RoomPollsHistoryScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomPollsHistoryScreen.swift; sourceTree = "<group>"; };
|
||||
42F6FA4E8F2A0D6947AA44C2 /* MultiAccountAnnouncementScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiAccountAnnouncementScreenViewModel.swift; sourceTree = "<group>"; };
|
||||
430C73079A84654BF46A7FF5 /* FileMediaEventsTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileMediaEventsTimelineView.swift; sourceTree = "<group>"; };
|
||||
4338BB055A26094673CDC220 /* SpaceAddRoomsScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpaceAddRoomsScreenViewModel.swift; sourceTree = "<group>"; };
|
||||
434522ED2BDED08759048077 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
@@ -2391,6 +2398,7 @@
|
||||
68F8744C32ACA0821A771EBB /* test_audio.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = test_audio.mp3; sourceTree = "<group>"; };
|
||||
690915157A874D1F21ADE70C /* preview_avatar_room.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = preview_avatar_room.jpg; sourceTree = "<group>"; };
|
||||
693E16574C6F7F9FA1015A8C /* Search.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Search.swift; sourceTree = "<group>"; };
|
||||
69630272FD26D4E5974CC88E /* MultiAccountAnnouncementScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiAccountAnnouncementScreenViewModelProtocol.swift; sourceTree = "<group>"; };
|
||||
69A05E85E4872C3221C5C287 /* RemotePreference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemotePreference.swift; sourceTree = "<group>"; };
|
||||
69CB8242D69B7E4D0B32E18D /* AggregatedReactionMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AggregatedReactionMock.swift; sourceTree = "<group>"; };
|
||||
69D42EE0102D2857933625DD /* CreateRoomViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateRoomViewModelTests.swift; sourceTree = "<group>"; };
|
||||
@@ -2646,6 +2654,7 @@
|
||||
94028A227645FA880B966211 /* WaveformSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WaveformSource.swift; sourceTree = "<group>"; };
|
||||
9475FD81B13D50103E5290EB /* SpaceSettingsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpaceSettingsScreen.swift; sourceTree = "<group>"; };
|
||||
94A561C542596126DAE211AD /* preview_avatar_user.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = preview_avatar_user.jpg; sourceTree = "<group>"; };
|
||||
94B5FD54003D9527FE347516 /* MultiAccountAnnouncementScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiAccountAnnouncementScreen.swift; sourceTree = "<group>"; };
|
||||
94D670124FC3E84F23A62CCF /* APNSPayload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APNSPayload.swift; sourceTree = "<group>"; };
|
||||
94EE2C5F0A06F146BBE3A1B1 /* LinkNewDeviceFlowCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkNewDeviceFlowCoordinator.swift; sourceTree = "<group>"; };
|
||||
9501D11B4258DFA33BA3B40F /* ServerSelectionScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServerSelectionScreenModels.swift; sourceTree = "<group>"; };
|
||||
@@ -2995,6 +3004,7 @@
|
||||
CCE06F4A71FD46C9D8CD432E /* RoomThreadListServiceProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomThreadListServiceProxy.swift; sourceTree = "<group>"; };
|
||||
CCF71646898A2F720C5BFDF5 /* RoomDirectorySearchScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDirectorySearchScreenViewModel.swift; sourceTree = "<group>"; };
|
||||
CD469F7513574341181F7EAA /* ServerSelectionScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServerSelectionScreen.swift; sourceTree = "<group>"; };
|
||||
CD46D21FF370EDF6BE87F8A7 /* MultiAccountAnnouncementScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiAccountAnnouncementScreenCoordinator.swift; sourceTree = "<group>"; };
|
||||
CD6613DE16AD26B3A74DA1F5 /* LocationRoomTimelineItemContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationRoomTimelineItemContent.swift; sourceTree = "<group>"; };
|
||||
CDA38C9B58693A49A3032552 /* DeclineAndBlockScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeclineAndBlockScreenCoordinator.swift; sourceTree = "<group>"; };
|
||||
CDB3227C7A74B734924942E9 /* RoomSummaryProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomSummaryProvider.swift; sourceTree = "<group>"; };
|
||||
@@ -3944,6 +3954,14 @@
|
||||
path = RoomMember;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2C5E4DC51BC09EA05CA1D590 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
94B5FD54003D9527FE347516 /* MultiAccountAnnouncementScreen.swift */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2D0D49B0533C4C2EB889BF3A /* ServerSelectionScreen */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -5004,6 +5022,18 @@
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
601F598160369994A6C0C85D /* MultiAccountAnnouncementScreen */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CD46D21FF370EDF6BE87F8A7 /* MultiAccountAnnouncementScreenCoordinator.swift */,
|
||||
2DB71240A4E855DE7B9201FD /* MultiAccountAnnouncementScreenModels.swift */,
|
||||
42F6FA4E8F2A0D6947AA44C2 /* MultiAccountAnnouncementScreenViewModel.swift */,
|
||||
69630272FD26D4E5974CC88E /* MultiAccountAnnouncementScreenViewModelProtocol.swift */,
|
||||
2C5E4DC51BC09EA05CA1D590 /* View */,
|
||||
);
|
||||
path = MultiAccountAnnouncementScreen;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
605F8221E52991786397FCC9 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -7095,6 +7125,7 @@
|
||||
87E2774157D9C4894BCFF3F8 /* MediaPickerScreen */,
|
||||
23605DD08620BE6558242469 /* MediaUploadPreviewScreen */,
|
||||
3348D14DBDB54E72FC67E2F3 /* MessageForwardingScreen */,
|
||||
601F598160369994A6C0C85D /* MultiAccountAnnouncementScreen */,
|
||||
DE07A244ACE83E40D894EDF3 /* NativeCallScreen */,
|
||||
8F074E22FD93E64211971845 /* Onboarding */,
|
||||
A448A3A8F764174C60CD0CA1 /* Other */,
|
||||
@@ -9109,6 +9140,11 @@
|
||||
C13128AAA787A4C2CBE4EE82 /* MessageForwardingScreenViewModelProtocol.swift in Sources */,
|
||||
C97325EFDCCEE457432A9E82 /* MessageText.swift in Sources */,
|
||||
AF2ABA2794E376B64104C964 /* MockSoftLogoutScreenState.swift in Sources */,
|
||||
DD66C863B4232BCDEBE883C8 /* MultiAccountAnnouncementScreen.swift in Sources */,
|
||||
A0790A97DAD44E8895035704 /* MultiAccountAnnouncementScreenCoordinator.swift in Sources */,
|
||||
C90A5ABB868F7DDEE2DFD653 /* MultiAccountAnnouncementScreenModels.swift in Sources */,
|
||||
F5A74869B9899FB178EDCDF9 /* MultiAccountAnnouncementScreenViewModel.swift in Sources */,
|
||||
53A182049BEEC6195B91DD79 /* MultiAccountAnnouncementScreenViewModelProtocol.swift in Sources */,
|
||||
E938F7A45D6A3DBBE6789A03 /* NSEUserSession.swift in Sources */,
|
||||
551E03A935A6B73158A1AB4A /* NSEUserSessionMock.swift in Sources */,
|
||||
F9842667B68DC6FA1F9ECCBB /* NSItemProvider.swift in Sources */,
|
||||
|
||||
@@ -1074,6 +1074,9 @@
|
||||
"screen_moderation_and_safety_invites_heading" = "Invites";
|
||||
"screen_moderation_and_safety_other_users_heading" = "Other users";
|
||||
"screen_moderation_and_safety_share_presence_heading" = "Your appearance";
|
||||
"screen_multi_account_announcement_action" = "Add account";
|
||||
"screen_multi_account_announcement_description" = "Go to %1$@ to sign into another account. Then you can easily switch between them.";
|
||||
"screen_multi_account_announcement_title" = "You can now add multiple accounts";
|
||||
"screen_notification_optin_subtitle" = "You can change your settings later.";
|
||||
"screen_notification_optin_title" = "Allow notifications and never miss a message";
|
||||
"screen_notification_settings_additional_settings_section_title" = "Additional settings";
|
||||
|
||||
@@ -1074,6 +1074,9 @@
|
||||
"screen_moderation_and_safety_invites_heading" = "Invites";
|
||||
"screen_moderation_and_safety_other_users_heading" = "Other users";
|
||||
"screen_moderation_and_safety_share_presence_heading" = "Your appearance";
|
||||
"screen_multi_account_announcement_action" = "Add account";
|
||||
"screen_multi_account_announcement_description" = "Go to %1$@ to sign into another account. Then you can easily switch between them.";
|
||||
"screen_multi_account_announcement_title" = "You can now add multiple accounts";
|
||||
"screen_notification_optin_subtitle" = "You can change your settings later.";
|
||||
"screen_notification_optin_title" = "Allow notifications and never miss a message";
|
||||
"screen_notification_settings_additional_settings_section_title" = "Additional settings";
|
||||
|
||||
@@ -2518,6 +2518,14 @@ internal nonisolated enum L10n {
|
||||
internal static var screenModerationAndSafetyOtherUsersHeading: String { return L10n.tr("Localizable", "screen_moderation_and_safety_other_users_heading") }
|
||||
/// Your appearance
|
||||
internal static var screenModerationAndSafetySharePresenceHeading: String { return L10n.tr("Localizable", "screen_moderation_and_safety_share_presence_heading") }
|
||||
/// Add account
|
||||
internal static var screenMultiAccountAnnouncementAction: String { return L10n.tr("Localizable", "screen_multi_account_announcement_action") }
|
||||
/// Go to %1$@ to sign into another account. Then you can easily switch between them.
|
||||
internal static func screenMultiAccountAnnouncementDescription(_ p1: Any) -> String {
|
||||
return L10n.tr("Localizable", "screen_multi_account_announcement_description", String(describing: p1))
|
||||
}
|
||||
/// You can now add multiple accounts
|
||||
internal static var screenMultiAccountAnnouncementTitle: String { return L10n.tr("Localizable", "screen_multi_account_announcement_title") }
|
||||
/// You can change your settings later.
|
||||
internal static var screenNotificationOptinSubtitle: String { return L10n.tr("Localizable", "screen_notification_optin_subtitle") }
|
||||
/// Allow notifications and never miss a message
|
||||
|
||||
@@ -102,6 +102,7 @@ enum TestablePreviewsDictionary {
|
||||
"MessageComposer_Previews" : MessageComposer_Previews.self,
|
||||
"MessageForwardingScreen_Previews" : MessageForwardingScreen_Previews.self,
|
||||
"MessageText_Previews" : MessageText_Previews.self,
|
||||
"MultiAccountAnnouncementScreen_Previews" : MultiAccountAnnouncementScreen_Previews.self,
|
||||
"NoticeRoomTimelineView_Previews" : NoticeRoomTimelineView_Previews.self,
|
||||
"NotificationPermissionsScreen_Previews" : NotificationPermissionsScreen_Previews.self,
|
||||
"NotificationSettingsEditScreenRoomCell_Previews" : NotificationSettingsEditScreenRoomCell_Previews.self,
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// Copyright 2026 Element Creations Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
enum MultiAccountAnnouncementScreenCoordinatorAction {
|
||||
case addAccount
|
||||
case dismiss
|
||||
}
|
||||
|
||||
final class MultiAccountAnnouncementScreenCoordinator: CoordinatorProtocol {
|
||||
private let viewModel: MultiAccountAnnouncementScreenViewModelProtocol
|
||||
|
||||
private var cancellables = Set<AnyCancellable>()
|
||||
|
||||
private let actionsSubject: PassthroughSubject<MultiAccountAnnouncementScreenCoordinatorAction, Never> = .init()
|
||||
var actionsPublisher: AnyPublisher<MultiAccountAnnouncementScreenCoordinatorAction, Never> {
|
||||
actionsSubject.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
init() {
|
||||
viewModel = MultiAccountAnnouncementScreenViewModel()
|
||||
}
|
||||
|
||||
func start() {
|
||||
viewModel.actionsPublisher.sink { [weak self] action in
|
||||
guard let self else { return }
|
||||
|
||||
switch action {
|
||||
case .addAccount:
|
||||
actionsSubject.send(.addAccount)
|
||||
case .dismiss:
|
||||
actionsSubject.send(.dismiss)
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
func toPresentable() -> AnyView {
|
||||
AnyView(MultiAccountAnnouncementScreen(context: viewModel.context))
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2026 Element Creations Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
enum MultiAccountAnnouncementScreenViewModelAction {
|
||||
case addAccount
|
||||
case dismiss
|
||||
}
|
||||
|
||||
struct MultiAccountAnnouncementScreenViewState: BindableState {
|
||||
let description: AttributedString
|
||||
|
||||
init() {
|
||||
let boldPlaceholder = "{bold}"
|
||||
var description = AttributedString(L10n.screenMultiAccountAnnouncementDescription(boldPlaceholder))
|
||||
var boldString = AttributedString("\(L10n.commonSettings) > \(L10n.screenSettingsAddAccount)")
|
||||
boldString.bold()
|
||||
description.replace(boldPlaceholder, with: boldString)
|
||||
self.description = description
|
||||
}
|
||||
}
|
||||
|
||||
enum MultiAccountAnnouncementScreenViewAction {
|
||||
case addAccount
|
||||
case close
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2026 Element Creations Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias MultiAccountAnnouncementScreenViewModelType = StateStoreViewModelV2<MultiAccountAnnouncementScreenViewState, MultiAccountAnnouncementScreenViewAction>
|
||||
|
||||
class MultiAccountAnnouncementScreenViewModel: MultiAccountAnnouncementScreenViewModelType, MultiAccountAnnouncementScreenViewModelProtocol {
|
||||
private let actionsSubject: PassthroughSubject<MultiAccountAnnouncementScreenViewModelAction, Never> = .init()
|
||||
var actionsPublisher: AnyPublisher<MultiAccountAnnouncementScreenViewModelAction, Never> {
|
||||
actionsSubject.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
init() {
|
||||
super.init(initialViewState: .init())
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
override func process(viewAction: MultiAccountAnnouncementScreenViewAction) {
|
||||
switch viewAction {
|
||||
case .addAccount:
|
||||
actionsSubject.send(.addAccount)
|
||||
case .close:
|
||||
actionsSubject.send(.dismiss)
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// Copyright 2026 Element Creations Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Combine
|
||||
|
||||
protocol MultiAccountAnnouncementScreenViewModelProtocol {
|
||||
var actionsPublisher: AnyPublisher<MultiAccountAnnouncementScreenViewModelAction, Never> { get }
|
||||
var context: MultiAccountAnnouncementScreenViewModelType.Context { get }
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// Copyright 2026 Element Creations Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
struct MultiAccountAnnouncementScreen: View {
|
||||
let context: MultiAccountAnnouncementScreenViewModel.Context
|
||||
|
||||
@State private var contentHeight: CGFloat = .zero
|
||||
@State private var buttonHeight: CGFloat = .zero
|
||||
private let topPadding: CGFloat = 44 // For the navigation bar
|
||||
|
||||
var body: some View {
|
||||
ElementNavigationStack {
|
||||
ScrollView {
|
||||
content
|
||||
.readHeight($contentHeight)
|
||||
}
|
||||
.scrollBounceBehavior(.basedOnSize)
|
||||
.backportSafeAreaBar(edge: .bottom, spacing: 0) {
|
||||
addAccountButton
|
||||
.readHeight($buttonHeight)
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
ToolbarButton(role: .close) { context.send(viewAction: .close) }
|
||||
}
|
||||
}
|
||||
}
|
||||
.presentationDetents([.height(contentHeight + buttonHeight + topPadding)])
|
||||
.presentationDragIndicator(.hidden)
|
||||
.presentationBackground(.compound.bgCanvasDefault)
|
||||
}
|
||||
|
||||
private var content: some View {
|
||||
TitleAndIcon(title: L10n.screenMultiAccountAnnouncementTitle,
|
||||
subtitle: context.viewState.description,
|
||||
icon: \.userProfileSolid,
|
||||
iconStyle: .defaultSolid)
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.horizontal, 24)
|
||||
.padding(.top, 16)
|
||||
.padding(.bottom, 24)
|
||||
}
|
||||
|
||||
private var addAccountButton: some View {
|
||||
Button {
|
||||
context.send(viewAction: .addAccount)
|
||||
} label: {
|
||||
Label(L10n.screenMultiAccountAnnouncementAction, icon: \.plus)
|
||||
}
|
||||
.buttonStyle(.compound(.primary))
|
||||
.padding(16)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
struct MultiAccountAnnouncementScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let viewModel = MultiAccountAnnouncementScreenViewModel()
|
||||
|
||||
static var previews: some View {
|
||||
MultiAccountAnnouncementScreen(context: viewModel.context)
|
||||
.previewDisplayName("Default")
|
||||
}
|
||||
}
|
||||
@@ -683,6 +683,13 @@ extension PreviewTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
func multiAccountAnnouncementScreen() async throws {
|
||||
for (index, preview) in MultiAccountAnnouncementScreen_Previews._allPreviews.enumerated() {
|
||||
try await assertSnapshots(matching: preview, step: index)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
func noticeRoomTimelineView() async throws {
|
||||
for (index, preview) in NoticeRoomTimelineView_Previews._allPreviews.enumerated() {
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:257f3948490a4a9ca4b9f2eefebb3f0c010bfb3fae2721e4b95cab52889fe3a5
|
||||
size 102613
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2588daf8fa9a61b445545e047799520bbd20388a5dbd3f2a71ad94438aee6149
|
||||
size 118735
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:753970b5fa26d39052106d90d2f6ecc807a15eddf031f5f67c6e7457d188675a
|
||||
size 63416
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d987ab496eec5bfe41d3c1b8f2143da225b5740c7b79eb75d4dfaa7fa4b379c2
|
||||
size 85276
|
||||
Reference in New Issue
Block a user