Skip to content

Added confirmation before deleting automation emails#28309

Closed
peterzimon wants to merge 10 commits into
mainfrom
NY-1301/automations-error-handling
Closed

Added confirmation before deleting automation emails#28309
peterzimon wants to merge 10 commits into
mainfrom
NY-1301/automations-error-handling

Conversation

@peterzimon
Copy link
Copy Markdown
Contributor

What changed

  • Added a confirmation dialog before deleting send email steps from the Automations canvas.
  • Kept the existing immediate deletion behavior for non-email steps.
  • Added unit coverage for cancelling and confirming email deletion.

Why

Deleting an email step was immediate, which made accidental removals too easy while editing an automation draft. The confirmation keeps the draft-save/publish flow intact while adding a safer interaction for email cards.

Validation

  • pnpm --filter @tryghost/posts test -- automations/automation-editor.test.tsx
  • Pre-commit lint-staged ESLint check passed for the staged files.

ref https://linear.app/tryghost/issue/NY-1301/

Deleting an email step was immediate, which made accidental removals too easy while editing an automation draft. This adds a confirmation step for email deletion while preserving the existing draft-save flow.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b56fa3de-ad7c-4adf-9a1a-8a33699682ce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch NY-1301/automations-error-handling

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

ref https://linear.app/tryghost/issue/NY-1301/

Creating a new email step left the user on the canvas, so the next edit required an extra click and the browser could scroll the canvas while focusing the sidebar. This selects the inserted email immediately and focuses its subject field without scrolling.
ref https://linear.app/tryghost/issue/NY-1301/

Email steps can now start with an empty subject, so save and publish need clear validation feedback when a subject is required. This adds a toast plus inline card errors that only appear after validation and clear as users fix the affected email steps.
ref https://linear.app/tryghost/issue/NY-1301/

Opening an email step should put the user straight into the subject field, whether the email is newly created or selected later. This moves focus ownership into the email sidebar itself and keeps the existing no-scroll behavior.
ref https://linear.app/tryghost/issue/NY-1301/

This gives editors lightweight feedback when an automation email has no body while keeping blocking save errors visually prioritized.
ref https://linear.app/tryghost/issue/NY-1301/

This prevents editors from accidentally publishing automations that contain emails without body content while keeping empty bodies as warnings instead of blocking validation errors.
fireEvent.click(screen.getByRole('button', {name: 'Publish changes'}));

const dialog = screen.getByRole('alertdialog', {name: 'Update automation?'});
expect(within(dialog).getByText(new RegExp(EMPTY_BODY_PUBLISH_CONFIRMATION_MESSAGE.replace(/[.?]/g, '\\$&')))).toBeInTheDocument();
ref https://linear.app/tryghost/issue/NY-1301/

This replaces the disabled tail add-step affordance with a clearer non-interactive limit indicator and clarifies the email content editing action.
ref https://linear.app/tryghost/issue/NY-1301/

This avoids showing a wait-step validation error while the user is still editing the days field and waits until focus leaves the input.
ref https://linear.app/tryghost/issue/NY-1301/

This clarifies the save failure toast and delay input error so editors get more direct recovery guidance.
ref https://linear.app/tryghost/issue/NY-1301/

This tightens the maximum-step indicator copy and keeps the background stripe treatment balanced.
@peterzimon peterzimon changed the title [codex] Added confirmation before deleting automation emails Added confirmation before deleting automation emails Jun 2, 2026
@EvanHahn
Copy link
Copy Markdown
Contributor

EvanHahn commented Jun 3, 2026

Small drive-by note: I'd make sure we don't merge this with the "🎨" emoji (or any emoji) because this feature is not available to users yet.

@troyciesco troyciesco self-requested a review June 3, 2026 14:59
troyciesco added a commit that referenced this pull request Jun 4, 2026
closes
[NY-1301](https://linear.app/ghost/issue/NY-1301/design-onsave-warning-error)

### What changed

- Added a confirmation dialog before deleting send email steps from the
Automations canvas.
- Kept the existing immediate deletion behavior for non-email steps.
- allows saving automations with send_email steps that have an empty
body/subject, but does not allow publishing the automation until those
fields are filled in.
- Added unit coverage for cancelling and confirming email deletion.


This replaces #28309 but has a few
extra pieces of cleanup and fixes merge conflicts from other automations
changes

---------

Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
@troyciesco
Copy link
Copy Markdown
Contributor

closed in favor of #28364

@troyciesco troyciesco closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants