Skip to content

Added automations beta feature toggle#28379

Merged
EvanHahn merged 1 commit into
mainfrom
add-automations-beta-feature
Jun 15, 2026
Merged

Added automations beta feature toggle#28379
EvanHahn merged 1 commit into
mainfrom
add-automations-beta-feature

Conversation

@EvanHahn

@EvanHahn EvanHahn commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

closes https://linear.app/ghost/issue/NY-1321
ref #28384

Beta.feature.mp4

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bc1f1463-a097-40fe-b901-27870b598514

📥 Commits

Reviewing files that changed from the base of the PR and between eb1e486 and ae2e4f3.

📒 Files selected for processing (2)
  • apps/admin-x-settings/src/components/settings/advanced/labs/beta-features.tsx
  • apps/admin-x-settings/src/components/settings/advanced/labs/feature-toggle.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/admin-x-settings/src/components/settings/advanced/labs/beta-features.tsx
  • apps/admin-x-settings/src/components/settings/advanced/labs/feature-toggle.tsx

Walkthrough

The PR extends the feature-toggle system with optional confirmation-modal support and integrates it to add a guarded "Automations" beta lab toggle. FeatureToggle gains a confirmation prop accepting title, prompt, and button labels; when provided and the user enables the feature, a FeatureToggleConfirmationModal appears before persisting the setting. A new saveFeatureValue helper encapsulates the settings mutation, analytics event, and config cache update, returning success/failure. BetaFeatures reads the global labs setting and conditionally renders the Automations LabItem (disabled if already enabled) only when an IS_AUTOMATIONS_BETA_ACTIVE guard is true.

Possibly related PRs

  • TryGhost/Ghost#27872: Both PRs add/consume the labs.automations feature flag to conditionally hide/enable membership "Welcome emails" and the related "Automations" lab toggle UI, so the changes overlap in the same automations-labs gating logic.
  • TryGhost/Ghost#28263: Both PRs wire the same labs.automations feature-guard: the admin UI only enables the "Automations" beta toggle when that lab setting is active, while the server's automationsApi.trigger only triggers member-signup automation runs when labs.isSet('automations') is enabled.

Suggested reviewers

  • cmraible
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Added automations beta feature toggle' directly and clearly describes the main change: adding a beta feature toggle for automations, which matches the file changes introducing IS_AUTOMATIONS_BETA_ACTIVE guard and conditional LabItem rendering.
Description check ✅ Passed The description references a Linear issue (NY-1321) and GitHub PR that the changes address, and includes a video link demonstrating the feature, indicating clear relation to the changeset.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-automations-beta-feature

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-automations-beta-feature branch from d091006 to eb009a3 Compare June 5, 2026 15:49
EvanHahn added a commit that referenced this pull request Jun 8, 2026
towards https://linear.app/ghost/issue/NY-1321

*This change should have no user impact.*

This fixes two things with `<Toggle>`:

- Updates the props so the component is either [controlled or
  uncontrolled][0]. In other words, it should be impossible to pass
  `checked` without passing `onChange`, and vice-versa.

- Uses `checked`, not `defaultChecked`, to properly control the input.
  This means we can update `<Toggle>`s without having to extra work to
  make it re-render.

I think this is a useful change on its own, but will also make [an
upcoming change][1] easier.

[0]: https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable
[1]: #28379
EvanHahn added a commit that referenced this pull request Jun 8, 2026
towards https://linear.app/ghost/issue/NY-1321

*This change should have no user impact.*

This fixes two things with `<Toggle>`:

- Updates the props so the component is either [controlled or
  uncontrolled][0]. In other words, it should be impossible to pass
  `checked` without passing `onChange`, and vice-versa.

- Uses `checked`, not `defaultChecked`, to properly control the input.
  This means we can update `<Toggle>`s without having to extra work to
  make it re-render.

I think this is a useful change on its own, but will also make [an
upcoming change][1] easier.

[0]: https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable
[1]: #28379
@EvanHahn EvanHahn force-pushed the add-automations-beta-feature branch from eb009a3 to edc8a2a Compare June 8, 2026 18:32
@EvanHahn EvanHahn changed the base branch from main to fix-toggle-checked June 8, 2026 18:32
Base automatically changed from fix-toggle-checked to main June 11, 2026 12:18
@EvanHahn EvanHahn force-pushed the add-automations-beta-feature branch from edc8a2a to 30eeeb7 Compare June 11, 2026 13:08
@EvanHahn EvanHahn marked this pull request as ready for review June 11, 2026 13:08
@EvanHahn EvanHahn force-pushed the add-automations-beta-feature branch from 30eeeb7 to eb1e486 Compare June 11, 2026 14:45
@EvanHahn EvanHahn added the ok to merge for me You can merge this on my behalf if you want. label Jun 11, 2026
@EvanHahn EvanHahn force-pushed the add-automations-beta-feature branch from eb1e486 to ae2e4f3 Compare June 11, 2026 14:59
@EvanHahn EvanHahn requested a review from peterzimon June 11, 2026 15:22
okRunningLabel: 'Enabling...'
}}
disabled={isAutomationsEnabled}
flag="automations"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same as the labs flag.

@EvanHahn EvanHahn merged commit fac23a5 into main Jun 15, 2026
47 checks passed
@EvanHahn EvanHahn deleted the add-automations-beta-feature branch June 15, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok to merge for me You can merge this on my behalf if you want.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants