Skip to content

Change : add tombstoned room decoration #4891

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 13 commits into from
Jun 18, 2025

Conversation

ganfra
Copy link
Member

@ganfra ganfra commented Jun 17, 2025

Content

Follow-up of #4862

Makes sure we are using the correct decoration for tombstoned room :

  • When displaying a tombstoned room, the avatar should always be an exclamation mark
  • In the room list, when the tombstoned room is not filtered, display "This room has been upgraded"

There are some additional refactoring around Avatar (you can check the commit history) :

  • AvatarCluster now replaces part of the CompositeAvatar
  • RoomAvatar makes sure to render a room avatar according to the following params :
fun RoomAvatar(
    avatarData: AvatarData,
    heroes: ImmutableList<AvatarData>,
    isTombstoned: Boolean 
)

Also now we use a StateFlow<RoomInfo>, we always have a value, so we don't need to use AsyncData for roomName and avatarData.

Motivation and context

Continuation for #4809
Figma

Screenshots / GIFs

See recorded screenshots.

Tests

  • Step 1
  • Step 2
  • Step ...

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 Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. PR-Change For updates to an existing feature labels Jun 17, 2025
@ganfra ganfra marked this pull request as ready for review June 17, 2025 18:45
@ganfra ganfra requested a review from a team as a code owner June 17, 2025 18:45
@ganfra ganfra requested review from bmarty and removed request for a team June 17, 2025 18:45
@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 Jun 17, 2025
Copy link
Contributor

github-actions bot commented Jun 17, 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/mYeEPN

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.

Nice work thanks!
I believe that the preview must be recorded. I'll check the result, but please add a preview for TombstonedRoomAvatar first.
Thanks!

import io.element.android.compound.theme.ElementTheme

@Composable
fun TombstonedRoomAvatar(
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a Preview for this specific avatar?

@bmarty
Copy link
Member

bmarty commented Jun 18, 2025

Actually screenshots can't be recorded because AvatarClusterPreview is failing if the number of avatars is not in [1,4]. I let you fix that. Thanks!

@ganfra ganfra added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Jun 18, 2025
@ganfra ganfra requested a review from bmarty June 18, 2025 10:53
@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 Jun 18, 2025
@ganfra ganfra force-pushed the feature/fga/tombstoned-room-decoration branch from 86ba74a to 2a865e6 Compare June 18, 2025 11:40
@ganfra ganfra added Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. labels Jun 18, 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 Jun 18, 2025
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!

Copy link
Member

Choose a reason for hiding this comment

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

R became a A, not sure why, but maybe not a problem (?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Because RoomAvatar was null before, not possible anymore. So no problem here 👍

Copy link

@ganfra ganfra enabled auto-merge June 18, 2025 12:53
@ElementBot
Copy link
Collaborator

Warnings
⚠️

libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/Bloom.kt#L430 - Use the KTX function createBitmap instead?

Generated by 🚫 dangerJS against b8cef93

@ganfra ganfra merged commit 7bde9bc into develop Jun 18, 2025
28 of 29 checks passed
@ganfra ganfra deleted the feature/fga/tombstoned-room-decoration branch June 18, 2025 13:08
Copy link

codecov bot commented Jun 18, 2025

Codecov Report

Attention: Patch coverage is 91.87817% with 16 lines in your changes missing coverage. Please review.

Project coverage is 80.31%. Comparing base (9133f45) to head (b8cef93).
Report is 15 commits behind head on develop.

Files with missing lines Patch % Lines
...es/designsystem/components/avatar/AvatarCluster.kt 86.66% 6 Missing and 2 partials ⚠️
.../features/roomdetails/impl/RoomDetailsPresenter.kt 0.00% 0 Missing and 1 partial ⚠️
...eatures/roomlist/impl/components/RoomSummaryRow.kt 88.88% 0 Missing and 1 partial ⚠️
...list/impl/datasource/RoomListRoomSummaryFactory.kt 0.00% 0 Missing and 1 partial ⚠️
...libraries/designsystem/components/avatar/Avatar.kt 92.85% 0 Missing and 1 partial ⚠️
...aries/designsystem/components/avatar/RoomAvatar.kt 95.65% 0 Missing and 1 partial ⚠️
...aries/designsystem/components/avatar/TextAvatar.kt 95.45% 0 Missing and 1 partial ⚠️
...gnsystem/components/avatar/TombstonedRoomAvatar.kt 90.90% 0 Missing and 1 partial ⚠️
...ndroid/libraries/matrix/ui/model/SelectRoomInfo.kt 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4891      +/-   ##
===========================================
+ Coverage    80.29%   80.31%   +0.01%     
===========================================
  Files         2152     2155       +3     
  Lines        57177    57236      +59     
  Branches      7199     7206       +7     
===========================================
+ Hits         45913    45968      +55     
  Misses        8821     8821              
- Partials      2443     2447       +4     

☔ 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-Change For updates to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants