Skip to content

Automations: schedule "every N hours" (and daily/weekly at a time) without writing cron #3662

Closed

Description

@integry

The automation editor's Schedule row (propr-ui/src/components/Agents/AgentScheduleSection.tsx) offers Off or Cron, a free-text cron field and a few preset chips (SCHEDULE_PRESETS in agentPresentation.ts). Someone who wants "every 3 hours" or "every 2 days at 08:00" has to know cron syntax. The segmented control itself is labelled "Cron", which already assumes that knowledge.

Expected

  • The schedule row keeps two choices: Off and Repeat. The segment that reads "Cron" today is renamed "Repeat"; the word "cron" no longer appears in the control, the row hint or the list. (Owner decision: a cron schedule is a repeat, so they are not separate modes.)
  • Repeat is built from plain controls, no syntax: Every [N] [minutes | hours | days | weeks], plus at [HH:MM] for days and weeks, and weekday checkboxes for weeks. Offer only intervals a 5-field cron expression can express exactly (for example minutes and hours that divide evenly: every 5/10/15/20/30 minutes; every 1/2/3/4/6/8/12 hours; every day; chosen weekdays). Do not offer an interval that would silently run on a different rhythm.
  • For schedules the controls cannot express, Repeat has a small secondary link under the controls, "Use a cron expression", which swaps the controls for the existing expression field (with "Use simple schedule" to go back). It is an advanced input inside Repeat, not a third segment.
  • The stored value stays the same cron expression the API accepts today (validateAutomationSchedule in @propr/shared); no API, storage or scheduler change. Keep the minimum interval and every other rule the validator enforces, and show its message inline when a choice is refused.
  • Opening an existing automation shows Repeat either way: an expression the controls can produce opens with the controls filled in; anything else opens with the expression field shown and the value unchanged. Switching to the expression field shows the generated expression; going back from an expression the controls cannot represent keeps it until the user changes a control.
  • Times stay UTC as today; say "UTC" next to the time field. Keep the live "Next run" preview in every mode.
  • One short hint line under the row, not a paragraph. The preset chips may remain as shortcuts beside the expression field.
  • The list and detail views describe a schedule in the same words the Repeat controls use ("Every 3 hours", "Every weekday at 09:00 UTC") when the expression is representable; reuse the existing describer if there is one and extend it rather than adding a second.

Acceptance

  • Unit tests for a pure mapping in both directions: Repeat settings → cron, and cron → Repeat settings or "needs the expression field"; round-trips for every offered interval; unrepresentable expressions keep the expression field and are never rewritten.
  • Component tests: creating "every 3 hours" saves 0 */3 * * * (or the equivalent the mapping defines) without typing; an existing 0 9 * * 1-5 opens as weekly on Monday–Friday at 09:00; a hand-written expression opens with the expression field and saves unchanged; the segmented control reads Off and Repeat, and no visible text says "Cron" outside the "Use a cron expression" link and its field label.
  • Checked in a browser at 1440 px and 390 px: controls fit on one or two rows, no horizontal scroll, keyboard reachable, each control has a label.

Implementation

Add a pure helper next to agentPresentation.ts (repeat settings <-> cron), then rework AgentScheduleSection.tsx around it. Keep onChange({ scheduleEnabled, schedule }) as the section's contract so the editor and API calls do not change. Update the automation template flow only if it renders this section with different props.

Activity

  1. propr-dev commented on Nov 17, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 3662/claude-opus-5-5-automations-schedule-ever-20261117-0951-0yy
    • Base Branch: 3602-epic-0-9-o23
    • Worktree: issue-3662-20261117-0951-claude-opus-5-5-0yy

    🔍 Track Task Execution

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions