feat(frontend): Redesigned the schedule/trigger drawers and UI/UX - #5975
Conversation
…es for improved clarity and functionality - Updated MessageComposer story to utilize the new component structure and enhance documentation. - Simplified ScheduleBuilderField story by removing deprecated code and improving the layout for better readability. - Refactored WindowField story to streamline the component usage and clarify the optional start/end bounds functionality. - Removed unused imports and legacy code to maintain a clean codebase.
…onents; update SubscriptionForm for improved structure and functionality - Deleted SubscriptionDrawerContent and SubscriptionsList components to streamline the subscription drawer. - Refactored SubscriptionForm to enhance readability and maintainability, including changes to state management and event handling. - Introduced suggestSubscriptionName helper function for better naming conventions. - Updated constants and helpers to reflect the removal of unused code and improve clarity. - Enhanced UI components for better user experience, including adjustments to select and time-picker components.
- Introduced `useBoundAgentShape` to retrieve the shape of bound agents, improving the handling of agent workflows. - Updated `InputsMappingField` to simplify mapping validation and enhance the user experience with event fields. - Modified `MappingSection` to ensure the raw JSON editor is only shown when necessary, improving usability. - Enhanced `SourceField` to include a clear button for better user interaction. - Updated `SubscriptionForm` to integrate event filters directly under the event selection, ensuring necessary filters are visible. - Refactored storybook examples for `SubscriptionChildRow` and `TriggerRow` to reflect the latest UI changes and improve clarity.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR redesigns gateway trigger schedules and subscriptions around agent bindings. It adds shared schedule, message, mapping, date, and time controls. It moves actions into menus and removes legacy master-detail and comparison implementations. ChangesGateway trigger redesign
Estimated code review effort: 5 (Critical) | ~120 minutes Mergeability Score: ⚪ Minimal · up to No actionable merge-blocking risk remains; the PR is merge-ready after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant TriggerDrawer
participant useTriggerBinding
participant AgentField
participant VersionField
participant ScheduleForm
participant GatewayAPI
TriggerDrawer->>ScheduleForm: mount schedule form
ScheduleForm->>useTriggerBinding: resolve stored or selected binding
ScheduleForm->>AgentField: select connected agent
ScheduleForm->>VersionField: select latest or pinned version
ScheduleForm->>GatewayAPI: save schedule with references and message
GatewayAPI-->>TriggerDrawer: return saved schedule
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
|
demo incoming |
…pe transformation refactor: update ParameterTree to import RowRemoveButton from the correct path refactor: optimize ScheduleTriggerRow by memoizing cadence and next run calculations refactor: simplify useDriftTag by consolidating revision fetching logic refactor: clean up DrawerFooter by removing unused Active toggle logic refactor: remove MasterDetailRail component and related stories feat: implement RowRemoveButton as a separate component for better reusability feat: enhance ScheduleForm to handle message shape changes dynamically refactor: streamline EventSourcePicker by removing unnecessary props refactor: update RunVersionField to use bound revision logic for better accuracy refactor: clean up VersionField to utilize bound revision for version display feat: introduce useShapeChange hook to manage message shape transitions refactor: remove unused constants and functions in MappingSection and helpers
…emove Lightning icon from Test event button in MappingSection
…roups header logic; add AppLogo to IntegrationsView; enhance ScheduleForm and SubscriptionForm with ag-scroll-quiet class for improved scrollbar behavior
…improve user experience during data fetching
|
@coderabbitai review |
|
Railway Preview Environment
|
There was a problem hiding this comment.
Actionable comments posted: 18
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/schedule/ScheduleForm.tsx (1)
134-170: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winAn agent rebind can leave Save disabled.
baselineSnapshotusesbindingKey(resolved)andisDirtycompares it againstbindingKey(activeBinding). The agent handler at lines 356-360 setsagentWorkflowIdand resetsbindingtonull, soactiveBindingfalls back toresolved.useTriggerBindingfeedsagentWorkflowIdintoresolvedwhenever the stored references do not name a workflow. Both sides of the comparison then move together, the binding change cancels out, andisDirtystays false.In edit mode this blocks the save: the user picks a different agent, nothing else changes, and the Save button remains disabled.
Derive the baseline binding from the stored or default references only, so a user-picked agent is never folded into the baseline.
🐛 Proposed direction
const storedReferences = schedule?.data?.references const resolved = useTriggerBinding({ storedReferences: isEdit ? storedReferences : state?.defaultReferences, playgroundEntityId, agentWorkflowId, }) + // Baseline binding: the persisted/default one, unaffected by the agent the user picks. + const baselineBinding = useTriggerBinding({ + storedReferences: isEdit ? storedReferences : state?.defaultReferences, + playgroundEntityId, + })Then use
bindingKey(baselineBinding)inbaselineSnapshotand keepbindingKey(activeBinding)inisDirty.
🧹 Nitpick comments (10)
web/storybook/stories/entity-ui/MessageComposer.stories.tsx (1)
6-10: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReduce the Storybook source comments to one short line.
Remove migration-history detail. Keep one short comment only when it documents a surprising constraint.
web/storybook/stories/entity-ui/MessageComposer.stories.tsx#L6-L10: replace the multi-line composer and retired-harness explanation.web/storybook/stories/entity-ui/ScheduleBuilderField.stories.tsx#L6-L11: replace the multi-line control and retired-harness explanation.web/storybook/stories/entity-ui/SubscriptionChildRow.stories.tsx#L8-L11: shorten the component and menu explanation.web/storybook/stories/entity-ui/TriggerRow.stories.tsx#L17-L18: remove the added migration-history sentence.web/storybook/stories/entity-ui/WindowField.stories.tsx#L6-L11: replace the multi-line picker and retired-harness explanation.As per coding guidelines, “Keep in-code comments to at most one short line; use longer comments only for genuinely surprising constraints such as bugs, races, or ordering requirements.”
Source: Coding guidelines
web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/EventFieldList.tsx (1)
64-96: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low valueHoist
TooltipProviderout of the row loop.Each row mounts its own
TooltipProvider. One provider around the whole list gives the same behavior with fewer context providers, and it keeps the shareddelayDurationin one place.♻️ Proposed refactor
return ( - <div className={`flex flex-col gap-0.5 overflow-y-auto ${className}`}> - {fields.map((f) => ( - <TooltipProvider key={f.key} delayDuration={400}> - <Tooltip> + <TooltipProvider delayDuration={400}> + <div className={`flex flex-col gap-0.5 overflow-y-auto ${className}`}> + {fields.map((f) => ( + <Tooltip key={f.key}>Close the new wrapper at the end of the list.
web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/MappingSection.tsx (2)
163-178: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the duplicated test-event picker.
The same
EventSourcePickerblock with the same trigger button markup and the same props appears in the non-agent branch here and in the agent branch at lines 200-215. One local component keeps the two headers in sync when the wait hint or the button style changes.♻️ Proposed refactor
+function TestEventPicker({ + recentEvents, + onPick, + onWaitForEvent, +}: { + recentEvents: SampledEvent[] + onPick: (event: SampledEvent) => void + onWaitForEvent?: () => Promise<SampledEvent | null> +}) { + return ( + <EventSourcePicker + placement="bottomRight" + trigger={ + <button + type="button" + className="flex cursor-pointer items-center gap-1 border-0 bg-transparent p-0 text-xs font-medium text-[var(--ag-colorTextSecondary)] hover:text-[var(--ag-colorText)]" + > + Test event + </button> + } + recentEvents={recentEvents} + onPick={onPick} + onWaitForEvent={onWaitForEvent} + waitHint="trigger it from the app now" + captureMode + /> + ) +}Then render
<TestEventPicker …/>in both branches.
66-71: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low valueMemoize
richerThanComposer.
parseMessageTemplate(value, isChat, primaryKey)runs on every render, including renders that only toggleraworfieldsOpen. AuseMemoon the same inputs removes the repeated parse and matches the memoization guideline for changed surfaces.♻️ Proposed refactor
- const richerThanComposer = - !!value.trim() && parseMessageTemplate(value, isChat, primaryKey) === "" + const richerThanComposer = useMemo( + () => !!value.trim() && parseMessageTemplate(value, isChat, primaryKey) === "", + [value, isChat, primaryKey], + )As per coding guidelines: "Minimize React re-renders with
useMemo,useCallback, andReact.memowhere appropriate".Source: Coding guidelines
web/packages/agenta-entities/src/gatewayTrigger/core/scheduleBuilder.ts (1)
176-177: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winThe
describeCronfallback is unreachable.
state.cron.trim()is falsy only for an empty or whitespace expression.describeCron("")fails validation and returns the same empty expression, so the right operand can never add text. The custom branch therefore always yields the raw expression or "".If the raw expression is the intended output, drop the dead operand and the now-unused import path. If a humanized description is intended for a valid expression, invert the operands.
♻️ Proposed simplification
case "custom": - return state.cron.trim() || describeCron(state.cron) + return state.cron.trim()web/packages/agenta-entity-ui/src/drawers/shared/Labelled.tsx (1)
8-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winGive
Labelleda way to name its control.The label renders as a
spanwith no association to the control. Screen readers therefore read the wrappedInput,AutosizeTextarea, and RadixSelectTriggerwithout a name.WindowFieldalready solves this locally withuseIdplusaria-labelledby, so the pattern exists in the same feature.Expose the generated id so each consumer can wire
aria-labelledby(orhtmlForfor native inputs).♿ Proposed change to expose a label id
-import type {ReactNode} from "react" +import {useId, type ReactNode} from "react" /** * One labelled field in a drawer's flat field stack — the shape both trigger drawers use in * place of the old accordion sections. A label and its control, nothing else: status chips, * summaries and required markers were what made the sections heavy. */ -export function Labelled({label, children}: {label: string; children: ReactNode}) { +export function Labelled({ + label, + children, +}: { + label: string + children: ReactNode | ((labelId: string) => ReactNode) +}) { + const labelId = useId() return ( <div className="flex flex-col gap-2"> - <span className="text-xs font-medium text-[var(--ag-colorTextDescription)]"> + <span + id={labelId} + className="text-xs font-medium text-[var(--ag-colorTextDescription)]" + > {label} </span> - {children} + {typeof children === "function" ? children(labelId) : children} </div> ) }web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/schedule/MessageComposer.tsx (1)
25-39: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winGuard the first edit when
wouldReplaceis true.The raw-JSON editor is gone, so richer
inputs_fieldscan no longer be viewed or restored in this drawer. The textarea stays editable whilewouldReplaceis true, so one keystroke callssetScheduleMessageand discards the whole mapping. The user has no way to recover the previous value.Require an explicit acknowledgement before the first destructive edit. For example, keep the textarea read-only while
wouldReplaceis true and add a "Replace inputs" action that clears the guard.This makes the warning at lines 47-48 actionable instead of advisory.
web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/schedule/ScheduleForm.tsx (1)
86-86: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the stale Active-toggle comment.
The footer Active toggle is gone, so nothing calls
setEnabledoutside hydration. For a new scheduleenabledis therefore alwaystrue, and the comment at line 280 describes a control that no longer exists.Keep the
is_active: truedefault for create, and correct the comment. Also dropsetEnabledfrom the create path reasoning so the next reader does not look for a missing toggle.♻️ Proposed comment fix
- // Honor the Active toggle at creation (otherwise the BE defaults to active). + // New schedules start active; pause is done from the triggers list. flags: {is_active: enabled},Also applies to: 280-281
web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/shared/VersionField.tsx (1)
78-84: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winShare the "real revisions, newest first" rule with
useBoundRevision.Lines 78-84 filter
version !== 0and sort descending.useBoundRevisioninuseTriggerBinding.ts(lines 219-226) applies the same two rules. The file header ofuseTriggerBinding.tsstates that these copies had already drifted apart once. Export one helper fromuseTriggerBinding.tsand call it here, so the list order and the resolved "Latest" revision cannot diverge again.web/packages/agenta-ui/package.json (1)
125-125: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueVersion is current; note the preferred v10 package name.
10.0.1is the latest published version, and DayPicker is compatible with React 16.8 and later, so the peer range in this package is satisfied. For information: the recommended v10 package name is@daypicker/react; the react-day-picker package name remains available in v10 for compatibility, so existing imports can still work. Keepingreact-day-pickeris valid. Consider the scoped name in a later dependency pass.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: bccb189c-5d2f-4019-9d30-338a4114fc9b
⛔ Files ignored due to path filters (1)
web/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (69)
web/oss/src/components/pages/settings/Triggers/components/GatewaySchedulesSection.tsxweb/oss/src/components/pages/settings/Triggers/components/GatewaySubscriptionsSection.tsxweb/oss/src/components/pages/settings/Triggers/components/useAgentNameById.tsweb/packages/agenta-entities/src/gatewayTrigger/core/messageInputs.tsweb/packages/agenta-entities/src/gatewayTrigger/core/scheduleBuilder.tsweb/packages/agenta-entities/src/gatewayTrigger/core/types.tsweb/packages/agenta-entities/src/gatewayTrigger/core/window.tsweb/packages/agenta-entities/src/gatewayTrigger/index.tsweb/packages/agenta-entities/tests/unit/gatewayTriggerMessageInputs.test.tsweb/packages/agenta-entities/tests/unit/gatewayTriggerScheduleBuilder.test.tsweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/TriggerManagementSection.tsxweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/ParameterTree.tsxweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/sectionGroups.tsxweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/triggerManagement/AppTriggerProviderGroups.tsxweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/triggerManagement/ScheduleTriggerRow.tsxweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/triggerManagement/SubscriptionChildRow.tsxweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/triggerManagement/TriggerRow.tsxweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/triggerManagement/useDriftTag.tsweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/triggerManagement/useSubscriptionRun.tsweb/packages/agenta-entity-ui/src/DrillInView/index.tsweb/packages/agenta-entity-ui/src/drawers/shared/DrawerFooter.tsxweb/packages/agenta-entity-ui/src/drawers/shared/GatewayCatalogDrawer.tsxweb/packages/agenta-entity-ui/src/drawers/shared/Labelled.tsxweb/packages/agenta-entity-ui/src/drawers/shared/MasterDetailRail.tsxweb/packages/agenta-entity-ui/src/drawers/shared/RowRemoveButton.tsxweb/packages/agenta-entity-ui/src/drawers/shared/index.tsweb/packages/agenta-entity-ui/src/drawers/shared/useDraftMasterDetail.tsweb/packages/agenta-entity-ui/src/gatewayTool/components/SchemaForm.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/ScheduleBuilderField.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/TriggerScheduleDrawer.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/TriggerSubscriptionDrawer.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/schedule/MessageComposer.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/schedule/ScheduleDrawerContent.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/schedule/ScheduleForm.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/schedule/SchedulesList.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/schedule/WindowField.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/schedule/constants.tsweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/shared/AgentField.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/shared/EventSourcePicker.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/shared/FormSkeleton.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/shared/RequiredTitle.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/shared/RunVersionField.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/shared/VersionField.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/shared/useShapeChange.tsweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/shared/useTriggerBinding.tsweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/EventFieldList.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/InputsMappingField.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/MappingSection.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/SourceBrowsePage.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/SourceField.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/SubscriptionDrawerContent.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/SubscriptionForm.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/SubscriptionsList.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/constants.tsweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/helpers.tsweb/packages/agenta-ui/package.jsonweb/packages/agenta-ui/src/components/ui/calendar.tsxweb/packages/agenta-ui/src/components/ui/date-picker.tsxweb/packages/agenta-ui/src/components/ui/date-time-picker.tsxweb/packages/agenta-ui/src/components/ui/index.tsweb/packages/agenta-ui/src/components/ui/select.tsxweb/packages/agenta-ui/src/components/ui/time-picker.tsxweb/packages/agenta-ui/src/components/ui/tooltip.tsxweb/storybook/stories/entity-ui/MasterDetailRail.stories.tsxweb/storybook/stories/entity-ui/MessageComposer.stories.tsxweb/storybook/stories/entity-ui/ScheduleBuilderField.stories.tsxweb/storybook/stories/entity-ui/SubscriptionChildRow.stories.tsxweb/storybook/stories/entity-ui/TriggerRow.stories.tsxweb/storybook/stories/entity-ui/WindowField.stories.tsx
💤 Files with no reviewable changes (9)
- web/packages/agenta-entity-ui/src/drawers/shared/useDraftMasterDetail.ts
- web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/shared/RequiredTitle.tsx
- web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/schedule/ScheduleDrawerContent.tsx
- web/packages/agenta-entity-ui/src/DrillInView/index.ts
- web/storybook/stories/entity-ui/MasterDetailRail.stories.tsx
- web/packages/agenta-entity-ui/src/drawers/shared/MasterDetailRail.tsx
- web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/SubscriptionsList.tsx
- web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/SubscriptionDrawerContent.tsx
- web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/schedule/SchedulesList.tsx
…ption toggles; update binding logic in forms
…refactor existing tooltips in SchemaForm and MappingSection
…rm; clean up related code
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 0790961c-099e-47e0-8e11-28a30d66d5b1
📒 Files selected for processing (18)
web/oss/src/components/pages/settings/Triggers/components/GatewaySchedulesSection.tsxweb/oss/src/components/pages/settings/Triggers/components/GatewaySubscriptionsSection.tsxweb/oss/src/components/pages/settings/Triggers/components/useAgentNameById.tsweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/triggerManagement/AppTriggerProviderGroups.tsxweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/triggerManagement/ScheduleTriggerRow.tsxweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/triggerManagement/SubscriptionChildRow.tsxweb/packages/agenta-entity-ui/src/drawers/shared/DrawerFooter.tsxweb/packages/agenta-entity-ui/src/drawers/shared/HelpTip.tsxweb/packages/agenta-entity-ui/src/gatewayTool/components/SchemaForm.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/ScheduleBuilderField.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/schedule/ScheduleForm.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/shared/EventSourcePicker.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/shared/useTriggerBinding.tsweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/MappingSection.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/SubscriptionForm.tsxweb/packages/agenta-ui/src/components/ui/date-picker.tsxweb/packages/agenta-ui/src/components/ui/date-time-picker.tsxweb/packages/agenta-ui/src/components/ui/time-picker.tsx
🚧 Files skipped from review as they are similar to previous changes (13)
- web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/ScheduleBuilderField.tsx
- web/oss/src/components/pages/settings/Triggers/components/GatewaySchedulesSection.tsx
- web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/triggerManagement/SubscriptionChildRow.tsx
- web/packages/agenta-ui/src/components/ui/time-picker.tsx
- web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/triggerManagement/ScheduleTriggerRow.tsx
- web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/MappingSection.tsx
- web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/schedule/ScheduleForm.tsx
- web/oss/src/components/pages/settings/Triggers/components/GatewaySubscriptionsSection.tsx
- web/packages/agenta-ui/src/components/ui/date-time-picker.tsx
- web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/shared/useTriggerBinding.ts
- web/packages/agenta-entity-ui/src/gatewayTrigger/drawers/shared/EventSourcePicker.tsx
- web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/triggerManagement/AppTriggerProviderGroups.tsx
- web/packages/agenta-entity-ui/src/gatewayTool/components/SchemaForm.tsx
Context
The schedule and subscription drawers rendered two different UIs for the same object. Opened from a playground they became a 960px master-detail manager (list rail on the left, config on the right); opened from settings they were a plain 640px form. Two layouts, two mount paths, two sets of state. Inside the form, picking which version a trigger runs meant walking a workflow → variant → revision cascader, the sampled event was drawn three separate ways (a chip strip, a raw JSON dump, a per-path preview), and the schedule editor sat permanently open as a control panel.
Changes
Both hosts now render the same single form at 640px. The master-detail layer is gone (
MasterDetailRail,useDraftMasterDetail,SchedulesList,SubscriptionsList,ScheduleDrawerContent,SubscriptionDrawerContent). The playground passes its agent, so the drawer drops the Agent field, puts the agent name in the title, and keeps "Run in playground" in the footer. Settings picks the agent with a newAgentField.The form reads as a flat stack: Name, Agent (settings only), Schedule or Trigger, Message, and an Advanced disclosure holding Version and the active window.
Version binding.
VersionFieldreplaces the cascader with one Select: a "Latest" entry per variant plus that variant's revisions beneath it. The two answers persist differently, which is why they can't be collapsed:Latest (backend resolves the newest revision on each run):
{"application": {"id": "..."}, "application_variant": {"id": "..."}}
Pinned:
{"application": {"id": "..."}, "application_revision": {"id": "..."}}
useTriggerBindingowns reading that shape back. The drawer label and the row's drift tag now resolve through it together; read separately they disagreed about pinned revisions and could name two different versions for one trigger. The tag only appears when the trigger targets something other than the open revision ("Runs on v3", "Runs on latest version").Message shape migration. Both drawers learn
isChat/primaryKeyfrom an async query, so a message typed before the agent resolved was stored under the wrong key. Re-reading it under the resolved shape returned "", the composer looked empty, and the save went out against an agent that couldn't receive it.remapMessageShapemoves the message across and deletes the old key:Before: {"message": "summarize this"}
After: {"messages": [{"role": "user", "content": "summarize this"}]}
Schedule builder. The row collapses to words plus a next run ("Weekdays at 09:00 UTC", "Next run Mon 17 Aug, 09:00 UTC · in 2 days") and everything editable moved into a popover. List phrases are capped at three entries with a "+N" tail, so a monthly schedule on 31 days no longer truncates mid-word.
Event mapping.
EventFieldListis now the single view of the sampled event: one row per field showing what the selector resolves to right now, clicking it writes the selector into the mapping. The raw JSON editor is kept for non-agent targets only.New UI primitives.
DatePicker,TimePickerand a combinedDateTimePickerin@agenta/ui(addsreact-day-picker), replacing the antd DatePicker in the active-window field. Each half replaces only its own component, so setting a time keeps the day and picking a day keeps the time.Rows and tables. The playground trigger rows gained Run in playground and Pause/Resume in the menu. In settings, "Bound workflow" became "Connected agent" resolved from the applications list;
workflowMolecule.artifactNameis scoped to an open app, so on settings pages it never resolved and the column fell back to raw ids. The Window column only renders when a row actually uses one.Tests
pnpm vitest run tests/unit/gatewayTriggerMessageInputs.test.ts tests/unit/gatewayTriggerScheduleBuilder.test.tsin@agenta/entities: 45 passing, including a newremapMessageShapesuite (both shape directions, sibling keys preserved, unreadable mappings left untouched).pnpm run types:checkin@agenta/entity-ui: clean.MasterDetailRail.stories.tsxdeleted with the component; the MessageComposer, ScheduleBuilderField, WindowField, TriggerRow and SubscriptionChildRow stories were rewritten against the new components.What to QA
Preview