Skip to content

Conversation

@codiearyan
Copy link
Contributor

Fixes #14723

Summary

Fixes a UI while creating a custom CRON

Changes Made

  • updated WorkflowEditTriggerCronForm.tsx to use the predefined FormSelectFieldInput.tsx instead of using Select.tsx
  • added hint prop to FormSelectFieldInput.tsx
  • updated styling for showing Upcoming execution time
  • added conditional render for Schedule and Upcoming Execution Time
  • Schedule section is not rendered in Custom Cron

Steps to Reproduce (Before Fix)

  1. Navigate to - /object/workflow/xxxx
  2. Try adding a new Trigger
  3. Set Trigger Interval to Cron (Custom)

Before

Screenshot 2025-11-13 at 4 00 29 PM

After

Screenshot 2025-11-13 at 4 00 55 PM

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 13, 2025

Greptile Overview

Greptile Summary

This PR improves the custom CRON trigger UI by replacing the generic Select component with the more feature-rich FormSelectFieldInput component and adding conditional rendering for schedule sections.

Key Changes:

  • Added hint prop to FormSelectFieldInput to display contextual help text
  • Refactored WorkflowEditTriggerCronForm to use FormSelectFieldInput with hint for UTC timezone notification
  • Added conditional rendering props (isScheduleVisible, isUpcomingExecutionVisible) to CronExpressionHelper components
  • Updated styling of cron expression helper sections with bordered containers and improved spacing
  • Custom CRON now shows only "Upcoming Execution Time" section (Schedule section hidden)

Issues Found:

  • Code duplication: convertScheduleToCronExpression and getTriggerScheduleDescription functions are duplicated in both WorkflowEditTriggerCronForm.tsx and CronExpressionHelper.tsx
  • Missing i18n: Hardcoded hint string "Cron will be triggered at UTC time" on line 140 should use translation macro

Confidence Score: 4/5

  • This PR is safe to merge with minor issues that should be addressed
  • The changes successfully improve the UI as intended. The refactoring from Select to FormSelectFieldInput is well-executed and the conditional rendering logic is sound. However, there are two non-critical issues: code duplication of helper functions and a missing translation wrapper for a hint string. These are style/maintenance concerns rather than functional bugs.
  • Pay attention to WorkflowEditTriggerCronForm.tsx which contains code duplication and a hardcoded string that should be internationalized

Important Files Changed

File Analysis

Filename Score Overview
packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSelectFieldInput.tsx 5/5 Added optional hint prop support to display hint text below the select input - clean and straightforward change
packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm.tsx 3/5 Refactored to use FormSelectFieldInput instead of Select, added helper functions for cron description, but contains code duplication and missing i18n for hint text

Sequence Diagram

sequenceDiagram
    participant User
    participant WorkflowEditTriggerCronForm
    participant FormSelectFieldInput
    participant CronExpressionHelperLazy
    participant CronExpressionHelper

    User->>WorkflowEditTriggerCronForm: Select "Cron (Custom)" interval
    WorkflowEditTriggerCronForm->>FormSelectFieldInput: Render with hint prop
    FormSelectFieldInput->>FormSelectFieldInput: Display select dropdown
    FormSelectFieldInput->>FormSelectFieldInput: Render hint below select
    FormSelectFieldInput-->>WorkflowEditTriggerCronForm: User selects "CUSTOM"
    
    WorkflowEditTriggerCronForm->>WorkflowEditTriggerCronForm: Call getTriggerScheduleDescription()
    WorkflowEditTriggerCronForm->>WorkflowEditTriggerCronForm: Call convertScheduleToCronExpression()
    WorkflowEditTriggerCronForm->>WorkflowEditTriggerCronForm: Update trigger settings
    
    WorkflowEditTriggerCronForm->>CronExpressionHelperLazy: Render with isScheduleVisible=false
    CronExpressionHelperLazy->>CronExpressionHelper: Pass props (trigger, isScheduleVisible, isUpcomingExecutionVisible)
    CronExpressionHelper->>CronExpressionHelper: Call convertScheduleToCronExpression()
    CronExpressionHelper->>CronExpressionHelper: Call getTriggerScheduleDescription()
    
    alt isScheduleVisible is true
        CronExpressionHelper->>User: Display Schedule section
    end
    
    alt isUpcomingExecutionVisible is true
        CronExpressionHelper->>User: Display Upcoming Execution Time section
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@github-actions
Copy link
Contributor

github-actions bot commented Nov 13, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:9977

This environment will automatically shut down when the PR is closed or after 5 hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CRON trigger design improvements

2 participants