Skip to content
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

Reply Block: Embed referenced post when possible #1100

Open
wants to merge 9 commits into
base: trunk
Choose a base branch
from

Conversation

obenland
Copy link
Member

Fixes #1027.

In this first pass the Mastodon embed provider only gets registered when the Reply block gets rendered. I'm open to making it generally available but initially it didn't feel like functionality that this plugin should be responsible for globally.

There's also an action to register additional Fediverse oembed providers beyond Mastodon.social. Not sure if there are others we should or need to consider.

The current implementation supports embedding posts from all supported oembed providers. I wasn't sure whether it should be limited to Mastodon or whether it should be all—please let me know if you have an opinion on that.

Finally, this maintains the anchor, that IndieWeb seems to be looking for.

Proposed changes:

  • Adds oEmbed support to the reply block, automatically embedding content from supported platforms.
  • Registers Mastodon as an oEmbed provider for better integration with Mastodon posts.

Other information:

  • Have you written new tests for your changes?

Testing instructions:

Testing Reply Block with Mastodon Posts:

  1. Create a new post.
  2. Add a Reply block.
  3. Enter a Mastodon post URL (e.g., https://mastodon.social/@obenland/113561729606054851).
  4. Verify that:
    • The post is embedded above the reply link.
    • The reply link is still visible and functional.
    • The URL is properly formatted in the link text.

Testing with Non-Embeddable URLs:

  1. Create a new post.
  2. Add a Reply block.
  3. Enter a URL that doesn't support oEmbed.
  4. Verify that:
    • Only the reply link is shown (no embed).
    • The link is properly formatted.

Testing with Other oEmbed Providers:

  1. Create a new post.
  2. Add a Reply block.
  3. Try URLs from other oEmbed-enabled platforms.
  4. Verify that embeds work as expected while maintaining the reply link functionality.

@obenland obenland requested review from jeherve and a team December 18, 2024 21:29
@obenland obenland self-assigned this Dec 18, 2024
@github-actions github-actions bot added the [Focus] Editor Changes to the ActivityPub experience in the block editor label Dec 18, 2024
@obenland obenland force-pushed the add/oembed-reply-block branch from 150cb7f to 3db22d2 Compare December 19, 2024 16:54
includes/functions.php Outdated Show resolved Hide resolved
includes/functions.php Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Editor Changes to the ActivityPub experience in the block editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Federated Reply block: embed original post on frontend
3 participants