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

[Feature] Render m.sticker events #2122

Merged
merged 15 commits into from
Jan 2, 2024

Conversation

surakin
Copy link
Contributor

@surakin surakin commented Dec 28, 2023

Render m.sticker events

Closes #1949

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Added rendering of sticker events (both the event and the reply preview)

Motivation and context

This solves #1949.
I mostly use matrix to talk via whatsapp bridges and this fixes having to switch to whatsapp just to see what sticker someone just sent.

Screenshots / GIFs

image

Tests

I sent myself stickers using Cinny web and Whatsapp and check them in both the emulator & my own phone

Tested devices

  • Physical
  • Emulator
  • OS version(s):
    Android 13 & 14

Checklist

Signed-off-by: Marco Antonio Alvarez [email protected]

@surakin surakin requested a review from a team as a code owner December 28, 2023 16:46
@surakin surakin requested review from jmartinesp and removed request for a team December 28, 2023 16:46
@surakin surakin marked this pull request as draft December 28, 2023 16:49
@bmarty bmarty added the Z-Community-PR Issue is solved by a community member's PR label Dec 28, 2023
@jmartinesp
Copy link
Member

Thanks for the contribution!

  • The code seems to work quite well, although there are some minor issues with the way the sticker is displayed and the timestamp: in this when clause you can see how items with media (image, video, location, etc.) are displayed in an Overlay mode, the same thing should be done for stickers.
  • The issue with API 23 is being handled at the moment, don't worry about that check.
  • Also, you'll need to create a commit with a sign-off for this to be approved and merged.

Once you mark this as ready for review I'll give it some more thorough review.

@surakin surakin marked this pull request as ready for review December 29, 2023 11:32
@jmartinesp jmartinesp added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Dec 29, 2023
@surakin surakin changed the title [Feature] Render m.sticker events [Draft] [Feature] Render m.sticker events Dec 29, 2023
@surakin
Copy link
Contributor Author

surakin commented Dec 29, 2023

  • The code seems to work quite well, although there are some minor issues with the way the sticker is displayed and the timestamp: in this when clause you can see how items with media (image, video, location, etc.) are displayed in an Overlay mode, the same thing should be done for stickers.

I'm wondering if showing the timestamp below the sticker would be better, because stickers are quite small and you can't open them, so you'll always get some of it hidden by the timestamp overlay

Like this:
image

@bmarty
Copy link
Member

bmarty commented Dec 29, 2023

Thanks for your contribution @surakin !

you can't open them

Maybe a onClick support to view the sticker in the MediaViewer? Element Android allows this (but not Element Web).

@surakin
Copy link
Contributor Author

surakin commented Dec 29, 2023

Thanks for your contribution @surakin !

you can't open them

Maybe a onClick support to view the sticker in the MediaViewer? Element Android allows this (but not Element Web).

Ah yes, that would do, trying that.

@jmartinesp jmartinesp removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Dec 30, 2023
@jmartinesp
Copy link
Member

@surakin sorry for the bumpy process, but I think it's the actual 1st contribution to be merged in the repo and we're seeing some issues with our CI processes and forks 😓 .

Since you made some changes to the previews we now need to update the screenshots, but that's proven to be problematic if it's done locally on your PC, so we use the CI for that. However, I'm not 100% sure on how to proceed when forks are involved.

Now that #2141 has been merged, could you either merge or rebase the latest changes in develop and run the Record screenshots for your branch in your repo? It's a bit weird because I can't see the GH action workflow displayed there, but maybe it's a permission issue.

Otherwise, maybe installing the Github CLI and using this command would generate the new screenshots in the uploaded branch:

gh workflow run recordScreenshots.yml --ref (git rev-parse --abbrev-ref HEAD)

@jmartinesp
Copy link
Member

It worked, thanks! There are a lot of extra screenshots, but that's normal, given some issues on how Paparazzi names screenshots.

@surakin
Copy link
Contributor Author

surakin commented Jan 2, 2024

I think it's the actual 1st contribution to be merged in the repo

Am I the first? Yay me! 🥳

@jmartinesp
Copy link
Member

@surakin it seems like the CI got stuck after the screenshots were generated and I can't approve it... Could you make some change, like a no-op commit or rebasing the existing content so it's triggered again?

@surakin
Copy link
Contributor Author

surakin commented Jan 2, 2024

did that help?

@jmartinesp
Copy link
Member

did that help?

Yes, it's running now. Thank you again!

@jmartinesp
Copy link
Member

It seems like there are some failing tests in :libraries:push:impl related to the stickers, could you fix those?

Signed-off-by: Marco Antonio Alvarez <[email protected]>
@surakin
Copy link
Contributor Author

surakin commented Jan 2, 2024

Ups, missed that one. Fixed.

Copy link

codecov bot commented Jan 2, 2024

Codecov Report

Attention: 48 lines in your changes are missing coverage. Please review.

Comparison is base (2134004) 67.05% compared to head (fdf29af) 67.02%.

Files Patch % Lines
...ctories/event/TimelineItemContentMessageFactory.kt 0.00% 12 Missing and 1 partial ⚠️
...meline/components/event/TimelineItemStickerView.kt 56.25% 2 Missing and 5 partials ⚠️
...ctories/event/TimelineItemContentStickerFactory.kt 63.15% 1 Missing and 6 partials ⚠️
...ndroid/features/messages/impl/MessagesPresenter.kt 0.00% 4 Missing and 1 partial ⚠️
.../messages/impl/timeline/model/InReplyToMetadata.kt 0.00% 4 Missing and 1 partial ⚠️
...e/components/event/TimelineItemEventContentView.kt 0.00% 2 Missing and 1 partial ⚠️
...s/messages/impl/timeline/model/InReplyToDetails.kt 0.00% 2 Missing and 1 partial ⚠️
...eatures/messages/impl/actionlist/ActionListView.kt 0.00% 1 Missing and 1 partial ⚠️
...timeline/model/event/TimelineItemStickerContent.kt 86.66% 1 Missing and 1 partial ⚠️
...tils/messagesummary/MessageSummaryFormatterImpl.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2122      +/-   ##
===========================================
- Coverage    67.05%   67.02%   -0.04%     
===========================================
  Files         1371     1374       +3     
  Lines        34007    34116     +109     
  Branches      7487     7523      +36     
===========================================
+ Hits         22805    22867      +62     
- Misses        7587     7615      +28     
- Partials      3615     3634      +19     

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

@jmartinesp jmartinesp added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jan 2, 2024
Signed-off-by: Marco Antonio Alvarez <[email protected]>
@jmartinesp jmartinesp removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jan 2, 2024
Signed-off-by: Marco Antonio Alvarez <[email protected]>
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.

Everything looks good now, thanks! The Maestro checks won't pass because of GH limitations of CI in forks, so I'll just skip them.

@jmartinesp jmartinesp merged commit 87c8bc1 into element-hq:develop Jan 2, 2024
11 of 13 checks passed
@surakin
Copy link
Contributor Author

surakin commented Jan 2, 2024

What about codecov? Should I worry about that? (first time I see it)

@jmartinesp
Copy link
Member

No, it's ok. The coverage dropped a bit because a lot of code was added and only some of it could be tested, but it's no big deal. Thanks again!

@surakin
Copy link
Contributor Author

surakin commented Jan 2, 2024

Awesome! Happy to help 🥳

@surakin surakin deleted the render_stickers branch January 2, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for rendering m.sticker Event.
3 participants