feat(platform): add activate/deactivate toggle for custom agents#430
Conversation
📝 WalkthroughWalkthroughThis change introduces a new CustomAgentActiveToggle component for managing the activation state of custom agents. The component includes mutation handlers for activating archived agents and deactivating active agents with confirmation dialogs. The component is integrated into the custom agents table as a new column and added to the custom agent details page under the General tab. Supporting test coverage is provided, and localized i18n strings are added for labels, dialogs, and toast notifications. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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
🤖 Fix all issues with AI agents
In `@services/platform/app/routes/dashboard/`$id/custom-agents/$agentId/index.tsx:
- Around line 142-150: The CustomAgentActiveToggle is being passed a possibly
undefined agent from useCustomAgentVersion(), so guard rendering by checking the
agent before rendering the toggle: only render <CustomAgentActiveToggle
agent={agent} ... /> (and the helper <p>) when agent is truthy, or alternatively
render a loading/placeholder/disabled state until agent is defined; update the
JSX around CustomAgentActiveToggle and the surrounding Stack to conditionally
render based on agent (referencing the CustomAgentActiveToggle component and the
useCustomAgentVersion hook).
Add a Switch toggle to both the custom agents list table and the general settings tab, allowing direct activation/deactivation without navigating through dropdown menus. Draft agents have the toggle disabled since they require the full publish flow. Deactivation shows a confirmation dialog consistent with existing UX patterns.
ebf5dd1 to
33c6b18
Compare
Summary
Switchtoggle component for custom agents matching the existing automation toggle patternTest plan
npm run test:ui --workspace=@tale/platform— all 235 tests passnpm run lint --workspace=@tale/platform— 0 errorsSummary by CodeRabbit
New Features