Skip to content

Add fallback-avatar to reaction dropdown list #1719

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 2 commits into from
May 20, 2025
Merged

Conversation

pfefferle
Copy link
Member

Add default avatar and error handling for the dropdown action list.

Before After
Screenshot 2025-05-20 at 10 44 26 Screenshot 2025-05-20 at 10 54 42

Proposed changes:

  • Removed unused code
  • Added default avatar and error handling

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

Default avatar and error handling for the reactions popover list.

Add default avatar and error handling for the dropdown action list.
@pfefferle pfefferle self-assigned this May 20, 2025
@pfefferle pfefferle requested review from Copilot and obenland and removed request for Copilot May 20, 2025 08:59
@github-actions github-actions bot added [Block] Reactions [Feature] Reactions [Focus] Editor Changes to the ActivityPub experience in the block editor labels May 20, 2025
Copy link

@Copilot Copilot AI left a 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 adds a default avatar and error handling for reaction items in the dropdown/popover list while removing unused components.

  • Removed the unused ReactionDropdown component.
  • Updated ReactionList to show a fallback avatar and include an onError handler for avatar images.
  • Updated asset versions in build files and added a changelog entry.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/reactions/reactions.js Removed the unused ReactionDropdown and updated ReactionList with fallback avatar and error handling.
build/reactions/view.js Updated build file version for reactions view module.
build/reactions/view.asset.php Bumped asset version to reflect changes.
build/reactions/index.js Updated build file version and minor adjustments in reaction rendering.
build/reactions/index.asset.php Bumped asset version to reflect changes.
.github/changelog/1719-from-description Created changelog entry for the default avatar and error handling update.

Comment on lines +158 to +161
{ reactions.map( ( reaction, index ) => {
const avatar = reaction.avatar || defaultAvatarUrl;
return (
<li key={ index }>
Copy link
Preview

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

[nitpick] If a unique identifier exists for each reaction, consider using it as the key in place of the array index to improve component stability during reordering.

Suggested change
{ reactions.map( ( reaction, index ) => {
const avatar = reaction.avatar || defaultAvatarUrl;
return (
<li key={ index }>
{ reactions.map( ( reaction ) => {
const avatar = reaction.avatar || defaultAvatarUrl;
return (
<li key={ reaction.id }>

Copilot uses AI. Check for mistakes.

@pfefferle pfefferle merged commit b61c792 into trunk May 20, 2025
11 checks passed
@pfefferle pfefferle deleted the add/fallback-avatar branch May 20, 2025 13:13
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.

3 participants