-
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
Block library: Refactor color supports handling for mobile #22502
Conversation
Size Change: -25 B (0%) Total Size: 1.11 MB
ℹ️ View Unchanged
|
Hey, @gziolo These changes are valid in the current state but I'm afraid that we will support the color flag in mobile blocks one by one. What should we do if we would like to support the color flag for a paragraph at first and then add it to other blocks? Should we create our own list with blocks that support that flag? We could also turn off the color flag for all blocks as it is implemented in this PR and add it manually. I mean add color edit to the Our plan was to add support of showing colors in blocks and then just remove the check Nothing changes from our perspective since we support colors only for Button which doesn't use the color flag at all. But later, we would like to use that flag and we would need to support it for all blocks (with the |
Thanks for checking, can you keep a list of blocks as an additional check for mobile? Something like: const hasColorSupport = ( blockType ) =>
( Platform.OS === 'web' || [ 'core/block-1', 'core/block-2' ].includes( blockType ) )
&& hasBlockSupport( blockType, COLOR_SUPPORT_KEY ); |
It is what i meant
I think we can, however, IMO it should be a temporary solution and ultimately we would like to support the color flag on mobile as well :) cc: @lukewalczak @pinarol |
@dratwas thanks for confirming, could you also give a quick test to this PR on mobile side and approve accordingly? Let's also check columns block inserter support as it was also leaning on a support flag. |
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 have checked it on mobile and it seems like everything works as before.
Let's also check columns block inserter support as it was also leaning on a support flag.
Columns block works fine as well.
Thank you @dratwas for cooperation :) |
Description
Addresses the following comment:
#21326 (comment)
This PR moves the check to the file that uses
__experimentalColor
support flag and ensures this feature is disabled for the mobile app. It was the remaining blocker to movesupports
toblock.json
file that will allow exposing those settings in the new REST API endpoint that's in works.How has this been tested?
There should be no difference in how both web and mobile operating.
Those blocks should be validated on mobile.
Types of changes
Refactoring.
Checklist: