wordpress-activitypub icon indicating copy to clipboard operation
wordpress-activitypub copied to clipboard

Add summary display style to Reactions block

Open pfefferle opened this issue 1 month ago • 2 comments

Fixes #1815

Proposed changes:

Add a new "Compact" display style to the Reactions block that shows reaction counts inline without avatar facepiles. Both styles use the same underlying Reactions component - the Compact style simply hides the avatars in the facepile row and modal dropdown.

Features:

  • Facepile style (default): Shows avatar facepiles with reaction counts
  • Compact style: Shows only reaction count buttons inline, without avatars
  • Automatically defaults to Compact style when WordPress "Show Avatars" setting is disabled (Settings → Discussion)
  • When avatars are disabled, the Facepile style option is hidden from the block styles panel
Compact Facepile
Compact style screenshot Facepile style screenshot

Other information:

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

Testing instructions:

  1. Go to the block editor and insert a "Fediverse Reactions" block
  2. In the block toolbar, click the styles icon to switch between "Facepile" and "Compact" styles
  3. When "Compact" style is selected, verify:
    • No avatar facepiles are shown
    • Reaction buttons are displayed inline
    • Clicking a button opens a dropdown without avatars
  4. Test that the block renders correctly on the frontend with both styles
  5. Go to Settings → Discussion and disable "Show Avatars"
  6. Insert a new Reactions block and verify it defaults to "Compact" style
  7. Verify the "Facepile" style option is hidden when avatars are disabled

Changelog entry

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

Significance

  • [ ] Patch
  • [x] Minor
  • [ ] Major

Type

  • [x] 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

Add compact display style to Reactions block that hides avatars.

pfefferle avatar Dec 10 '25 15:12 pfefferle

@obenland with all the feedback above and working on the fixes, I now think it really makes sense to re-use the Reaction Block for both!

maybe the difference between the two styles could just be CSS and whether the avatars are displayed or not.

It is not only CSS, but the current version is a somehow Avatarless version of the Reactions Block. The Summary style simply disables the facepiles (avatars), but keeps the dropdown and shows the "buttons" inline.

Summary  Facepiles
 Screenshot 2025-12-12 at 09 19 59 Screenshot 2025-12-12 at 09 20 03

pfefferle avatar Dec 12 '25 08:12 pfefferle

The one question remaining for me is wether we should force compact display when show_avatar is false, regardless of choice of style, particularly for blocks that are already inserted.

I think either way, we should have a consistent handling over all blocks.

pfefferle avatar Dec 12 '25 17:12 pfefferle

Cool! Now it would be nice to have a comments count block in the same style. ;-)

kaffeeringe avatar Dec 16 '25 09:12 kaffeeringe