Skip to content

Newsletter: match subscriber row avatar fallback to the detail panel#49581

Open
dhasilva wants to merge 1 commit into
trunkfrom
fix/newsletter-modernized-gravatar
Open

Newsletter: match subscriber row avatar fallback to the detail panel#49581
dhasilva wants to merge 1 commit into
trunkfrom
fix/newsletter-modernized-gravatar

Conversation

@dhasilva

Copy link
Copy Markdown
Contributor

Fixes #

Proposed changes

  • The modernized Newsletter subscriber row rendered a different fallback avatar than the detail panel for subscribers with no Gravatar: the row showed a generic placeholder while the panel showed an initials tile.
  • Root cause: the row omitted displayName on the shared Gravatar component (originally to avoid a duplicate screen-reader announcement). displayName does double duty — it's the alt text and becomes the &name= URL parameter that Gravatar's d=initials default image uses to derive the initials. Dropping it stripped &name=, so the row's initials fallback had nothing to render from.
  • Pass displayName to the row's Gravatar again. The avatar is already wrapped in aria-hidden="true", which keeps it (and its alt) out of the accessibility tree — so there's no double announcement, and the row now renders the same initials fallback as the detail panel.
  • Added a unit test asserting the row avatar URL carries the name= parameter (so it matches the detail panel).

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  • Open the modernized Newsletter dashboard (Jetpack → Newsletter → Subscribers).
  • Find a subscriber who has no Gravatar (so the initials/placeholder fallback is used).
  • Confirm the avatar shown in the subscriber row matches the avatar shown in the detail panel when you click View / open the inspector — both should be the same initials tile.
  • Subscribers who do have a real Gravatar are unaffected (they were always consistent).

Before / After

Subscriber row avatar vs. detail-panel avatar for a subscriber with no Gravatar (emails redacted). Before, the row fell back to a generic placeholder while the panel showed the initials tile; after, both render the same initials tile.

Before After
before after

The modernized Newsletter subscriber row dropped `displayName` from the
shared Gravatar to avoid a duplicate screen-reader announcement, but that
also stripped the `&name=` parameter the `d=initials` fallback uses to
derive the initials. Subscribers without a Gravatar got a generic
placeholder in the row that didn't match the detail panel's initials tile.

Pass `displayName` again — the `aria-hidden` wrapper already keeps the
avatar (and its alt) out of the accessibility tree, so there's no double
announcement, and the row now renders the same initials fallback as the
detail panel.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dhasilva dhasilva added the [Status] Needs Review This PR is ready for review. label Jun 12, 2026
@dhasilva dhasilva self-assigned this Jun 12, 2026
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the fix/newsletter-modernized-gravatar branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/newsletter-modernized-gravatar

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

@enejb

enejb commented Jun 12, 2026

Copy link
Copy Markdown
Member

@dhasilva can we make the line vertically centred. So that the gravatar is the center aligned.
I think we do this on form responses well. (this could also be done as a follow up)

See
Screenshot 2026-06-12 at 6 46 47 AM
and
Screenshot 2026-06-12 at 6 46 36 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants