WordPress-iOS icon indicating copy to clipboard operation
WordPress-iOS copied to clipboard

Add filesize in media item view controlller

Open hoangatuan opened this issue 1 year ago • 1 comments

Fixes #22737

To test:

Regression Notes

  1. Potential unintended areas of impact: n/a
  2. What I did to test those areas of impact (or what existing automated tests I relied on): n/a
  3. What automated tests I added (or what prevented me from doing so): n/a

PR submission checklist:

  • [x] I have completed the Regression Notes.
  • [x] I have considered adding unit tests for my changes.
  • [x] I have considered adding accessibility improvements for my changes.
  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing checklist:

  • [ ] WordPress.com sites and self-hosted Jetpack sites.
  • [ ] Portrait and landscape orientations.
  • [ ] Light and dark modes.
  • [ ] Fonts: Larger, smaller and bold text.
  • [ ] High contrast.
  • [ ] VoiceOver.
  • [ ] Languages with large words or with letters/accents not frequently used in English.
  • [ ] Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • [ ] iPhone and iPad.
  • [ ] Multi-tasking: Split view and Slide over. (iPad)

Attachments

Header Header
Simulator Screenshot - iPhone 15 Pro - 2024-04-10 at 17 34 16 Simulator Screenshot - iPhone 15 Pro - 2024-04-10 at 17 34 10

hoangatuan avatar Apr 10 '24 13:04 hoangatuan

Hey, @hoangatuan. Thank you for addressing it, as it's been an outstanding item for a long time. However, it will require a bit more work. The issue is that the current Media.filesize is used only for local uploads, and so it's present only for files uploaded from the current device. In order to make it work for remote media assets, we'll need to extend the data model.

There is an open PR to add size to WordPresssKit https://github.com/wordpress-mobile/WordPressKit-iOS/pull/647. Unfortunately, the site it returns is a pre-formatted string so there is no way to store it in Media.filesize. This is were the work currently stopped.

kean avatar Apr 22 '24 13:04 kean

I'm going to close it for now because the PR appears to be stale as, as pointed out in the following comment it will need to be updated when the API is updated. I think it might be worth tying it to the wordpress-rs, cc @jkmassel .

kean avatar Sep 11 '24 23:09 kean