Skip to content

Client-side cron validation + warning icon for invalid schedules #925

Closed

Description

@vybe

Summary

Add client-side cron expression validation to the schedule create/edit form, and surface a warning icon next to schedules in the list whose stored cron_expression no longer parses. Today the backend rejects invalid cron via croniter (src/backend/routers/schedules.py:232, :287), but the frontend has no preflight check and no visible signal on the schedule list when something is wrong — users only find out by submitting the form or watching schedules silently fail to fire.

Context

The schedule form in src/frontend/src/components/SchedulesPanel.vue exposes a raw cron text field with preset buttons but no validation feedback. A malformed expression round-trips to the backend, surfaces as a 400, and the user has to interpret the error message. Worse, if a previously-valid cron becomes invalid (e.g., manual DB edit, schema change, or a parser-behavior shift), the row in the schedule list looks identical to a healthy one.

Acceptance Criteria

  • Schedule form validates cron_expression on input/blur using a JS cron parser (e.g., cron-parser or cronstrue + a parse attempt), with inline error text matching the backend message style
  • Submit button is disabled while the expression is invalid
  • Each row in the schedules list shows a warning icon (with tooltip "Invalid cron expression") when cron_expression fails to parse client-side
  • Backend response for invalid cron is preserved unchanged (no contract change)
  • Presets remain valid and do not trigger the warning state

Technical Notes

  • Frontend: src/frontend/src/components/SchedulesPanel.vue — add validation inside formData watcher and per-row computed flag for the list rendering near line 282
  • Backend: validation already in place at src/backend/routers/schedules.py:232,287 via croniter — no changes required
  • Library choice: align client parser with croniter syntax (5-field, no seconds) to avoid client-server disagreement on edge cases (e.g., */30 * * * *)
  • Out of scope: server-side migration of existing invalid rows; warning icon is purely a UI affordance

Activity

  1. added
    priority-p2
    type-feature
    on May 24, 2026
  2. added
    complexity-low
    status-incubating
    on Jun 12, 2026
  3. added
    status-ready
    and removed
    status-incubating
    on Jul 3, 2026
  4. added
    status-in-progress
    and removed
    status-ready
    on Aug 13, 2026
  5. added
    status-in-dev
    and removed
    status-in-progress
    on Aug 16, 2026
  6. removed
    status-in-dev
    on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

complexity-lowpriority-p2theme-ui-uxtype-feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions