fix(email): improve mobile email rendering — scale wide HTML, tighten spacing#2146
fix(email): improve mobile email rendering — scale wide HTML, tighten spacing#2146evanhutnik merged 7 commits intomainfrom
Conversation
WalkthroughThis pull request updates visual layout and styling across several email components: Email (reduces the h1 bottom padding from Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@js/app/packages/block-email/component/EmailMessageBody.tsx`:
- Around line 224-250: The single measurement in requestAnimationFrame is
insufficient; update the code so applyScale() is re-run whenever layout or
content changes by attaching a ResizeObserver to the container (call applyScale
on resize), re-running applyScale on window resize as a fallback, and also
observe image load and DOM changes (e.g., MutationObserver on
container.shadowRoot or add load listeners to any <img> elements found) so that
when images finish loading or nodes change applyScale() is invoked; reference
the existing applyScale, container, and messageDiv to locate where to wire these
observers and remember to disconnect them on cleanup.
- Around line 219-243: The early return when !props.isBodyExpanded() leaves any
previously applied inline zoom/overflow on the host's content; update the
collapse path to clear those styles: when props.isBodyExpanded() is false,
obtain the same container via host(), access container.shadowRoot and query the
same messageDiv (as in applyScale), and reset messageDiv.style.zoom = '' and
messageDiv.style.overflow = '' before returning; alternatively move the current
reset logic (messageDiv.style.zoom/overflow = '') into a shared cleanup that
runs both on expand (before scaling) and on collapse so applyScale and the
collapse branch use the same clearing code.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: ae8a1016-67a8-4257-97d1-6055fe79446f
📒 Files selected for processing (3)
js/app/packages/block-email/component/Email.tsxjs/app/packages/block-email/component/EmailMessageBody.tsxjs/app/packages/block-email/component/MessageList.tsx
Summary
zoom. Prevents horizontal overflow/clipping of rich HTML emailstext-3xltotext-2xlfor better proportions on small screens.Before:

After:
