Add special flow for leaving a space as the last owner (#6112)

* When the user is in a v12 room, use different UI to select the last owner when leaving

- Add `LeaveSpaceRoom.areCreatorsPrivileged` to detect when this is happening.
- Import new strings.
- Build the new UI.
- Attach it to a change member roles screen navigation.

* Don't display the `isLastOwner` UI if the user is the only joined one in the room

* Rename `LeaveSpaceState.isLastOwner` to `.needsOwnerChange`. This way, it's easier to understand the difference with the passed `LeaveSpaceRoom.isLastOwner` value

* Add a test for the new check of user not being the last joined member

* Fix paddings in `LeaveSpaceView`

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
Jorge Martin Espinosa 2026-01-30 10:10:00 +01:00 committed by GitHub
parent e34b15823e
commit 63f24f0ae1
36 changed files with 212 additions and 114 deletions

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="screen_leave_space_choose_owners_action">"Choose owners"</string>
<string name="screen_leave_space_last_admin_info">"%1$s (Admin)"</string>
<plurals name="screen_leave_space_submit">
<item quantity="one">"Leave %1$d room and space"</item>
@ -7,9 +8,11 @@
</plurals>
<string name="screen_leave_space_subtitle">"Select the rooms youd like to leave which you\'re not the only administrator for:"</string>
<string name="screen_leave_space_subtitle_last_admin">"You need to assign another admin for this space before you can leave."</string>
<string name="screen_leave_space_subtitle_last_owner">"You are the only owner of %1$s. You need to transfer ownership to someone else before you leave."</string>
<string name="screen_leave_space_subtitle_only_last_admin">"You will not be removed from the following room(s) because you\'re the only administrator:"</string>
<string name="screen_leave_space_title">"Leave %1$s?"</string>
<string name="screen_leave_space_title_last_admin">"You are the only admin for %1$s"</string>
<string name="screen_leave_space_title_last_owner">"Transfer ownership"</string>
<string name="screen_space_add_room_action">"Room"</string>
<string name="screen_space_add_rooms_room_access_description">"Adding a room will not affect the room access. To change the access go to Room settings &gt; Security &amp; privacy."</string>
<string name="screen_space_empty_state_title">"Add your first room"</string>