Skip to content

Commit a226c99

Browse files
authored
Implement the flow for leaving a space. (#4568)
1 parent 6377d9b commit a226c99

File tree

36 files changed

+933
-42
lines changed

36 files changed

+933
-42
lines changed

AccessibilityTests/Sources/GeneratedAccessibilityTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ extension AccessibilityTests {
243243
try await performAccessibilityAudit(named: "KnockRequestsListScreen_Previews")
244244
}
245245

246+
func testLeaveSpaceView() async throws {
247+
try await performAccessibilityAudit(named: "LeaveSpaceView_Previews")
248+
}
249+
246250
func testLegalInformationScreen() async throws {
247251
try await performAccessibilityAudit(named: "LegalInformationScreen_Previews")
248252
}

ElementX.xcodeproj/project.pbxproj

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,7 @@
10121012
B6048166B4AA4CEFEA9B77A6 /* InfoPlistReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A580295A56B55A856CC4084 /* InfoPlistReader.swift */; };
10131013
B6064D82FCDCB829601C1F59 /* SecureBackupLogoutConfirmationScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37FEE10AB666891E6A675E5E /* SecureBackupLogoutConfirmationScreen.swift */; };
10141014
B6B62437B92B6CA4083AA899 /* SessionDirectories.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C2067FF58B4996323EB40C /* SessionDirectories.swift */; };
1015+
B6CA5D18D702D0919BEF0263 /* LeaveSpaceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7813824C547ED121F6F8E0F /* LeaveSpaceView.swift */; };
10151016
B6DA66EFC13A90846B625836 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 91DE43B8815918E590912DDA /* InfoPlist.strings */; };
10161017
B6DF6B6FA8734B70F9BF261E /* BlurHashDecode.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5272BC4A60B6AD7553BACA1 /* BlurHashDecode.swift */; };
10171018
B6EC2148FA5443C9289BEEBA /* MediaProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F17EFA1D3D09FC2F9C5E1CB2 /* MediaProvider.swift */; };
@@ -1206,6 +1207,7 @@
12061207
DC68E866D6E664B0D2B06E74 /* MockImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1DA29A5A041CC0BACA7CB0 /* MockImageCache.swift */; };
12071208
DC77E9DB2CFBE84A2BDF20C5 /* RoomRolesAndPermissionsFlowCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0833F51229E166BCA141D004 /* RoomRolesAndPermissionsFlowCoordinator.swift */; };
12081209
DCFE7CB3B9A104330BBB96AD /* AnalyticsPromptScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B67DF223EEB8DCAF178A1D4 /* AnalyticsPromptScreenCoordinator.swift */; };
1210+
DD21CE51DF9BD04FC8155972 /* LeaveSpaceHandleSDKMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 580BDCD23DD02481AB5FFB47 /* LeaveSpaceHandleSDKMock.swift */; };
12091211
DDB47D29C6865669288BF87C /* UIFont+AttributedStringBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = E8CA187FE656EE5A3F6C7DE5 /* UIFont+AttributedStringBuilder.m */; };
12101212
DDE7B4771452300C103B1EB8 /* RoomDirectoryCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F6210134203BE1F2DD5C679 /* RoomDirectoryCell.swift */; };
12111213
DDFBDEE1DC32BDD5488F898C /* ClientProxyMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2F96CCBEAAA7F2185BFA354 /* ClientProxyMock.swift */; };
@@ -1308,6 +1310,7 @@
13081310
EF79B9EFD094C17FBB4942C2 /* UserPreference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E6DE144D887A254F4CAF203 /* UserPreference.swift */; };
13091311
EF890DEF0479E66548F2BA23 /* AppLockTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 490BEADEFB2D6B7C9F618AE8 /* AppLockTimer.swift */; };
13101312
EFBBD44C0A16F017C32D2099 /* TimelineItemStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72614BFF35B8394C6E13F55A /* TimelineItemStatusView.swift */; };
1313+
EFF735EC040BEB669AFBAB50 /* LeaveSpaceHandleProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B3CE05643C7791D46AC54B /* LeaveSpaceHandleProxy.swift */; };
13111314
F0570F1ECD70C4C851FB2052 /* SecureBackupRecoveryKeyScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93E7304F5ECB4CB11CB10E60 /* SecureBackupRecoveryKeyScreenViewModelProtocol.swift */; };
13121315
F06CE9132855E81EBB6DDC32 /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = 940C605265DD82DA0C655E23 /* Kingfisher */; };
13131316
F07D88421A9BC4D03D4A5055 /* VideoRoomTimelineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = F348B5F2C12F9D4F4B4D3884 /* VideoRoomTimelineItem.swift */; };
@@ -1961,6 +1964,7 @@
19611964
57AD14D3ADADE8F6A10F9E88 /* EncryptionSettingsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptionSettingsTests.swift; sourceTree = "<group>"; };
19621965
57EAAF82432B0B53881CF826 /* AudioRoomTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioRoomTimelineItem.swift; sourceTree = "<group>"; };
19631966
57F95CADD0A5DBD76B990FCB /* ServiceLocator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceLocator.swift; sourceTree = "<group>"; };
1967+
580BDCD23DD02481AB5FFB47 /* LeaveSpaceHandleSDKMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeaveSpaceHandleSDKMock.swift; sourceTree = "<group>"; };
19641968
584A61D9C459FAFEF038A7C0 /* Section.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Section.swift; sourceTree = "<group>"; };
19651969
5875F7C0A2398E9F134B1284 /* EncryptionResetScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptionResetScreenViewModel.swift; sourceTree = "<group>"; };
19661970
58C2527813FDAE23E72A9063 /* AnalyticsSettingsScreenViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsSettingsScreenViewModelTests.swift; sourceTree = "<group>"; };
@@ -2096,6 +2100,7 @@
20962100
752A0EB49BF5BCEA37EDF7A3 /* Signposter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Signposter.swift; sourceTree = "<group>"; };
20972101
753B4C6C0EDDCBF0708DC384 /* TimelineItemSendInfoLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineItemSendInfoLabel.swift; sourceTree = "<group>"; };
20982102
75821CD31A4BD02B99C327A4 /* DataProtectionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataProtectionManager.swift; sourceTree = "<group>"; };
2103+
75B3CE05643C7791D46AC54B /* LeaveSpaceHandleProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeaveSpaceHandleProxy.swift; sourceTree = "<group>"; };
20992104
76310030C831D4610A705603 /* URLComponentsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLComponentsTests.swift; sourceTree = "<group>"; };
21002105
76A46ABD27628CB5FC402541 /* Backports.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Backports.swift; sourceTree = "<group>"; };
21012106
7720ACAC6155AB7F9C70B546 /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = nb; path = nb.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
@@ -2609,6 +2614,7 @@
26092614
D751AA05AD2182BFC4608DE6 /* ur */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ur; path = ur.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
26102615
D7673F2B0B038FAB2A8D16AD /* ElementTextFieldStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElementTextFieldStyle.swift; sourceTree = "<group>"; };
26112616
D77F75B3E9F99864048A422A /* DeactivateAccountScreenViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeactivateAccountScreenViewModelTests.swift; sourceTree = "<group>"; };
2617+
D7813824C547ED121F6F8E0F /* LeaveSpaceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeaveSpaceView.swift; sourceTree = "<group>"; };
26122618
D78C13EF5035879B6131030F /* Room.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Room.swift; sourceTree = "<group>"; };
26132619
D79BB714D28C9F588DD69353 /* SecureBackupScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureBackupScreenViewModelProtocol.swift; sourceTree = "<group>"; };
26142620
D7B18089ED50324583BB2FB7 /* EditRoomAddressScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditRoomAddressScreenViewModelProtocol.swift; sourceTree = "<group>"; };
@@ -5503,6 +5509,7 @@
55035509
AAAB1791344F28CDC62E764D /* Spaces */ = {
55045510
isa = PBXGroup;
55055511
children = (
5512+
75B3CE05643C7791D46AC54B /* LeaveSpaceHandleProxy.swift */,
55065513
4B2B564CA6570E1487A7C7CC /* SpaceRoomListProxy.swift */,
55075514
EACD4855BDAD0799FD86B7B5 /* SpaceRoomListProxyProtocol.swift */,
55085515
355C8C46DA9C0B45F1B7FC4F /* SpaceRoomProxy.swift */,
@@ -6218,6 +6225,7 @@
62186225
8EAF4A49F3ACD8BB8B0D2371 /* ClientSDKMock.swift */,
62196226
0A81FD0C60175FA081EB19AD /* EventTimelineItem.swift */,
62206227
5EFB1D29B0870AFB6A56E9B8 /* IdentityResetHandleSDKMock.swift */,
6228+
580BDCD23DD02481AB5FFB47 /* LeaveSpaceHandleSDKMock.swift */,
62216229
);
62226230
path = SDK;
62236231
sourceTree = "<group>";
@@ -6425,6 +6433,7 @@
64256433
FA1D480A302295CFC3582543 /* View */ = {
64266434
isa = PBXGroup;
64276435
children = (
6436+
D7813824C547ED121F6F8E0F /* LeaveSpaceView.swift */,
64286437
646B50583A2CE6DA67F7739A /* SpaceScreen.swift */,
64296438
);
64306439
path = View;
@@ -7828,6 +7837,9 @@
78287837
E468CC731C3F4D678499E52F /* LAContextMock.swift in Sources */,
78297838
D5681C80D8281560AACE0035 /* Label.swift in Sources */,
78307839
EEAE954289DE813A61656AE0 /* LayoutDirection.swift in Sources */,
7840+
EFF735EC040BEB669AFBAB50 /* LeaveSpaceHandleProxy.swift in Sources */,
7841+
DD21CE51DF9BD04FC8155972 /* LeaveSpaceHandleSDKMock.swift in Sources */,
7842+
B6CA5D18D702D0919BEF0263 /* LeaveSpaceView.swift in Sources */,
78317843
42B084FDE621FBEE433AF444 /* LegalInformationScreen.swift in Sources */,
78327844
9EBDC79CAC9B63A0D626E333 /* LegalInformationScreenCoordinator.swift in Sources */,
78337845
F40B097470D3110DFDB1FAAA /* LegalInformationScreenModels.swift in Sources */,
@@ -9364,7 +9376,7 @@
93649376
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
93659377
requirement = {
93669378
kind = exactVersion;
9367-
version = 25.09.26;
9379+
version = 25.10.02;
93689380
};
93699381
};
93709382
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {

ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ElementX/Resources/Localizations/en.lproj/Localizable.strings

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
"action_manage_account" = "Manage account";
103103
"action_manage_devices" = "Manage devices";
104104
"action_message" = "Message";
105+
"action_minimize" = "Minimise";
105106
"action_next" = "Next";
106107
"action_no" = "No";
107108
"action_not_now" = "Not now";
@@ -149,11 +150,11 @@
149150
"action_tap_for_options" = "Tap for options";
150151
"action_try_again" = "Try again";
151152
"action_unpin" = "Unpin";
153+
"action_view" = "View";
152154
"action_view_in_timeline" = "View in timeline";
153155
"action_view_source" = "View source";
154156
"action_yes" = "Yes";
155157
"action_yes_try_again" = "Yes, try again";
156-
"action.view" = "View";
157158
"banner_migrate_to_native_sliding_sync_action" = "Log Out & Upgrade";
158159
"banner_migrate_to_native_sliding_sync_app_force_logout_title" = "%1$@ no longer supports the old protocol. Please log out and log back in to continue using the app.";
159160
"banner_migrate_to_native_sliding_sync_description" = "Your server now supports a new, faster protocol. Log out and log back in to upgrade now. Doing this now will help you avoid a forced logout when the old protocol is removed later.";
@@ -219,6 +220,7 @@
219220
"common_in_reply_to" = "In reply to %1$@";
220221
"common_invite_unknown_profile" = "This Matrix ID can't be found, so the invite might not be received.";
221222
"common_leaving_room" = "Leaving room";
223+
"common_leaving_space" = "Leaving space";
222224
"common_light" = "Light";
223225
"common_line_copied_to_clipboard" = "Line copied to clipboard";
224226
"common_link_copied_to_clipboard" = "Link copied to clipboard";
@@ -565,8 +567,9 @@
565567
"screen_knock_requests_list_empty_state_description" = "When somebody will ask to join the room, you’ll be able to see their request here.";
566568
"screen_knock_requests_list_empty_state_title" = "No pending request to join";
567569
"screen_knock_requests_list_initial_loading_title" = "Loading requests to join…";
568-
"screen_leave_space_last_admin_info" = "(Admin)";
570+
"screen_leave_space_last_admin_info" = "%1$@ (Admin)";
569571
"screen_leave_space_subtitle" = "Select the rooms you’d like to leave which you're not the only administrator for:";
572+
"screen_leave_space_subtitle_only_last_admin" = "You will not be removed from the following room(s) because you're the only administrator:";
570573
"screen_leave_space_title" = "Leave %1$@?";
571574
"screen_media_details_file_format" = "File format";
572575
"screen_media_details_filename" = "File name";

ElementX/Resources/Localizations/en.lproj/Localizable.stringsdict

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -290,22 +290,6 @@
290290
<string>Leave %1$d rooms and space</string>
291291
</dict>
292292
</dict>
293-
<key>screen_leave_space_subtitle_only_last_admin</key>
294-
<dict>
295-
<key>NSStringLocalizedFormatKey</key>
296-
<string>%#@COUNT@</string>
297-
<key>COUNT</key>
298-
<dict>
299-
<key>NSStringFormatSpecTypeKey</key>
300-
<string>NSStringPluralRuleType</string>
301-
<key>NSStringFormatValueTypeKey</key>
302-
<string>d</string>
303-
<key>one</key>
304-
<string>You will not be removed from the following room because you're the only administrator:</string>
305-
<key>other</key>
306-
<string>You will not be removed from the following rooms because you're the only administrator:</string>
307-
</dict>
308-
</dict>
309293
<key>screen_pinned_timeline_screen_title</key>
310294
<dict>
311295
<key>NSStringLocalizedFormatKey</key>

ElementX/Sources/FlowCoordinators/SpaceExplorerFlowCoordinator.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ class SpaceExplorerFlowCoordinator: FlowCoordinatorProtocol {
104104
return .spaceList(selectedSpaceID: nil)
105105
} handler: { [weak self] _ in
106106
guard let self else { return }
107+
navigationSplitCoordinator.setDetailCoordinator(nil) // If we forget to do this, the tab bar remains hidden.
107108
selectedSpaceSubject.send(nil)
108109
spaceFlowCoordinator = nil
109110
}

ElementX/Sources/Generated/Strings.swift

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ internal enum L10n {
242242
internal static var actionManageDevices: String { return L10n.tr("Localizable", "action_manage_devices") }
243243
/// Message
244244
internal static var actionMessage: String { return L10n.tr("Localizable", "action_message") }
245+
/// Minimise
246+
internal static var actionMinimize: String { return L10n.tr("Localizable", "action_minimize") }
245247
/// Next
246248
internal static var actionNext: String { return L10n.tr("Localizable", "action_next") }
247249
/// No
@@ -336,6 +338,8 @@ internal enum L10n {
336338
internal static var actionTryAgain: String { return L10n.tr("Localizable", "action_try_again") }
337339
/// Unpin
338340
internal static var actionUnpin: String { return L10n.tr("Localizable", "action_unpin") }
341+
/// View
342+
internal static var actionView: String { return L10n.tr("Localizable", "action_view") }
339343
/// View in timeline
340344
internal static var actionViewInTimeline: String { return L10n.tr("Localizable", "action_view_in_timeline") }
341345
/// View source
@@ -484,6 +488,8 @@ internal enum L10n {
484488
internal static var commonInviteUnknownProfile: String { return L10n.tr("Localizable", "common_invite_unknown_profile") }
485489
/// Leaving room
486490
internal static var commonLeavingRoom: String { return L10n.tr("Localizable", "common_leaving_room") }
491+
/// Leaving space
492+
internal static var commonLeavingSpace: String { return L10n.tr("Localizable", "common_leaving_space") }
487493
/// Light
488494
internal static var commonLight: String { return L10n.tr("Localizable", "common_light") }
489495
/// Line copied to clipboard
@@ -1808,18 +1814,18 @@ internal enum L10n {
18081814
internal static var screenKnockRequestsListInitialLoadingTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_initial_loading_title") }
18091815
/// Requests to join
18101816
internal static var screenKnockRequestsListTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_title") }
1811-
/// (Admin)
1812-
internal static var screenLeaveSpaceLastAdminInfo: String { return L10n.tr("Localizable", "screen_leave_space_last_admin_info") }
1817+
/// %1$@ (Admin)
1818+
internal static func screenLeaveSpaceLastAdminInfo(_ p1: Any) -> String {
1819+
return L10n.tr("Localizable", "screen_leave_space_last_admin_info", String(describing: p1))
1820+
}
18131821
/// Plural format key: "%#@COUNT@"
18141822
internal static func screenLeaveSpaceSubmit(_ p1: Int) -> String {
18151823
return L10n.tr("Localizable", "screen_leave_space_submit", p1)
18161824
}
18171825
/// Select the rooms you’d like to leave which you're not the only administrator for:
18181826
internal static var screenLeaveSpaceSubtitle: String { return L10n.tr("Localizable", "screen_leave_space_subtitle") }
1819-
/// Plural format key: "%#@COUNT@"
1820-
internal static func screenLeaveSpaceSubtitleOnlyLastAdmin(_ p1: Int) -> String {
1821-
return L10n.tr("Localizable", "screen_leave_space_subtitle_only_last_admin", p1)
1822-
}
1827+
/// You will not be removed from the following room(s) because you're the only administrator:
1828+
internal static var screenLeaveSpaceSubtitleOnlyLastAdmin: String { return L10n.tr("Localizable", "screen_leave_space_subtitle_only_last_admin") }
18231829
/// Leave %1$@?
18241830
internal static func screenLeaveSpaceTitle(_ p1: Any) -> String {
18251831
return L10n.tr("Localizable", "screen_leave_space_title", String(describing: p1))
@@ -3340,11 +3346,6 @@ internal enum L10n {
33403346
internal static var yourAvatar: String { return L10n.tr("Localizable", "a11y.your_avatar") }
33413347
}
33423348

3343-
internal enum Action {
3344-
/// View
3345-
internal static var view: String { return L10n.tr("Localizable", "action.view") }
3346-
}
3347-
33483349
internal enum Common {
33493350
/// Add an account
33503351
internal static var addAccount: String { return L10n.tr("Localizable", "common.add_account") }

0 commit comments

Comments
 (0)