Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verified user badge #3718

Merged
merged 13 commits into from
Oct 23, 2024
Merged

Verified user badge #3718

merged 13 commits into from
Oct 23, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Oct 22, 2024

Content

Show a "Verified" badge in room member detail page when the user is verified. If the user is not verified, show a disabled action to inform the user that they must use another client to verify a user.

First commits are extraction of UI component MatrixBadge and creation of MatrixBadgeRowMolecule.

Motivation and context

Closes #3684

Screenshots / GIFs

See recorded one

Tests

  • Open room member page for verified user and not verified user and observe the content.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • 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
  • Pull request includes a sign off
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner October 22, 2024 08:45
@bmarty bmarty requested review from ganfra and removed request for a team October 22, 2024 08:45
Copy link
Member Author

Choose a reason for hiding this comment

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

Oups, let me check what happened here (I am rebasing too many times this branch...)

@bmarty bmarty marked this pull request as draft October 22, 2024 08:47
Copy link
Contributor

github-actions bot commented Oct 22, 2024

📱 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/n99Sgb

@bmarty bmarty added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Oct 22, 2024
@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 Oct 22, 2024
@bmarty bmarty added the PR-Feature For a new feature label Oct 22, 2024
aUserProfileState(startDmActionState = AsyncAction.Loading),
aUserProfileState(canCall = true),
aUserProfileState(dmRoomId = null),
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 state was the same than the first one, so I removed it.

private suspend fun getUserIdentity(userId: UserId): UserIdentity {
return service.userIdentity(
userId = userId.value,
// requestFromHomeserverIfNeeded = true,
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 param will come later.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually no, I'll cleanup later.

@bmarty bmarty force-pushed the feature/bma/verifiedUserBadge branch from 4dcd271 to 596fe5e Compare October 22, 2024 12:10
@bmarty bmarty marked this pull request as ready for review October 22, 2024 12:19
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 98.07692% with 2 lines in your changes missing coverage. Please review.

Project coverage is 83.05%. Comparing base (1bfa43b) to head (4820cd0).
Report is 22 commits behind head on develop.

Files with missing lines Patch % Lines
...droid/features/roomdetails/impl/RoomDetailsView.kt 97.22% 0 Missing and 1 partial ⚠️
...oid/features/userprofile/shared/UserProfileView.kt 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3718      +/-   ##
===========================================
+ Coverage    83.02%   83.05%   +0.02%     
===========================================
  Files         1752     1753       +1     
  Lines        43787    43839      +52     
  Branches      5122     5129       +7     
===========================================
+ Hits         36355    36409      +54     
  Misses        5611     5611              
+ Partials      1821     1819       -2     

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

@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Oct 23, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Oct 23, 2024
Copy link
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

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

Some small remarks otherwise LGTM!

@@ -112,6 +113,21 @@ class RoomDetailsPresenter @Inject constructor(

val roomNotificationSettingsState by room.roomNotificationSettingsStateFlow.collectAsState()

val roomBadges by produceState(persistentListOf(), isPublic) {
Copy link
Member

Choose a reason for hiding this comment

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

If the room becomes encrypted this won't be refreshed.
I'd instead use a computed property on RoomDetailsState as we already have all the data we need in the state

Copy link
Member Author

Choose a reason for hiding this comment

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

If the room becomes encrypted this won't be refreshed.

I have seen that. We need isEncrypted property to be added in RoomInfo for fix that properly across the application.

Copy link
Member Author

@bmarty bmarty Oct 23, 2024

Choose a reason for hiding this comment

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

Done in 35867f9

type = RoomBadge.Type.Neutral,
)
}
if (roomBadge.isEmpty()) return
Copy link
Member

Choose a reason for hiding this comment

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

Good practice is to let a Composable function always have at least a root, so I'd just wrap this code in a Box

Copy link
Member Author

@bmarty bmarty Oct 23, 2024

Choose a reason for hiding this comment

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

@bmarty bmarty added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Oct 23, 2024
@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 Oct 23, 2024
Copy link

sonarcloud bot commented Oct 23, 2024

Copy link
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

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

Thanks for the changes!

@bmarty bmarty merged commit 95d95d4 into develop Oct 23, 2024
26 checks passed
@bmarty bmarty deleted the feature/bma/verifiedUserBadge branch October 23, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Feature For a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task] Show in user's profile when they have been verified
3 participants