fix(preview): increase whitespace padding to 200 chars for Gmail#3100
fix(preview): increase whitespace padding to 200 chars for Gmail#3100mvanhorn wants to merge 4 commits into
Conversation
|
@mvanhorn is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: aa54282 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
|
can you confirm this doesn't include extra whitespaces for other email clients? |
|
The whitespace padding uses zero-width Unicode characters (U+200C, U+200D, U+200E, U+200F, U+FEFF) in a hidden div with |
|
Hey @gabrielmfern, gentle ping on this -- the answer to your March question is in the comment above (zero-width Unicode chars in a |
|
Hey @mvanhorn, sorry for our delay on this. Can you please do a rebase? That would indeed help move this one to the finish line! thanks! |
Gmail shows up to 200 characters of preview text, but the Preview component only padded to 150 characters. This left a 50-character gap where body content could bleed into the preview snippet. Fixes resend#2268 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The CLI's email export test also has an inline snapshot that references the Preview component output. Updated to match the new 200-char limit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5783822 to
aa54282
Compare
|
Rebased onto canary (aa54282). All 4 commits replayed cleanly, no conflicts. Ready for another look whenever you have a minute. |
Summary
Increases
PREVIEW_MAX_LENGTHfrom 150 to 200 in the<Preview>component. Gmail shows up to 200 characters of preview text, so the previous 150-character limit left a gap where body content could bleed through into the email preview snippet.Changes
packages/preview/src/preview.tsx: ChangedPREVIEW_MAX_LENGTHconstant from 150 to 200packages/preview/src/preview.spec.tsx: Updated inline snapshots and assertions to match the new limitThe
renderWhiteSpace()function andsubstring()truncation both reference this constant, so all behavior updates automatically.Testing
Fixes #2268
This contribution was developed with AI assistance (Claude Code).
Summary by cubic
Pads email preview text to 200 chars in
@react-email/previewto match Gmail and prevent body content from bleeding into snippets. Updates thePreviewcomponent limit and refreshes related snapshots; long text still truncates.PREVIEW_MAX_LENGTHto 200 inpackages/react-email/src/components/preview/preview.tsx; updated inline snapshots inpackages/react-emailpreview tests, CLI export test, andpackages/uitest; added a changeset for@react-email/preview.Written for commit aa54282. Summary will update on new commits. Review in cubic