-
Notifications
You must be signed in to change notification settings - Fork 4.7k
17642 adds edit state to frames to fix new tab issue #17641
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
17642 adds edit state to frames to fix new tab issue #17641
Conversation
…lery toolbar logic to reach parity with Core.
…re. Also removes the declaration of the button text as the default already is 'select'
|
The Core side changes have been merged in https://core.trac.wordpress.org/changeset/46461 No need to apply the Core patch now. Just test this PR and all should be working again. |
|
For the record, in I tested it with the latest WordPress core changes in I also can observe that there is some unexpected behavior with the focus when navigating back from editing the image when you want to select the featured image: Somehow, the visual focus stays on the |
joemcgill
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.
A few small stylistic comments, but the code overall looks good to me.
|
@anthonyburchell - we should figure out why you see this white screen inside the modal from time to time before we proceed. There is also this question, whether we should remove |
|
The related Trac ticket is milestoned for WordPress 5.4. See https://core.trac.wordpress.org/ticket/48028 Any chance to get this rebased, reviewed, and if everything goes well, merged? /Cc @youknowriad @anthonyburchell @joemcgill |
|
Thanks for the ping @afercia! I rebased and fixed some linting issues. Looks like that is passing now. The feedback provided in this comment is still valid. It is possible to get a blank white screen after clicking edit in one frame (gallery) and opening edit in another (maybe featured). I still have some investigation to get that solved. It's a pretty edge case instance so I leave it to y'all to thumbs up moving forward and making a separate issue to solve that. |
|
Also, it may be worth mentioning that I don't think this needs to be included in Beta 1. This is a bug fix to a broken part of the edit image functionality so maybe we can land this for Beta 2? |
|
An update here, I found that the edit image bug has existed since before this PR. I think that calls for a trac side change to fix the close action. To reproduce, click edit image on a selected image in the gallery library modal, close window. open another frame (featured image maybe), attempt to edit same image, see white screen. It's possible to do this in older versions. With that in mind, I dont see any blockers to merging this PR before 5.4 Beta 2. Please let me know if theres anything I can do to bring it to 100%. :) |
gziolo
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 tested it again and I couldn't reproduce issues listed a few months back. Nice work. Let's get it in 🎉
@jorgefilipecosta - I added this PR to the list of PRs to include in WP 5.4 release. |
* adds edit state to frames to fix new tab issue * moves default state build into else of gallery condition and adds gallery toolbar logic to reach parity with Core. * fixes selection object reference to proper state * improves and adds documentation * removes buildAndSetEditFrame as it should be added in core and not here. Also removes the declaration of the button text as the default already is 'select' * truly removes editState fu function * fixes linting issues * Adjusts PR to factor in review suggestions
* adds edit state to frames to fix new tab issue * moves default state build into else of gallery condition and adds gallery toolbar logic to reach parity with Core. * fixes selection object reference to proper state * improves and adds documentation * removes buildAndSetEditFrame as it should be added in core and not here. Also removes the declaration of the button text as the default already is 'select' * truly removes editState fu function * fixes linting issues * Adjusts PR to factor in review suggestions
|
@anthonyburchell @gziolo @jorgefilipecosta: Gallery: can't insert select items from media libraryAlso notice that, when an image is selected in the media modal, the action button at the bottom-right corner reads "Insert gallery" instead of "Create a new gallery". Gallery: can't edit collection of images
|



Description
https://core.trac.wordpress.org/ticket/48028
Excerpt from the ticket above:
Fixes: #17642.
## Types of changes/ How has this been tested?
This PR adds a new editState function to initialize the available edit frames. This function also respects the
allowedTypesprop and has been tested with the video, gallery, and featured image media flows. Additional testing there would be appreciated.PENDING BUG: edit image state for gallery seems to be messing up because of the multiple nature of this screen. Leaving this draft until I have a fix.