Skip to content

Added Save button for inactive automations#28055

Merged
troyciesco merged 3 commits into
mainfrom
add-save-button-for-inactive-automations
May 25, 2026
Merged

Added Save button for inactive automations#28055
troyciesco merged 3 commits into
mainfrom
add-save-button-for-inactive-automations

Conversation

@EvanHahn
Copy link
Copy Markdown
Contributor

closes https://linear.app/ghost/issue/NY-1257

Screencast.mp4

This was largely written by GPT-5.5 (High) with the following prompt:

Currently, the Automations editor has no way to save an inactive automation without publishing it. For example, if you're working on an automation and haven't finished but need to walk away, you want to click Save, not Publish. Let's add this.

When an automation is inactive, add a secondary "Save" button to the left of the publish button in <AutomationHeader>. Clicking this button should call editMutation.mutate() like we already do in Automations/editor.tsx, but it shouldn't change the status.

When an automation is active, I don't want it to look any different from today. There should be no "Save" button or anything different in that part of the UI.

Use red/green TDD to accomplish this.

I manually cleaned up a small amount afterward.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds a Save action for inactive automations: AutomationHeader gains save-button props and renders Save only when status === 'inactive'. AutomationEditor introduces a 'saving' edit state, resets failure states on edit, refactors a unified save(newStatus?) helper that sets mutate.payload.status, derives Save-button UI (enabled/variant/label) from editState, and wires publish/save/turn-off to call save(...) consistently. Tests cover saving an inactive automation and assert Save is absent for active automations.

Possibly related PRs

  • TryGhost/Ghost#27852: Both PRs modify AutomationHeader’s UI/actions and conditional rendering based on automation status.
  • TryGhost/Ghost#27857: Updates automations UI wiring for status changes between AutomationHeader and AutomationEditor; overlaps with this PR's save/unpublish wiring.
  • TryGhost/Ghost#27878: Related refactor of the editor save/publish mutation payload shape and useEditAutomation mutation hook used by this PR.

Suggested labels

ok to merge for me

Suggested reviewers

  • troyciesco
  • cmraible
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a Save button for inactive automations, which is the core feature across all modified files.
Description check ✅ Passed The description is related to the changeset, explaining the feature motivation, implementation approach, and UI behavior for both inactive and active automations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-save-button-for-inactive-automations

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.

@EvanHahn EvanHahn force-pushed the add-save-button-for-inactive-automations branch from 9e282f7 to 894eebb Compare May 21, 2026 22:39
coderabbitai[bot]

This comment was marked as resolved.

@EvanHahn EvanHahn force-pushed the add-save-button-for-inactive-automations branch 2 times, most recently from 134dd80 to b2fbd8e Compare May 22, 2026 00:38
coderabbitai[bot]

This comment was marked as low quality.

@EvanHahn EvanHahn force-pushed the add-save-button-for-inactive-automations branch from b2fbd8e to 51d1dd0 Compare May 23, 2026 17:32
coderabbitai[bot]

This comment was marked as resolved.

@EvanHahn EvanHahn force-pushed the add-save-button-for-inactive-automations branch from 51d1dd0 to 7dcee66 Compare May 23, 2026 17:45
coderabbitai[bot]

This comment was marked as resolved.

closes https://linear.app/ghost/issue/NY-1257

This was largely written by GPT-5.5 (High) with the following prompt:

> Currently, the Automations editor has no way to save an inactive
> automation without publishing it. For example, if you're working on an
> automation and haven't finished but need to walk away, you want to
> click Save, not Publish. Let's add this.
>
> When an automation is inactive, add a secondary "Save" button to the
> left of the publish button in `<AutomationHeader>`. Clicking this
> button should call `editMutation.mutate()` like we already do in
> `Automations/editor.tsx`, but it shouldn't change the `status`.
>
> When an automation is active, I don't want it to look any different
> from today. There should be no "Save" button or anything different in
> that part of the UI.
>
> Use red/green TDD to accomplish this.

I manually cleaned up a small amount afterward.
@EvanHahn EvanHahn force-pushed the add-save-button-for-inactive-automations branch from 7dcee66 to 0387f66 Compare May 24, 2026 20:25
coderabbitai[bot]

This comment was marked as resolved.

@EvanHahn EvanHahn requested a review from troyciesco May 24, 2026 20:47
Comment thread apps/posts/src/views/Automations/editor.tsx Outdated
@EvanHahn EvanHahn requested a review from troyciesco May 25, 2026 14:32
@troyciesco troyciesco merged commit 4c21df9 into main May 25, 2026
42 checks passed
@troyciesco troyciesco deleted the add-save-button-for-inactive-automations branch May 25, 2026 15:04
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.

2 participants