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

Iteration on caption #3816

Merged
merged 6 commits into from
Nov 6, 2024
Merged

Iteration on caption #3816

merged 6 commits into from
Nov 6, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Nov 6, 2024

Content

This PR is following #3803 .

  • Improve the last message preview in the room list for media. Either use the caption, or use the filename, as per EX on iOS.
  • Ensure that filename of voice message are not rendered to the user.
  • Render the caption in the notification, below the image.
  • Other small bug fixes.

Motivation and context

Polish the application

Screenshots / GIFs

Tests

  • Alice send media with caption to Bob
  • Bob can see the caption in the notification, and in the room list

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 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 Nov 6, 2024
@bmarty bmarty requested a review from a team as a code owner November 6, 2024 10:13
@bmarty bmarty requested review from jmartinesp and removed request for a team November 6, 2024 10:13
@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 Nov 6, 2024
Copy link
Contributor

github-actions bot commented Nov 6, 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/kM8imK

Copy link

sonarcloud bot commented Nov 6, 2024

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 75.75758% with 8 lines in your changes missing coverage. Please review.

Project coverage is 83.01%. Comparing base (47d7eac) to head (f2c63a5).
Report is 24 commits behind head on develop.

Files with missing lines Patch % Lines
...pl/notifications/DefaultNotifiableEventResolver.kt 66.66% 1 Missing and 2 partials ⚠️
...mpl/notifications/factories/NotificationCreator.kt 71.42% 0 Missing and 2 partials ⚠️
...timeline/components/event/TimelineItemVideoView.kt 80.00% 0 Missing and 1 partial ⚠️
...atter/impl/DefaultPinnedMessagesBannerFormatter.kt 50.00% 0 Missing and 1 partial ⚠️
...tformatter/impl/DefaultRoomLastMessageFormatter.kt 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3816      +/-   ##
===========================================
- Coverage    83.02%   83.01%   -0.01%     
===========================================
  Files         1772     1772              
  Lines        44617    44636      +19     
  Branches      5237     5244       +7     
===========================================
+ Hits         37042    37054      +12     
- Misses        5745     5746       +1     
- Partials      1830     1836       +6     

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

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.

LGTM, thanks!

Comment on lines 32 to +34
// We cannot use Uri? type here, as that could trigger a
// NotSerializableException when persisting this to storage
val imageUriString: String?,
private val imageUriString: String?,
Copy link
Member

Choose a reason for hiding this comment

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

Not needed for this PR, but since we're no longer persisting these (I think) we might be able to use Uri again.

Copy link
Member Author

Choose a reason for hiding this comment

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

A yes, true!

@@ -316,6 +317,17 @@ class DefaultNotifiableEventResolver @Inject constructor(
}
.getOrNull()
}

private suspend fun NotificationContent.MessageLike.RoomMessage.getImageMimetype(): String? {
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't this be reused in the previous function (fetchImageIfPresent)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, maybe. Also I do not see a better way to avoid the code duplication here. I do not like using Pair.

@bmarty bmarty merged commit ebfa50c into develop Nov 6, 2024
30 of 33 checks passed
@bmarty bmarty deleted the feature/bma/moreCaptionWork branch November 6, 2024 15:01
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.

2 participants