-
Notifications
You must be signed in to change notification settings - Fork 806
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
Enhance sharing buttons UI #34181
Enhance sharing buttons UI #34181
Conversation
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: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so:
Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
$data_shared = 'sharing-' . $attr['service'] . '-' . $post_id . $attr['service']; | ||
$link_url = get_permalink( $post_id ) . '?share=' . $attr['service'] . '&nb=1'; | ||
|
||
$content = str_replace( 'url_replaced_in_runtime', $link_url, $content ); |
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 think this is a temporary solution while block is still in beta
.
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 noticed a couple of rough edges in the UI. The PR still has the In Progress
label, so don't mind me if these are already known.
- It'd be nice to have a preview of the block (definitely something that could be done later).
- The label could be a bit clearer, e.g., Click the plus icon to add a social network.
- The button style can be chosen in both the block's Settings and Styles panels. Should we leave the selection in Styles only?
-
The rendering seems to be the same in the front-end, no matter the style.
-
When adding a button, the Sharing button is proposed but has no icon? Should it even be there?
- The button labels are rendered in lowercase and with no start padding in the front-end.
- Is this block independent from the Sharing buttons settings?
@monsieur-z Thank you for a thorough review. Initially I also thought that we will want to wrap up the UX with this task, however, after discussion with Design, we enhanced a different approach here. So I wanted to roll out initial step, where we basically change the behavior from single block to parent-child. We would still need to do a fare amount of work with UI, including Ofiicial buttons, More button and some adjustmentes to the logic inside as well. So to keep things going, thought we could merge this as a step, but definitely not the final look. What do you think? |
Though, most of them are pretty easy to fix, so I pushed it. As per the last point, yes, these two functionalities are currently disconnected and probably be like that till the very last step, not to provide issues to the users, while we are still working on the block. |
|
||
registerJetpackBlockFromMetadata( metadata, { | ||
edit, | ||
save, | ||
example: { |
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 believe the example could be added to block.json
instead, since it doesn't have dynamic values.
|
||
const ViewSocialButton = ( { service, url } ) => { | ||
return ( | ||
<a |
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.
From an accessibility perspective, we could make screen readers read something like Share to Facebook
rather than Facebook
. This would provide more context to screen reader users and avoid confusion if there are multiple link labelled Facebook
on the page.
We could do that by adding an aria-label
attribute on the a
and, I believe, hiding the span
with aria-hidden="true"
.
} | ||
|
||
.jetpack-sharing-button__service-label { | ||
margin-left: 5px; |
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.
It's probably safer to use margin-inline-start
for internationalization reasons.
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.
Thanks for the additional context @andrii-lysenko. I left some comments but they can definitely be tackled later one.
@monsieur-z Thanks for highlighting these. I think it is worth having these added so I pushed an additional commit. |
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 see that you made the changes that @monsieur-z requested. Everything looks good. Approved!
Commenting here after the PR merge but hope this feedback is useful. Love the suggestions that @monsieur-z left above, btw!
This is looking very, very promising @andrii-lysenko — awesome work so far! Thank you. |
Fixes #34116 and #34108
Proposed changes:
After discussion in a primary ticket we are moving forward with the implementation similar to Social Links in Gutenberg.
This PR adds new Sharing Button block alongside Sharing Buttons one that is used as a container. Also, added styles to match existing behaviour.
Note:
Official buttons
style is not yet available and we will add it on later stages. This is also still a dummy block with no logic connected and probably some code to be improved in the future.Screen.Recording.2023-11-22.at.12.15.30.mov
Other information:
Testing instructions:
define( 'JETPACK_BLOCKS_VARIATION', 'beta' );
Sharing Buttons
block to a post and check it's behaviour.