feat(platform): add activate/deactivate toggle for automations#429
Conversation
Add a Switch toggle to both the automations list table and the configuration tab, allowing direct activation/deactivation without navigating through dropdown menus. Draft automations have the toggle disabled since they require the full publish flow. Deactivation shows a confirmation dialog consistent with existing UX patterns.
📝 WalkthroughWalkthroughThis PR implements an active/inactive state toggle feature for automations. It introduces a new Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
services/platform/app/features/automations/components/use-automations-table-config.tsx (1)
31-38: 🧹 Nitpick | 🔵 TrivialUse automations-specific archived label for consistency.
The status column currently uses
t.common('status.archived'); prefertEntity('navigation.archived')to match the automations context.Based on learnings: “In automations-related UI components, prefer using the navigation-specific localization key t('navigation.archived') instead of a generic status key like tCommon('status.archived') when the wording conveys a contextual meaning unique to automations navigation.”♻️ Suggested update
- : status === 'archived' - ? t.common('status.archived') + : status === 'archived' + ? tEntity('navigation.archived')
🤖 Fix all issues with AI agents
In
`@services/platform/app/features/automations/components/automation-active-toggle.tsx`:
- Around line 96-110: The wrapper div around the Switch causes the
noStaticElementInteractions lint error; remove the non-interactive wrapper and
move its event handlers to the interactive Switch component — attach
onClick={(e) => e.stopPropagation()} and onKeyDown={(e) => e.stopPropagation()}
directly to the Switch (while keeping checked={isActive},
onCheckedChange={handleToggle}, disabled={isDraft || isToggling}, label={label},
and aria-label={tAutomations('activeToggle.ariaLabel')}) so the stopPropagation
logic remains but the interaction is on an interactive element.
Move stopPropagation handlers from wrapper div to Switch component to fix noStaticElementInteractions lint error. Exclude app/features tests from default vitest config so they only run under jsdom via vitest.ui.config.mjs.
Closes #383
Summary
Switchtoggle component (AutomationActiveToggle) for directly activating/deactivating automationsTest plan
npm run test:ui --workspace=@tale/platform🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests