-
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
[Mobile] - Refactor gallery - cherry pick v2 - step 1 #31413
[Mobile] - Refactor gallery - cherry pick v2 - step 1 #31413
Conversation
This is only temporary, for testing purposes. This will be replaced with an actual implementation (which will need to access the flag remotely).
This will need to be addressed (since we can't have unwrapped text on mobile). For now, I'm commenting this out to proceed with cherry-picking the changes from the original mobile refactor branch.
Size Change: -59 B (0%) Total Size: 1.43 MB
ℹ️ View Unchanged
|
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.
Great work @mkevins 👍
I tested this and the new gallery behaves pretty well considering the stage of this project:
- Created a gallery with some images
- Images behave as inner blocks
- Reordering works
- Removal works
- Attribute overwriting works as described
- The columns setting seems to work similarly to the old v1 gallery block: Maximum number of columns is set to 3 and only two columns can be rendered in portrait mode (3 columns work only in landscape).
I also noticed the following:
- When an upload is cancelled, it will leave a placeholder image (as discussed). I don't think this is bad especially if we can add a way to resume the upload.
- I noticed a breakage in the columns block where the internal blocks are not outlined (screenshot) and the user is not able to add a block. I think we can tackle this in a separate PR.
Thanks for reviewing and testing Antonis! Good catch about the columns. I will gather all of these issues as we progress further with the refactor PRs, and hopefully they'll get sorted out in further cherry-picking. It'll be great as a reference that you noted the issues here, since if the further cherry-picking from the former PR does not resolve some issues, the comments on these PRs will serve as a good starting point to determine the root cause. In this case, I suspect it is to do with intermittent style changes to the block-list items, but I haven't confirmed that. |
That makes sense. I also tested the main refactor PR #25940 and the columns work there. Thus it must be some cherrypicked change on this one. |
Related PRs
Description
This PR is the first step at adapting the former refactor implementation to the new approach used in the main PR. It mostly cherry-picks changes to the rebased branch, and omits certain changes that were later reverted. After the inclusion of these changes, it should be possible to create new v2 gallery blocks (as inner image blocks), but the UI will not be in it's final state.
Also, a temporary change was included in this PR (acf18ca) to enable the
__experimentalGalleryRefactor
flag for testing purposes. This will be removed once a more appropriate implementation is in place.The relevant commits from the former mobile refactor PR are included or omitted as follows:
How has this been tested?
In the block editor, create a gallery and add some images. They should behave as inner image blocks, and should allow reordering and removal. It should also be possible to add captions to both the image blocks, and the outer gallery block. When an inner image block has a setting (attribute) that is also present on the gallery block, a change to the setting on the gallery level should "overwrite" the setting for the individual image block. E.g. if you add a link to an image, and subsequently change the gallery "link to" setting to "media file", the individual image link should no longer be set. However, if the same settings were applied first at the gallery level, then at the image level, the image block should retain its unique setting(s).
Checklist:
*.native.js
files for terms that need renaming or removal).