Add action buttons (Like, Boost) to the reactions block#2988
Merged
Add action buttons (Like, Boost) to the reactions block#2988
Conversation
Add optional Like and Boost action buttons to each reaction group in the
Fediverse Reactions block. Clicking a button opens a full-size modal dialog
where visitors can copy the post URL or enter their Fediverse handle to
interact from their home server.
Backend:
- Add remote-intent REST endpoint at posts/{id}/remote-intent
- Add Webfinger::get_intent_endpoint() with FEP-3b86 and OStatus fallback
- Refactor get_remote_follow_endpoint() to delegate to get_intent_endpoint()
- Pass $intent to Interaction Controller filters for extensibility
Frontend:
- Extend the shared modal to switch between compact (reactors list) and
full-size (intent dialog) modes via context.modal.isCompact
- Add showActions block attribute (opt-in) with editor toggle
- Reuse createModalStore() and Blocks::render_modal() shared infrastructure
- Share localStorage profile with remote-reply block
Includes tests for the new endpoint and Webfinger::get_intent_endpoint().
There was a problem hiding this comment.
Pull request overview
Adds opt-in Like/Boost “remote intent” actions to the Fediverse Reactions block, backed by a new REST endpoint and WebFinger intent discovery (FEP-3b86 with fallbacks).
Changes:
- Adds
posts/{id}/remote-intentREST endpoint and extends WebFinger withget_intent_endpoint()(FEP-3b86 + OStatus + Mastodon fallback). - Updates the Reactions block (editor + frontend Interactivity store) to show action buttons and a full-size intent modal with localStorage profile persistence.
- Extends shared modal rendering to support dynamic titles and compact/full-size switching.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/phpunit/tests/includes/rest/class-test-post-controller.php | Adds route registration + response/validation tests for the new remote-intent endpoint. |
| tests/phpunit/tests/includes/class-test-webfinger.php | Adds unit tests for Webfinger::get_intent_endpoint() across supported discovery/fallback paths. |
| src/reactions/view.js | Implements intent modal behavior, REST call, clipboard copy, and localStorage persistence in the Interactivity store. |
| src/reactions/style.scss | Styles the inline action buttons and the intent dialog inside the shared modal. |
| src/reactions/render.php | Adds showActions attribute handling, renders action buttons and the new dual-mode modal contents, and configures i18n/context. |
| src/reactions/reactions.js | Updates editor-side React preview to display (disabled) action buttons when enabled. |
| src/reactions/edit.js | Adds Inspector toggle for the showActions attribute and passes it through to the preview. |
| src/reactions/block.json | Introduces the showActions block attribute. |
| includes/rest/class-post-controller.php | Registers the remote-intent route and implements the { url, template } response. |
| includes/rest/class-interaction-controller.php | Passes $intent through interaction filters for extensibility. |
| includes/class-webfinger.php | Refactors remote-follow to delegate to new intent endpoint discovery with FEP-3b86 support + fallbacks. |
| includes/class-blocks.php | Extends shared modal renderer with title_binding + dynamic compact class binding support. |
| build/reactions/view.js | Built asset reflecting src/reactions/view.js changes. |
| build/reactions/view.asset.php | Updates built asset metadata for the view script. |
| build/reactions/style-index.css | Built CSS reflecting src/reactions/style.scss changes. |
| build/reactions/style-index-rtl.css | Built RTL CSS reflecting src/reactions/style.scss changes. |
| build/reactions/render.php | Built render file reflecting src/reactions/render.php changes. |
| build/reactions/index.js | Built editor script reflecting src/reactions/* changes. |
| build/reactions/index.asset.php | Updates built asset metadata for the editor script. |
| build/reactions/block.json | Built block metadata reflecting src/reactions/block.json changes. |
| .github/changelog/2988-from-description | Adds changelog entry for the feature. |
- Wrap $intent_map in showActions conditional to avoid unused variable - Reuse Webfinger::get_identifier_and_host() for Mastodon fallback URL instead of manual host parsing
- Add noopener,noreferrer to window.open for reverse-tabnabbing protection - Wrap JSON.parse in try/catch for corrupted localStorage data - Remove quote from intent map since there is no quote intent in FEP-3b86
pfefferle
added a commit
that referenced
this pull request
Mar 3, 2026
Follow-up to #2988. Fixes avatar overflow on smaller screens when action buttons are enabled, removes unwanted button hover styles from the reaction count label, and prevents the full-size intent modal from being misaligned after a compact dropdown was open.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preparation for #2792
Proposed changes:
posts/{id}/remote-intentREST endpoint returning{ url, template }— consistent with the existingremote-followandremote-replyendpoints.Webfinger::get_remote_follow_endpoint()to delegate to newget_intent_endpoint()method with FEP-3b86 support.$intentto Interaction Controller filters for extensibility.Blocks::render_modal()+createModalStore()) — the modal dynamically switches between compact (reactors list) and full-size (intent dialog) modes.showActionsblock attribute with editor toggle in Inspector Controls.localStorage(fediverse-remote-userkey).Other information:
Testing instructions:
@user@mastodon.social) and click "Go" — the remote server's interaction page should open in a new tab.Changelog entry
Changelog Entry Details
Significance
Type
Message
Add optional Like and Boost action buttons to the Fediverse Reactions block, allowing visitors to interact with posts from their own server.