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

Use MSC2530 filename when loading media #3567

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

frebib
Copy link
Contributor

@frebib frebib commented Sep 30, 2024

Content

In the case of captioned images, the body of the event is the caption, and is ill suited to be a filename. Often the caption can be prohibitively long, causing the media to fail to load in some cases.

Motivation and context

Fixes #2882

Screenshots / GIFs

Tests

To reproduce: Send !xkcd 2992 to https://matrix.to/#/@xkcd:spritsail.io and observe that the media will fail to load

Tested devices

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

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

In the case of captioned images, the `body` of the event is the caption,
and is ill suited to be a filename. Often the caption can be
prohibitively long, causing the media to fail to load in some cases.

Fixes: element-hq#2882
Signed-off-by: Joe Groocock <me@frebib.net>
@frebib frebib requested a review from a team as a code owner September 30, 2024 20:09
@frebib frebib requested review from bmarty and removed request for a team September 30, 2024 20:09
Copy link
Contributor

Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:

  • Your branch should be based on origin/develop, at least when it was created.
  • The title of the PR will be used for release notes, so it needs to describe the change visible to the user.
  • The test pass locally running ./gradlew test.
  • The code quality check suite pass locally running ./gradlew runQualityChecks.
  • If you modified anything related to the UI, including previews, you'll have to run the Record screenshots GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, it will prevent the CI from running temporarily, until you upload a new commit after that one. To do so, just pull the latest changes and push an empty commit.

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.67%. Comparing base (48a4a9d) to head (555f73d).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3567      +/-   ##
===========================================
- Coverage    82.68%   82.67%   -0.01%     
===========================================
  Files         1732     1732              
  Lines        40974    40982       +8     
  Branches      4964     4966       +2     
===========================================
+ Hits         33878    33883       +5     
- Misses        5341     5342       +1     
- Partials      1755     1757       +2     

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

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 for the fix! I think there is some cleanup to do in the model, now that we may have a caption, but I can handle that later.

@bmarty bmarty merged commit 249104b into element-hq:develop Sep 30, 2024
23 checks passed
@frebib frebib deleted the frebib/captioned-filename branch September 30, 2024 22:54
@bmarty bmarty mentioned this pull request Oct 1, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MSC2530 image captions are used as filenames
2 participants