Skip to content

Social previews: Show skeleton while rendering messages#48576

Open
gmjuhasz wants to merge 2 commits intotrunkfrom
fix/social-475-preview-skeleton
Open

Social previews: Show skeleton while rendering messages#48576
gmjuhasz wants to merge 2 commits intotrunkfrom
fix/social-475-preview-skeleton

Conversation

@gmjuhasz
Copy link
Copy Markdown
Contributor

@gmjuhasz gmjuhasz commented May 6, 2026

Fixes SOCIAL-475

Proposed changes

  • Show skeleton placeholders in social preview message text areas while rendered message requests are pending.
  • Keep render-message requests driven by debounced render items so typing only fires one request after debounce.
  • Read rendered message cache without triggering resolver requests from preview consumers.
  • Add regression coverage for debounce/loading states and skeleton rendering.

Related product discussion/links

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

No.

Testing instructions

  • Enable the Social message templates feature.
  • Open the post editor and open the Social preview/customization UI.
  • Type a template token such as {excerpt} into the global or per-connection message template.
  • Confirm the preview message area switches to a skeleton immediately, stays skeleton through the debounced render request, then shows the rendered message.
  • Confirm only one /wpcom/v2/publicize/render-messages request fires after typing pauses.
  • Confirm that with the message templates feature disabled, previews continue using the raw message behavior and do not show skeletons.
  • Run pnpm --filter @automattic/social-previews test.
  • Run pnpm --filter @automattic/social-previews typecheck.
  • Run pnpm --filter @automattic/jetpack-publicize test -- use-connection-preview-data use-render-message-items.
  • Run pnpm --filter @automattic/jetpack-publicize typecheck.
CleanShot.2026-05-06.at.17.33.24.mp4

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

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/social-475-preview-skeleton branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/social-475-preview-skeleton

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

github-actions Bot commented May 6, 2026

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!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label May 6, 2026
@jp-launch-control
Copy link
Copy Markdown

jp-launch-control Bot commented May 6, 2026

Code Coverage Summary

Coverage changed in 14 files. Only the first 5 are listed here.

File Coverage Δ% Δ Uncovered
projects/js-packages/social-previews/src/bluesky-preview/post/body/index.tsx 1/8 (12.50%) -20.83% 5 💔
projects/js-packages/social-previews/src/instagram-preview/post-preview.tsx 0/9 (0.00%) 0.00% 5 💔
projects/js-packages/social-previews/src/linkedin-preview/post-preview.tsx 0/9 (0.00%) 0.00% 5 💔
projects/js-packages/social-previews/src/nextdoor-preview/post-preview.tsx 0/9 (0.00%) 0.00% 5 💔
projects/js-packages/social-previews/src/threads-preview/post-preview.tsx 1/10 (10.00%) -10.00% 5 💔

1 file is newly checked for coverage.

File Coverage
projects/js-packages/social-previews/src/shared/message-skeleton/index.tsx 6/6 (100.00%) 💚

Full summary · PHP report · JS report

Coverage check overridden by Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR .

@gmjuhasz gmjuhasz marked this pull request as ready for review May 7, 2026 08:55
@gmjuhasz gmjuhasz added the Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR label May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR [Feature] Publicize Now Jetpack Social, auto-sharing [JS Package] Social Previews [Package] Publicize RNA [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant