Adapt 'change roles' screens to the new creator/owner role (#5076)

* Replace `RoomMember.Role.CREATOR` with `RoomMember.Role.Owner` - Make `RoomMember.Role` a sealed interface instead

* Adapt room member role mapping to include the power level to distinguish between admins and owners

* Use new `RoomMember.Role` sealed interface through the app

* Change how `MembersByRole` groups members to add owners to the admins section

* Adapt the `ChangeRoles` screen to the new roles:
    - Owners can't modify other owner's roles.
    - They can modify the roles of any other user, without confirmation.

* Adapt 'roles and permissions' screen:
    - Owners can't demote themselves.
    - The admin count also counts owners.

* Add more tests and screenshots

* Add owners to its own section in the 'change roles' screen

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
Jorge Martin Espinosa 2025-07-29 16:07:16 +02:00 committed by GitHub
parent 4534229e84
commit 51f67741ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
77 changed files with 663 additions and 301 deletions

View file

@ -157,7 +157,7 @@ internal fun SuggestionsPickerViewPreview() {
powerLevel = 0L,
normalizedPowerLevel = 0L,
isIgnored = false,
role = RoomMember.Role.USER,
role = RoomMember.Role.User,
membershipChangeReason = null,
)
val anAlias = remember { RoomAlias("#room:domain.org") }