-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Simplify media insertion flow #25031
[RNMobile] Simplify media insertion flow #25031
Conversation
@jd-alexander This is looking pretty good already -- nice work! I know it's early days (and this is Android-only atm) but I wanted to chime in with a couple of design-related bits of feedback:
Now that I see this in context, I think we might not want to lean towards keeping the placeholder in this scenario. For example, it seems like a scenario (more likely than exiting the flow right away) would be where I have created the block but want to "skip" the upload part -- perhaps because I don't have an image ready or want to leave it as a blank image block (think: templates). The tricky part with that is what does the label become (not "cancel")? in this flow, something like "Skip" or "Skip upload"might make sense, but we do use on this sheet in other contexts so something more generic like "Dismiss" or "Keep editing" would probably be more appropriate. I'm also open to other suggestions 😄
|
Thank a lot for the feedback @iamthomasbishop 🙇
Just to clarify here, "I think we might not want to lean towards keeping the placeholder in this scenario" I am trying to understand this point if you are saying that the way the cancel option was implemented is correct or if "not" being included was a typo. Let me know :)
This is a good point. I would choose "Dismiss" as it clearly communicates that the component in question is going to be closed.
Will add this 🙏
Indeed. I have noticed this as well. I will check to see if there are any existing issues related to this and if not I will track it. |
@mchowning @guarani just a heads up that there's a bug on iOS that I am currently investigating causing the media upload option bottom sheet to be closed as it opens so I am investigating that today. The functionality here works as expected on Android. Once I get a first pass from you peeps with the approach and some thoughts on the questions posed, I will work on finalizing the PR for an official review. Thanks in advance 😄 |
On second thought I have been doing some debugging with iOS and I can't figure out why after adding an image block multiples with this functionality the editor freezes. I see no exceptions so I am still digging to figure out what's up. So it would be good if either of the reviewers could run to the iOS emulator for more context. |
Not directly related to this PR, but thought I'd mention: I just discovered how to locally checkout a PR made on a fork. So for this PR it's:
|
Nice! That's pretty cool :) |
packages/block-editor/src/components/media-upload/index.native.js
Outdated
Show resolved
Hide resolved
packages/block-editor/src/components/media-upload/index.native.js
Outdated
Show resolved
Hide resolved
I had a look at the code and it's looking great. On iOS I see the same bug you reported here #25031 (comment) (I don't have any ideas off-hand on what's causing the media options sheet to disappear.) I wanted to test on Android but it seems like something's broken in my setup and I couldn't get the emulator to load the app from the packager (it seemed to use a bundled version of the app — I don't recall seeing this problem before when running from Gutenberg 🤷♂️). It's very likely something with my setup but I couldn't fix it yet.
Since I haven't had a chance to test this properly, so not sure.
I wasn't sure about this as it seemed to limit customization (and see my comment #25031 (comment)).
My feeling is that Video should only be included if it's easier to include than exclude (e.g. due to shared code), doesn't have any separate design considerations, and it doesn't make the test scenarios in this PR unreasonably long (in which case it could go in another PR). |
@jd-alexander Oops, my bad -- yes, I think we should keep the placeholder, and change the
Thank you! |
Thanks again for the review @guarani 🙌
So I spent some time investigating this and it seems that the media options action sheet on iOS is showing too quickly, so the inserter bottom sheet being dismissed at the same time is causing it to be closed. I added a
Understood :)
Yes, indeed. It does limit customization.
Thanks for this. I will evaluate including it here or not when I finalize the changes here 🙏 |
…ass in the pickerOptions
…behavior from the Image Block itself.
…iss the picker when it's being presented.
…handles all the logic for the auto-opening.
@guarani this is ready for another review. The same testing instructions in the main PR description applies here. All the issues you had mentioned in a previous review are resolved now since this approach is not state-based. The primary success paths of this feature are as follows.
Also, thanks for your initial thoughts and ideas about modifying the inserter 💯 I have a function that's updating the redux state when an insertion takes place and any block that's inserted in this can listen for it. Quick question, if behavior like the above is being introduced should it go into some form of documentation or it's fine to just submit as is? I am going to look into this. |
Co-authored-by: Paul Von Schrottky <paulvonschrottky@gmail.com>
Hi @chipsnyder just an update here, that this PR that simplifies the media flow for the Image, Video, and Gallery block was revisited and updated for review. From a review standpoint, most of the changes got reviewed by @guarani in the past but that was a while ago, so hopefully, if you are available, you could take another look @guarani Also, if necessary, someone from manakin could also take a look since this PR touches critical flows for our media blocks. |
Closing this PR in favor of #29546 that splits up the changes into smaller PRs so that they can be reviewed more easily. Changes not included in the PR series are the changes the addition of |
Gutenberg Mobile PR
wordpress-mobile/gutenberg-mobile#2700Description
This change simplifies the media insertion flow by showing the media options sheet when you tap
Image
,Video
orGallery
to add the media placeholder to the canvas. Before you would have to add the media placeholder and clickAdd Image / Video / Media
for it to be shown after insertion.The main changes are as follows:
The native redux actions, reducer, and selectors were modified so that we could utilize the store to track the last block that was inserted. These changes are unit tested.
The Image, Video, and Gallery block now have the media options sheet auto-opening upon insertion.
The
Clear Media
option was added to the Image block. Though outside of the scope of the main PR, during the design phase it was noticed that the option was missing.The
iOS
picker'sCancel
button was updated toDismiss
due to design feedback. You can notice this in the media options sheet that opens on all the iOS screenshots.The Gallery and Image UI Tests were updated with functionality that closes the picker during testing since it auto-opens. This solution has been optimized for both iOS and Android tests.
The documentation was for the
MediaUpload
MediaPlaceholder` components were updated.Testing
Image
Video
Gallery
Regression Testing
Checklist: