Skip to content

Conversation

@ganfra
Copy link
Member

@ganfra ganfra commented Dec 29, 2025

Content

After more tests on our side (and digging with the backend team), we need both kick and ban permissions to unban someone.
Also we reverted the logic for displaying banned users to having the ban permission.

Motivation and context

Better ux.

Screenshots / GIFs

No ui change.

Tests

  • Tweaks the PowerLevel so you have the PL for ban but not kick
  • Long click on a member in the member list
  • Check you can only ban the member
  • Go to the banned tabs, and check you cannot unban him.

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

@ganfra ganfra added the PR-Bugfix For bug fix label Dec 29, 2025
@ganfra ganfra marked this pull request as ready for review December 29, 2025 19:46
@ganfra ganfra requested a review from a team as a code owner December 29, 2025 19:46
@ganfra ganfra requested review from bmarty and removed request for a team December 29, 2025 19:46
@github-actions
Copy link
Contributor

github-actions bot commented Dec 29, 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/Qz2oep

@ganfra ganfra added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Dec 30, 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 Dec 30, 2025
@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

❌ Patch coverage is 54.54545% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.40%. Comparing base (5ced2cc) to head (2fa4994).
⚠️ Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
...ermoderation/impl/RoomMemberModerationPresenter.kt 55.55% 2 Missing and 2 partials ⚠️
...es/roomdetails/impl/members/RoomMemberListState.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5959      +/-   ##
===========================================
- Coverage    81.40%   81.40%   -0.01%     
===========================================
  Files         2535     2535              
  Lines        67624    67626       +2     
  Branches      8669     8669              
===========================================
- Hits         55050    55049       -1     
- Misses        9365     9367       +2     
- Partials      3209     3210       +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.

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks. A bit annoying that no unit tests have to be updated after this change. It means that some unit tests are missing.

when (membership) {
RoomMembershipState.BAN -> {
// Unban requires both kick and ban permission instead of a dedicated unban permission
if (permissions.canBan && permissions.canKick) {
Copy link
Member

Choose a reason for hiding this comment

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

A detail, but maybe move the logic and comment to RoomMemberModerationPermissions like this:

// Unban requires both kick and ban permission instead of a dedicated unban permission
val canUnban = canKick && canBan

@ganfra ganfra enabled auto-merge December 30, 2025 14:59
@sonarqubecloud
Copy link

@ganfra ganfra merged commit 3973616 into develop Dec 30, 2025
30 of 32 checks passed
@ganfra ganfra deleted the feature/fga/ban_moderation branch December 30, 2025 15:17
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.

3 participants