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

[Gutenberg] - Filter media types when sharing files to the app #19754

Merged
merged 4 commits into from
Dec 12, 2023

Conversation

geriux
Copy link
Contributor

@geriux geriux commented Dec 7, 2023

Fixes wordpress-mobile/gutenberg-mobile#6443

Related PRs:

This PR fixes an issue when appending unsupported media types when using the Sharing functionality on Android devices.

The only way to be able to "Share" unsupported media types is when multi-selecting files that the app does support like images or videos.

For more information please check Gutenberg's PR description.


To Test:

  • Precondition: Have different kinds of files on your device: PDF, jpg, and mp4.
  • NOTE: Since this is not a release build, the editor takes a bit of time to load when adding media.
  • Install the app from this PR
  • Open your Files app
  • Multiselect an image and a PDF file
  • Tap on the Share button
  • Select the Jetpack app
  • Expect the editor to be loaded with just the supported media types (images, and videos)
Test Case 1 Test Case 2
TestCase1.mov
TestCase2.mov

Regression Notes

  1. Potential unintended areas of impact

It should only affect the editor.

  1. What I did to test those areas of impact (or what existing automated tests I relied on)

Manual tests.

  1. What automated tests I added (or what prevented me from doing so)

    • TODO

PR Submission Checklist:

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

UI Changes Testing Checklist:

  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • 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)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

@geriux geriux added Media Gutenberg Editing and display of Gutenberg blocks. labels Dec 7, 2023
@geriux geriux added this to the 24.0 milestone Dec 7, 2023
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 7, 2023

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
Versionpr19754-9db5727
Commit9db5727
Direct Downloadjetpack-prototype-build-pr19754-9db5727.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 7, 2023

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
Versionpr19754-9db5727
Commit9db5727
Direct Downloadwordpress-prototype-build-pr19754-9db5727.apk
Note: Google Login is not supported on these builds.

@geriux geriux marked this pull request as ready for review December 7, 2023 19:24
Copy link
Contributor

@justtwago justtwago left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this @geriux! Awesome work! The code looks simple and good for me 👍 I tested the change on Google Pixel 7 Pro (Android 14) and it behaved as described - no crash when selecting unsupported files to share as a new post.

I'm not sure if we can merge not stable Gutenberg version though:

    gutenbergMobileVersion = '6444-7b344ab956224ba96726111c150dc44a39be8b9e'

Reference: #19683 (comment)

@derekblank
Copy link
Contributor

I'm not sure if we can merge not stable Gutenberg version though:

Thank you for testing, @justtwago and good call out on noting the Gutenberg ref. Typically for Gutenberg PRs on WPAndroid we update the Gutenberg reference to a specific Gutenberg Mobile branch and commit to generate the CI builds. Once we merge the Gutenberg and Gutenberg Mobile PRs, we'll update the WPAndroid Gutenberg reference back to the latest Gutenberg Mobile tag before merging this PR. Here's an example.

Copy link
Contributor

@derekblank derekblank left a comment

Choose a reason for hiding this comment

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

Adding another +1 that I was able to successfully test the changes via WordPress/gutenberg#56791 (review) 🚀

@justtwago
Copy link
Contributor

Thank you for testing, @justtwago and good call out on noting the Gutenberg ref. Typically for Gutenberg PRs on WPAndroid we update the Gutenberg reference to a specific Gutenberg Mobile branch and commit to generate the CI builds. Once we merge the Gutenberg and Gutenberg Mobile PRs, we'll update the WPAndroid Gutenberg reference back to the latest Gutenberg Mobile tag before merging this PR. https://github.com/wordpress-mobile/WordPress-Android/pull/18705/commits.

Cool, thank you a lot for clarifying this, @derekblank! 💯 Totally makes sense.

@geriux
Copy link
Contributor Author

geriux commented Dec 11, 2023

Thank you both for reviewing and testing!

For this case, since these changes don't rely on the Gutenberg ones, I will revert updating the Gutenberg reference since it was just for testing the latest changes and we can update it later on either with the next release or alpha version.

@geriux geriux force-pushed the gutenberg/filter-media-sharing branch from 029b694 to c5f7c68 Compare December 12, 2023 10:08
@geriux geriux merged commit 3c7e9ce into trunk Dec 12, 2023
20 checks passed
@geriux geriux deleted the gutenberg/filter-media-sharing branch December 12, 2023 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Editing and display of Gutenberg blocks. Media
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JavascriptException: Error: Block type 'core/other' is not registered.
4 participants