Skip to content

Conversation

@adalpari
Copy link
Contributor

@adalpari adalpari commented Sep 18, 2025

Description

This PR is adding the filesize information to the media setting activity for WP.COM sites.

Note that the feature was already added for Application Password supported sites here. However, for dotcom sites, the filesize is already formatted in a string format. So, the same field cannot be reused. A new field has been added for that purpose.

Testing instructions

  1. Log into a WP.COM site
  2. Go to Media -> Open any of the media file
  • Verify you DO see the filesize
Screen.Recording.2025-09-18.at.14.53.12.mov

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 18, 2025

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr22220-a2a1a50
Commita2a1a50
Direct Downloadwordpress-prototype-build-pr22220-a2a1a50.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 18, 2025

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr22220-a2a1a50
Commita2a1a50
Direct Downloadjetpack-prototype-build-pr22220-a2a1a50.apk
Note: Google Login is not supported on these builds.

@adalpari adalpari requested a review from Copilot September 18, 2025 12:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds filesize display functionality specifically for WordPress.com sites in the media settings screen. For WP.com sites, the filesize comes pre-formatted as a string from the API, unlike self-hosted sites where raw numeric values need formatting.

  • Adds a new database field FILE_SIZE_FORMATTED to store pre-formatted filesize strings
  • Updates the WP.com API response handling to capture the size field
  • Modifies the media settings UI to display formatted filesize for WP.com sites

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
WellSqlConfig.kt Increments database version and adds migration for new filesize formatted field
MediaWPComRestResponse.java Adds size field to capture formatted filesize from WP.com API
MediaResponseUtils.kt Updates response mapping logic with incomplete implementation
MediaWPRestResponse.kt Fixes trailing comma in constructor call
MediaModel.java Adds new field and getter/setter methods for formatted filesize
MediaSettingsActivity.java Updates UI logic to display formatted filesize for WP.com sites

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@adalpari adalpari marked this pull request as ready for review September 18, 2025 13:01
@adalpari adalpari changed the title CMM 761: add filesize to the media screen (wp.com sites) CMM-761: add filesize to the media screen (wp.com sites) Sep 18, 2025
@codecov
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.22%. Comparing base (3e7e021) to head (a2a1a50).
⚠️ Report is 2 commits behind head on trunk.

Files with missing lines Patch % Lines
...uxc/network/rest/wpcom/media/MediaResponseUtils.kt 0.00% 1 Missing ⚠️
...rdpress/android/fluxc/persistence/WellSqlConfig.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #22220   +/-   ##
=======================================
  Coverage   39.22%   39.22%           
=======================================
  Files        2164     2164           
  Lines      103310   103310           
  Branches    15881    15881           
=======================================
  Hits        40522    40522           
  Misses      59193    59193           
  Partials     3595     3595           

☔ 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.

Copy link
Member

@dcalhoun dcalhoun left a comment

Choose a reason for hiding this comment

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

Testing worked well for me. 🎉

I did note that MOV files return a zero file size. I presume this is a server-side issue.

MOV file zero size

Image

@adalpari
Copy link
Contributor Author

I did note that MOV files return a zero file size. I presume this is a server-side issue.

Yes, if we are showing the field, it means that the field is returned that way from the server. Does it happen if you browse the file in the web app?
Who should I report the issue?

@dcalhoun
Copy link
Member

I did note that MOV files return a zero file size. I presume this is a server-side issue.

Yes, if we are showing the field, it means that the field is returned that way from the server. Does it happen if you browse the file in the web app? Who should I report the issue?

The web implementation shows an empty value. I'm not sure where we might report this issue. It's unclear to me if this is a VideoPress, WPCOM, or WordPress Core issue.

image

Base automatically changed from feature/CMM-628-Add-filesize-to-the-media-screen to trunk September 18, 2025 17:02
…creen-(WP.COM-sites)

# Conflicts:
#	WordPress/src/main/java/org/wordpress/android/ui/media/MediaSettingsActivity.java
#	libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/MediaModel.java
#	libs/fluxc/src/main/java/org/wordpress/android/fluxc/persistence/WellSqlConfig.kt
@adalpari adalpari enabled auto-merge (squash) September 19, 2025 07:14
@sonarqubecloud
Copy link

@adalpari adalpari merged commit 93fb670 into trunk Sep 19, 2025
26 checks passed
@adalpari adalpari deleted the feature/CMM-761-Add-filesize-to-the-media-screen-(WP.COM-sites) branch September 19, 2025 07:41
@dcalhoun dcalhoun added this to the 26.3 milestone Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants