-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CMM 628 add filesize to the media screen #22216
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
CMM 628 add filesize to the media screen #22216
Conversation
There was a problem hiding this 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 file size display functionality to media details screens, showing file sizes in human-readable format (KB, MB, GB) for sites using Application Password authentication.
- Adds file size field to MediaModel and database schema
- Implements file size parsing from media API responses for all media types
- Adds UI components to display formatted file size in MediaSettingsActivity
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| WellSqlConfig.kt | Database migration to add FILE_SIZE column to MediaModel table |
| MediaRSApiRestClient.kt | Parse and populate file size from API responses for all media types |
| MediaModel.java | Add file size field, getter/setter methods, and equality comparison |
| strings.xml | Add file size caption string resource |
| media_settings_activity.xml | Add UI layout for file size display with label and value |
| MediaSettingsActivity.java | Display formatted file size with conditional visibility logic |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| final String[] units = new String[] { | ||
| getString(R.string.file_size_in_bytes), | ||
| getString(R.string.file_size_in_kilobytes), | ||
| getString(R.string.file_size_in_megabytes), | ||
| getString(R.string.file_size_in_gigabytes), | ||
| getString(R.string.file_size_in_terabytes) | ||
| }; |
Copilot
AI
Sep 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code references string resources (file_size_in_bytes, file_size_in_kilobytes, etc.) that are not defined in the strings.xml file. This will cause a compilation error or runtime crash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An aside: is it typical to use lowercase for kB, but uppercase for MB, GB, TB? The divergence seems odd to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lowercase kB is even more odd now that I note that the server-provided values for WPCOM sites in #22220 return KB. I suggest we update the string from kB → KB. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I'll update it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generated by 🚫 Danger |
| } | ||
|
|
||
| 209 -> { | ||
| db.execSQL("ALTER TABLE MediaModel ADD FILE_SIZE INTEGER") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I tested how the library creates the DB column, it looks like even it being a long variable, WellSql uses an INTEGER. So, I've just followed the approach to avoid side problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the "library" in this context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WellSql. The library used to manage MySql DB.
|
| App Name | WordPress |
|
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22216-03b2deb | |
| Commit | 03b2deb | |
| Direct Download | wordpress-prototype-build-pr22216-03b2deb.apk |
|
| App Name | Jetpack |
|
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22216-03b2deb | |
| Commit | 03b2deb | |
| Direct Download | jetpack-prototype-build-pr22216-03b2deb.apk |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22216 +/- ##
=======================================
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. 🚀 New features to boost your workflow:
|
| private SeekBar mImageSizeSeekBarView; | ||
| private Spinner mAlignmentSpinnerView; | ||
| private FloatingActionButton mFabView; | ||
| private TextView mFileSizeView; |
Check notice
Code scanning / Android Lint
Nullable/NonNull annotation missing on field Note
| private Spinner mAlignmentSpinnerView; | ||
| private FloatingActionButton mFabView; | ||
| private TextView mFileSizeView; | ||
| private TextView mFileSizeLabelView; |
Check notice
Code scanning / Android Lint
Nullable/NonNull annotation missing on field Note
dcalhoun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| 209 -> { | ||
| db.execSQL("ALTER TABLE MediaModel ADD FILE_SIZE INTEGER") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the "library" in this context?
| final String[] units = new String[] { | ||
| getString(R.string.file_size_in_bytes), | ||
| getString(R.string.file_size_in_kilobytes), | ||
| getString(R.string.file_size_in_megabytes), | ||
| getString(R.string.file_size_in_gigabytes), | ||
| getString(R.string.file_size_in_terabytes) | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An aside: is it typical to use lowercase for kB, but uppercase for MB, GB, TB? The divergence seems odd to me.
|







Description
Added file size display functionality to the media details screens. The file size is now shown in a human-readable format (KB, MB, GB) in MediaSettingsActivity.
This new functionality has been added only to site logged in with Application Password. Will add it to WP sites in the next iteration.
Testing instructions
Screen.Recording.2025-09-17.at.12.43.07.mov