-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Gutenberg] File Block : Consolidated Media Picker + WP Media Source integration #13413
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] File Block : Consolidated Media Picker + WP Media Source integration #13413
Conversation
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
This was done so there's a a single file picker type. Now when the Media Browser is launched with this BrowserType a file can be selected.
|
You can test the changes on this Pull Request by downloading the APK here. |
|
hey @jd-alexander , the changes look good but I've tried the APK from this PR and I don't see the File block in the GB editor. Any idea how to get it there? |
|
Hey @planarvoid I think in a case like this you might have to build Gutenberg from source. Is that enabled for you in
|
|
I just saw this error below while doing an upload. I am going to investigate it soon. It doesn't seem related to this PR though. |
|
hey @jd-alexander , why would that be necessary? I just want to test the changes. Why wouldn't everything be in the APK on this PR? Should this flag be enabled for the Jalapeno build? |
Good question! I moved the conversation into Slack to verify that this isn't necessary so I can make testing easier for you 😄 |
planarvoid
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.
I've tested the file block picker and it's looking good. The only thing looking weird is that the "Choose from device" option is moved to the right (it's like that even in your PRs). Any idea why that's happening @jd-alexander ?
That's right, an icon missing there. |
|
@etoledom I think we're already using a "mobile phone" icon (or similar...I don't have my Android phone on me to check 😄) for other instances of the "choose from device" option, so we can use that same icon and label here. |
|
The changes mentioned above have been implemented here |
|
Thank you @jd-alexander for the update! @planarvoid - could you please take another look? Thanks! |
etoledom
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.
Smoke tested and its working great to me.
@planarvoid - if you are happy with the code side of things, let's go ahead ![]()
|
Moved this to target |


gutenberg: WordPress/gutenberg#26960gutenberg-mobile: wordpress-mobile/gutenberg-mobile#2805WPiOS: wordpress-mobile/WordPress-iOS#15291Solution
This solution seeks to address the ability to add a file to the File Block from the device or WordPress media library utilizing the media picker components that are present within the codebase. This PR brings consistent file picking behavior between both the Consolidated Media Picker and the Normal Picker.
The primary changes are:
introducing a
SINGLE_FILE_PICKERtype in theMediaBrowserTypeso the behavior that's specific to the File Block can be constrained by this picker type.For the
MediaBrowserActivitywhen a single file is being selected themBrowserType.isSingleFilePicker()flag is used to ensure the entire media list is loaded.showFilePickernow acceptscanMultiSelectso thatonAddFileClickedcan pass theallowMultipleSelectionThe GutenbergEditor's WP Media Library
FileButtonClickedbehavior was wired to the media picker so that a picker with the WP Media Library as it's source could be created.Testing
Before testing, I toggled the default value in the file
ConsolidatedMediaPickerFeatureConfigto switch between each picker type.Normal Media Picker (consolidated media picker disabled)
Picking local files.
Picking WP media library files
Picking WP media files.
Consolidated Media Picker
Picking local files.
Picking WP media picker files.
Reviewing
Only 1 reviewer is needed but anyone can review.
Submitter Checklist
RELEASE-NOTES.txtif necessary.