-
Notifications
You must be signed in to change notification settings - Fork 797
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] Tiled Gallery Block: Use default colour for block icon #21618
[RNMobile] Tiled Gallery Block: Use default colour for block icon #21618
Conversation
By removing 'fill="currentColor"', the block icon will go back to the general defaul colour that's used for all block icons, thus restoring consistency.
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. 🔴 Action required: Please add missing changelog entries for the following projects: Use the Jetpack CLI tool to generate changelog entries by running the following command: Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
|
👋 @kraftbj, you were a recommended reviewer for this file and I'd be grateful if I could get your eyes on it from a web perspective. I don't believe removing the I'd be grateful to hear if you have any concerns about how removing this line of code could impact the web. If so, we could then create a native-specific version of the |
👋 @guarani, @illusaen, as part of this PR I'd be interested to hear your thoughts on whether we should create a native-specific version of the The change in this PR doesn't impact the web in my testing (though I've yet to test on WordPress.com, as I'm pending sandbox approval, I've only been able to test on self-hosted at the time of writing). As such, it didn't feel like the change warranted a separate file and I went for sticking to the |
👋 Hi @SiobhyB, I don't think there's a clear answer here. I think we need to look into why this change was necessary and expand on how this was tested.
|
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.
LGTM!
So looking into the other icons Jetpack uses, it seems like they're using |
@guarani, thanks for these questions!
I'm not clear what purpose the line was serving on web and wasn't able to find a clear answer through git blame or similar. It doesn't appear to actually be doing anything, but it could be the case I'm missing something. I took a look at other blocks, and there isn't a clear, consistent usage of this attribute that I could find. These blocks use These blocks don't use a fill attribute:
Yes, a local Docker environment is exactly what I meant. :) I also need to test on WordPress.com, given that the icon colours are not green for Jetpack blocks on WordPress.com, in contrast to self-hosted. I've requested a sandbox so that I can test further. |
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 also need to test on WordPress.com, given that the icon colours are not green for Jetpack blocks on WordPress.com, in contrast to self-hosted. I've requested a sandbox so that I can test further.
Thanks for sharing! I wasn't aware of this color difference between WP.com and Jetpack-connected-self-hosted. I see now that logic is found here. It also looks like fill="currentColor"
means: use the parent HTML element's color for the icon. I think the parent color may be defined here and applied here, so it gets used by the SVG icon.
Regarding other blocks:
These blocks use
fill="none"
:
These blocks, "Simple Payments" and "Subscriptions" seem to be only available on WP.com, which may explain why they don't need to inherit a color (they only need to have black icons, never green).
These blocks don't use a fill attribute:
That's a good find. It looks like even though a fill
isn't provided on the SVG itself, fill: currentColor
is applied anyway via CSS here on the web. That could explain why it seems no longer necessary to set fill: currentColor
on the SVG: it's already set via CSS.
On mobile however, the logic is a bit different. I'm not certain, but I think the use of fill
was making the icon blue-ish on mobile's block picker because it was inheriting a color from a parent element (but I'm not sure which). It's worth noting that the color seemed correct (dark gray) in the slash inserter, so there it might have inherited the right color by chance.
I feel like this PR implements the correct approach. I don't think it's necessary to split index.js
into web and mobile specific files. Your test on WP.com should be enough to ensure this works.
If you prefer, it might be worthwhile to make this PR target master
instead. That way we can get input from web folks now rather than having to remember to ask web folks to review this particular change when merging the feature branch to master
later. If so, after merging to master we'd have to update our feature branch to bring the change in. This is totally up to you.
It looks like this function adds another It also adds |
The base branch was changed.
@guarani, wow, thank you for all that extra digging to uncover the reasoning for those differences! That all makes sense. This has now been tested on WordPress.com, thanks to @jeherve's guidance, and it's confirmed there are no regressions. 🎉 I considered merging to Thanks! |
Thank you @jeherve! 🙇♀️ |
Sounds perfect 👍 Thanks for fixing this! |
Fixes wordpress-mobile/gutenberg-mobile#4158
Changes proposed in this Pull Request:
fill
parameter is removed from the icon'sPath
element. The fact that this parameter was setting the icon's fill tocurrentColor
was causing it to appear as the wrong colour in the apps. By removing this parameter, the icon now reverts back to the default colour that all other blocks use for their icons.Mobile Gutenberg PR: wordpress-mobile/gutenberg-mobile#4193
Jetpack product discussion
Main project thread for the Tiled Gallery block on mobile: p9ugOq-1Tb-p2
Does this pull request change what data or activity we track or use?
No, it doesn't.
Testing instructions:
To test, it should be verified that:
Apps
Web
Screen.Recording.2021-11-03.at.22.10.59.mov