Skip to content

Reactions: Hide title more comprehensively #1709

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

Merged
merged 9 commits into from
May 16, 2025
Merged

Conversation

obenland
Copy link
Member

Follow-up to #1705.

While #1705 fixed titles for legacy Reactions blocks (v1.0.0), it did not account for hiding titles added through heading blocks, when there are no reactions.

In this PR, we standardize around the v2.0.0 markup with fallbacks for v1.0.0 titles, and then add a hidden attribute when there are no reactions.

See https://mastodon.social/@vsg_DE/114512927652473093

Proposed changes:

  • Remove fallback title handling in view.js.
  • Always create title markup as a fallback, regardless of whether there's a defined title or not.
  • Adds a hidden attribute to the title when there are no reactions.

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Go to '..'

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Titles added through a Heading block in the Reactions block now stay properly hidden when there are no reactions.

@obenland obenland requested review from pfefferle and jeherve May 15, 2025 17:40
@obenland obenland self-assigned this May 15, 2025
@github-actions github-actions bot added [Block] Reactions [Feature] Reactions [Focus] Editor Changes to the ActivityPub experience in the block editor labels May 15, 2025
@obenland
Copy link
Member Author

@jeherve Was hiding the new block heading what you were referring to in the previous ticket? If so, I misunderstood.

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem to work for me right now ; I still see the heading on posts where I've had no reactions.

I do use a custom heading title:

<!-- wp:activitypub/reactions {"title":"What people think about it on the Fediverse!"} /-->

image image

@obenland
Copy link
Member Author

I think we need to add a testing infrastructure for these blocks to prevent these regressions going forward.

@obenland
Copy link
Member Author

@pfefferle Have you had a chance to test this yet?

Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to work well now, with your fix. 🚢

@obenland obenland merged commit 3af53be into trunk May 16, 2025
11 checks passed
@obenland obenland deleted the update/reactions-heading branch May 16, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Reactions [Feature] Reactions [Focus] Editor Changes to the ActivityPub experience in the block editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants