Skip to content

Iterate on avatar to be able to render Space avatar. #4921

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

Merged
merged 7 commits into from
Jun 23, 2025

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Jun 23, 2025

Content

Introduce AvatarType sealed interface to be able to render Avatar depending on specific parameters for room and space.

RoomAvatar still exists but is now internal to the UI module.
Also set avatar type to room where is was missing.

Motivation and context

Be able to render Space avatar.

UI iteration for space avatar may happen later.

Screenshots / GIFs

See recorded one, there should be no change on the existing code.

Tests

  • Perform some smoke tests.

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 June 23, 2025 15:32
@bmarty bmarty requested review from jmartinesp and removed request for a team June 23, 2025 15:32
@bmarty bmarty added the PR-Misc For other changes label Jun 23, 2025
Copy link
Contributor

github-actions bot commented Jun 23, 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/Qf7i6N

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.

This is quite nice, I really like the new structure, congrats! I have a couple of suggestions, but LGTM!

avatarData: AvatarData,
avatarType: AvatarType.Space,
modifier: Modifier = Modifier,
isTombstoned: Boolean = false,
Copy link
Member

Choose a reason for hiding this comment

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

Can we add the isTombstoned property to the AvatarType.Space too? This way it's consistent with AvatarType.Room.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yes true, good catch! 59aec12

import androidx.compose.ui.graphics.Shape

@Composable
fun avatarShape(
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this could be AvatarType.avatarShape() instead? That way it won't appear by default in the method autocompletion.

Copy link
Member Author

Choose a reason for hiding this comment

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

Better, thanks! 2bcffe8

Copy link

codecov bot commented Jun 23, 2025

Codecov Report

Attention: Patch coverage is 90.42553% with 18 lines in your changes missing coverage. Please review.

Project coverage is 80.30%. Comparing base (ae96bc6) to head (2bcffe8).
Report is 8 commits behind head on develop.

Files with missing lines Patch % Lines
...ries/designsystem/components/avatar/SpaceAvatar.kt 68.18% 6 Missing and 1 partial ⚠️
...libraries/designsystem/components/avatar/Avatar.kt 79.31% 4 Missing and 2 partials ⚠️
...es/designsystem/components/avatar/AvatarCluster.kt 80.00% 0 Missing and 2 partials ⚠️
...ries/designsystem/components/avatar/ImageAvatar.kt 96.66% 0 Missing and 1 partial ⚠️
...aries/designsystem/components/avatar/RoomAvatar.kt 94.44% 0 Missing and 1 partial ⚠️
...ndroid/libraries/roomselect/impl/RoomSelectView.kt 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           develop    #4921    +/-   ##
=========================================
  Coverage    80.29%   80.30%            
=========================================
  Files         2156     2161     +5     
  Lines        57379    57484   +105     
  Branches      7225     7237    +12     
=========================================
+ Hits         46074    46162    +88     
- Misses        8857     8871    +14     
- Partials      2448     2451     +3     

☔ 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.

@bmarty bmarty enabled auto-merge June 23, 2025 16:37
Copy link

@bmarty bmarty merged commit 21e04e1 into develop Jun 23, 2025
28 of 29 checks passed
@bmarty bmarty deleted the feature/bma/spaceAvatar branch June 23, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Misc For other changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants