Skip to content

Only load full media on media viewer when it's the visible item#6794

Open
jmartinesp wants to merge 3 commits into
developfrom
fix/load-full-media-only-for-current-item
Open

Only load full media on media viewer when it's the visible item#6794
jmartinesp wants to merge 3 commits into
developfrom
fix/load-full-media-only-for-current-item

Conversation

@jmartinesp
Copy link
Copy Markdown
Member

@jmartinesp jmartinesp commented May 15, 2026

Content

In the media viewer screen:

  • Only load the full media for the currently displayed item.
  • Cancel loading the full media for items if you scroll to another item.

Motivation and context

Fixes #6792.

What's not addressed but could also be useful:

  • Loading the full media only when using Wi-Fi.
  • Delay loading the full media for videos until the play button is clicked on.

Screenshots / GIFs

No UI changes, I hope.

Tests

Open the media viewer in a room where you have a mix of images and videos. Check the logs only contain /download log lines for the current item, and if you scroll fast enough you see logs for cancelled downloads.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 15

Checklist

  • This PR was made with the help of AI:
    • Yes. In this case, please request a review by Copilot.
    • No.
  • 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 defines 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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 15, 2026

📱 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/ViCwWF

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

❌ Patch coverage is 55.55556% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.28%. Comparing base (cbc677b) to head (59b8a81).

Files with missing lines Patch % Lines
...s/mediaviewer/impl/viewer/MediaViewerDataSource.kt 33.33% 4 Missing and 2 partials ⚠️
...es/mediaviewer/impl/viewer/MediaViewerPresenter.kt 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6794      +/-   ##
===========================================
- Coverage    81.29%   81.28%   -0.01%     
===========================================
  Files         2648     2648              
  Lines        74122    74134      +12     
  Branches      9606     9614       +8     
===========================================
+ Hits         60255    60259       +4     
- Misses       10323    10328       +5     
- Partials      3544     3547       +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.

@jmartinesp jmartinesp added the PR-Bugfix For bug fix label May 15, 2026
@jmartinesp jmartinesp marked this pull request as ready for review May 15, 2026 15:07
@jmartinesp jmartinesp requested a review from a team as a code owner May 15, 2026 15:07
@jmartinesp jmartinesp requested review from bmarty and removed request for a team May 15, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Bugfix For bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Media viewer automatically downloads media for current and adjacent items

1 participant