fix(preview): increase whitespace padding to 200 chars for Gmail#3100
Open
mvanhorn wants to merge 2 commits intoresend:canaryfrom
Open
fix(preview): increase whitespace padding to 200 chars for Gmail#3100mvanhorn wants to merge 2 commits intoresend:canaryfrom
mvanhorn wants to merge 2 commits intoresend:canaryfrom
Conversation
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>
Contributor
|
@mvanhorn is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
|
commit: |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 preview to 200 characters to match Gmail and stop body text leaking into the snippet. Updates
PREVIEW_MAX_LENGTHinpackages/preview, adjusts tests and the CLI export snapshot inpackages/react-email; long text still truncates.Written for commit 4f37e6d. Summary will update on new commits.