Skip to content

Conversation

@bmarty
Copy link
Member

@bmarty bmarty commented Nov 20, 2025

Content

Ensure confirmation dialog is displayed when an admin add other admin to a room.
An issue in the code made admin of room owners with higher power level and in this case confirmation dialog does not have to be displayed.

Take the opportunity to cleanup the code, and add the room version rendering in the room details when developer mode is on.

Motivation and context

Closes https://github.com/element-hq/customer-success/issues/647

Screenshots / GIFs

Tests

  • In a room before version 12 where you are an admin, go to the screen to edit admin
  • Add an admin
  • Click save
  • observe that the confirmation dialog is displayed as expected

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner November 20, 2025 17:20
@bmarty bmarty added the PR-Bugfix For bug fix label Nov 20, 2025
@bmarty bmarty requested review from jmartinesp and removed request for a team November 20, 2025 17:20
@github-actions
Copy link
Contributor

github-actions bot commented Nov 20, 2025

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/A2785C

Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments, I'm just waiting for the tests to pass before approving. Thanks for fixing these issues!

}

val hasPendingChanges = usersWithRole.value != selectedUsers.value
val hasPendingChanges = usersWithRole.value.toSet() != selectedUsers.value.toSet()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this will be executed in every recomposition maybe we should have it inside a remember { derivedStateOf { ... } } so we don't create two new sets every time.

Comment on lines +746 to +750
Text("Room version")
},
supportingContent = {
Text(
text = roomVersion ?: "Unknown",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have some localazy strings for these?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be handled as a global task to add all the strings from the developer settings to Localazy. For now I think we should not care.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured that was the case, but since this is a developer UI even though it's not in the developer settings I wanted to double check first 👍 .

Copy link
Member Author

@bmarty bmarty Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe one day lint will complain about hard-coded string like it used to do in Android Views, but for now let's be lazy!

*/
fun RoomInfo.roleOf(userId: UserId): RoomMember.Role {
return if (creators.contains(userId)) {
return if (privilegedCreatorRole && creators.contains(userId)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nice catch!

@bmarty bmarty added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Nov 21, 2025
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Nov 21, 2025
@sonarqubecloud
Copy link

@bmarty bmarty enabled auto-merge November 21, 2025 15:50
@bmarty bmarty merged commit e8e257d into develop Nov 21, 2025
29 of 30 checks passed
@bmarty bmarty deleted the feature/bma/addAdminConfirmation branch November 21, 2025 16:06
@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

❌ Patch coverage is 88.63636% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.54%. Comparing base (16e4c93) to head (c10bea0).
⚠️ Report is 18 commits behind head on develop.

Files with missing lines Patch % Lines
...sandpermissions/impl/roles/ChangeRolesPresenter.kt 81.81% 0 Missing and 2 partials ⚠️
...droid/features/roomdetails/impl/RoomDetailsView.kt 77.77% 0 Missing and 2 partials ⚠️
.../rolesandpermissions/impl/roles/ChangeRolesView.kt 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5786   +/-   ##
========================================
  Coverage    79.53%   79.54%           
========================================
  Files         2444     2446    +2     
  Lines        65574    65593   +19     
  Branches      8352     8355    +3     
========================================
+ Hits         52157    52176   +19     
+ Misses       10438    10437    -1     
- Partials      2979     2980    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Bugfix For bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants