Skip to content

[pull] main from TryGhost:main#1086

Merged
pull[bot] merged 4 commits into
code:mainfrom
TryGhost:main
Apr 22, 2026
Merged

[pull] main from TryGhost:main#1086
pull[bot] merged 4 commits into
code:mainfrom
TryGhost:main

Conversation

@pull

@pull pull Bot commented Apr 22, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

cmraible and others added 4 commits April 21, 2026 17:47
no refs

There should be no user-facing impact to this change.

This blob report is sometimes generated when running e2e tests locally,
but shouldn't be committed.
ref
https://linear.app/ghost/issue/NY-1234/flaky-member-welcome-emails-e2e-test

This test has been flaky recently. Skipping it for now to avoid
disrupting CI while I work on a fix.
ref
https://linear.app/ghost/issue/NY-1228/add-the-frontend-editpreview-toggle-to-the-welcome-email-edit-modal

## What this changes

- adds an `Edit` / `Preview` toggle to the welcome email modal in Admin
- lets admins preview unsaved subject and body changes before saving
- loads the preview from the automated email preview endpoint and
renders it in an iframe sized to the email content
- preserves unsaved draft state when switching between edit and preview
- shows inline validation and preview loading/error states in the modal
- ignores stale out-of-order preview responses so older requests cannot
overwrite a newer draft

## Why

The welcome email editor previously only exposed the raw editing
experience, which made it harder to verify the final email output before
saving. This change adds an in-context preview flow so admins can check
both copy and rendered layout while keeping their draft intact.

## Implementation notes

- adds a dedicated `usePreviewWelcomeEmail` mutation and preview
response types in `admin-x-framework`
- updates the modal header layout to host the segmented mode switch
- normalizes preview HTML links to open safely in a new tab
- measures iframe height so the modal owns scrolling instead of the
preview document
- extends acceptance and browser E2E coverage for preview rendering and
draft preservation

---------

Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
ref fee402a

We had a utility function, `arePathsEqual`, which has been unused since
fee402a. Let's remove it.

`git grep arePathsEqual` returns no results after this change.
@pull pull Bot locked and limited conversation to collaborators Apr 22, 2026
@pull pull Bot added the ⤵️ pull label Apr 22, 2026
@pull pull Bot merged commit a04bf8d into code:main Apr 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants