-
Notifications
You must be signed in to change notification settings - Fork 81
Follow Me: Introduce Author Card style #1753
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
Conversation
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.
Pull Request Overview
This pull request refactors the Follow Me block by replacing the old “buttonOnly” attribute with new style variations and enhancing profile rendering. Key changes include adding a new onModalClose callback in view.js, updating styling in style.scss and block.json, and modifying render and edit logic to depend on block styles rather than the deprecated attribute.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/follow-me/view.js | Added JSDoc for a new onModalClose callback. |
src/follow-me/style.scss | Updated styling with new variations (default, button-only, profile). |
src/follow-me/render.php | Replaced buttonOnly logic with className-based styling and header image. |
src/follow-me/edit.js | Removed ToggleControl for buttonOnly; now uses className for styling. |
src/follow-me/deprecation.js | Introduced migration logic for transitioning from buttonOnly to className. |
src/follow-me/block.json | Updated version and style definitions to support new design patterns. |
includes/class-blocks.php | Added a new REST API hook for registering custom fields. |
build/* | Rebuilt assets with updated styles and scripts. |
Comments suppressed due to low confidence (1)
src/follow-me/deprecation.js:57
- The deprecation logic still depends on 'buttonOnly', while the new block.json now uses 'className' for style differentiation. Consider updating the migration to exclude 'buttonOnly' to fully align with the updated attribute model.
return !! attributes.buttonText || !! attributes.buttonOnly;
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.
Pull Request Overview
This PR introduces an Author Card block style and converts the existing Button Only mode from an attribute toggle into a block style. Key changes include updating JavaScript and PHP rendering logic, revamping SCSS style definitions to support new block styles, and adjusting deprecation logic and block metadata.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/follow-me/view.js | Added documentation for onModalClose callback. |
src/follow-me/style.scss | Updated and extended styles for button-only and profile variations. |
src/follow-me/render.php | Migrated to block styles and integrated header rendering logic. |
src/follow-me/edit.js | Removed ToggleControl and updated inspector controls to use className. |
src/follow-me/deprecation.js | Updated migration code to shift from the buttonOnly attribute to block styles. |
src/follow-me/block.json | Updated version number and example attributes to reflect new style usage. |
includes/class-blocks.php | Registered additional REST fields required for the Follow Me block. |
build/reactions/render.php | Added a parent parameter on button creation. |
build/follow-me/* | Updated built assets (CSS, JS, PHP templates) to support new styles and version bumps. |
Comments suppressed due to low confidence (1)
src/follow-me/edit.js:165
- Since the 'buttonOnly' toggle control has been removed in favor of block style management via the className attribute, update in-code comments and any related documentation to clearly communicate this change.
<ToggleControl label={ __( 'Button Only Mode', 'activitypub' ) } ... />
@obenland working with JS ;) this has also merge conflicts |
This is not directly something specific for this PR (maybe more a general question for all blocks), but because this block can be very dominant, this is where I noticed it the most: The "rounded corner" and "drop-shadow" look is very specific and while testing with several themes that mostly use a "flat design" it feels a lot like a "foreign object". Can we maybe re-use the styling of the theme or at least use a more decent style (no shadows or rounded corners)? I think this also mainly applies to the reply-context/embed. |
Hm, it's pretty much what this PR is about, to introduce this style of an author card that can be embedded anywhere in the site. It's an extension of the Card style in the Followers block, the onboarding checklist, the author card in the New Follower email, the post preview in the DM and mentions email, and the oembed fallback for Fediverse content. Dropping the border styling makes the Profile style look quite poor IMO, particularly for profiles with header images. |
we can add a thin border!? there is no way to adapt theme styles? |
I see the same issue for the preview/embed block. I think the email is different, because it does not integrate in a broader context there. |
6da39fe might be the way to have our cake and eat it, too. With the border and shadow controls it'll be possible to completely remove or replace the box shadow and rounded corners, providing a consistent default that's completely customizable: Screen.Recording.2025-06-04.at.7.39.17.PM.mov |
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.
NICE!
Awesome! 😻 Pretty close to my mockup (#1746)! It would be even better to have options to: |
I've had this improvement in the back of my mind since working on #1691, #1746 just had good timing :)
This PR changes the Button Only mode from being a toggle attribute to becoming a Block Style and adds an Author Card block style, similar to the author card in the New Follower email.
Fixes #1746.
Follow-up to #1691.
Proposed changes:
activitypub
context makes it the only value returned from these requests and doesn't add it to any other user API requests.buttonOnly
attribute to convert to block style. Extends it to v1 deprecation.render.php
to render the full block. Adds button-only style for blocks that have not been upgraded.Testing instructions: