Social Previews: Remove maxLines limit from Nextdoor preview #107134
+1
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to Automattic/jetpack#45938
Proposed Changes
maxLines: FEED_TEXT_MAX_LINESfrom Nextdoor preview component to allow full text displayWhy are these changes being made?
The Nextdoor preview had a
maxLines: 2limit that was cutting off content when the excerpt contained Gutenberg block comments (e.g.,<!-- wp:paragraph -->). These HTML comments were being counted as lines, causing the preview to only show the title and truncate the actual description.Facebook's preview doesn't have this line limit and properly displays title + description despite having the same Gutenberg block comments in the excerpt. By removing the line limit from Nextdoor, it now behaves consistently with Facebook.
The
maxChars: 160limit is still in place for character truncation, which is the appropriate constraint.Testing Instructions
For Jetpack Testing:
To test this change in Jetpack before it's published to npm, you need to link the local package:
wp-calypso/packages/social-previews/, runpnpm link --globaljetpack/projects/js-packages/publicize-components/, runpnpm link --global @automattic/social-previewswp-calypso/packages/social-previews/, rebuild withyarn build(or usefswatchfor auto-rebuild)jetpack/, rebuild withjetpack build packages/publicizepnpm unlinkin Jetpack when doneTesting Steps:
Test with Automattic/jetpack#45938
Pre-merge Checklist