feat(email-viewer): message spacing setting (auto/always/edge-to-edge) - #660
Merged
Merged
Conversation
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.
Follow-up to #595, built the way you asked ("i want this as a setting").
The problem (from #595)
The reader zeroes the message-body gutter whenever an email contains a
<style>tag (hasOwnLayout = hasStyleTag && !isWordHtml). Plenty of transactional mails ship a<style>block only for web fonts and have no gutter of their own, so their content renders glued to the top-left corner (a Namecheap order receipt was the reported case).The setting
New Message Spacing option under Settings → Reading:
width:100%element carrying a background colour — which is the one case where our gutter shows as a frame around the email's own backgroundAuto keeps it working out of the box; the two explicit modes let users force either extreme. A
<style>tag alone is no longer treated as "this mail brings its own layout".Changes
stores/settings-store.ts—MessageSpacingtype,messageSpacingstate (default'auto'), added to the persist allowlistcomponents/email/email-viewer.tsx— full-bleed-canvas detection drivesauto; setting overrides it; added to the srcDoc memo depscomponents/settings/reading-settings.tsx— Select control (respects the existing policy lock/hide hooks)settings.email_behavior.message_spacing.*(en + he)Testing
<style>, no full-bleed canvas) → Auto gives it the gutterwidth:100%bgcolor canvas → Auto stays edge-to-edge (no white frame)tscclean; lint clean (no new warnings)