feat(workflows): add explainable cron schedule widget with Simple/Advanced builder#209
Open
tstapler wants to merge 2 commits into
Open
feat(workflows): add explainable cron schedule widget with Simple/Advanced builder#209tstapler wants to merge 2 commits into
tstapler wants to merge 2 commits into
Conversation
…anced builder Replaces the bare cron text input in the Workflow form with CronScheduleInput: a live human-readable explanation (correct OR semantics for day-of-month/ day-of-week), a Simple builder for daily/weekly/weekdays/monthly schedules, inline client-side validation pinned to the backend's exact 5-field robfig/cron/v3 grammar, and a server-local timezone label. Advanced mode keeps the raw-cron power-user workflow unchanged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YH4Wu7Ue5LAuPMJBcefvhC
Contributor
✅ Registry ValidationTest Coverage: 18/179 features have
|
Contributor
UX Analysis
|
Contributor
Go Benchmarks (Tier 1) |
Contributor
🎬 E2E Feature Demos2 shard(s) recorded feature flows for this PR. recordings shard 1 Demo preview opens directly in browser (single-file HTML). Raw WebM recordings in ZIP. Expires after 30 days. |
Contributor
E2E RPC Latency |
Contributor
📊 Feature E2E CoverageFeature E2E coverage: 6/179 tested (3%)
|
Contributor
Frontend Terminal Throughput |
…from code review
- validateCron/explainCron now accept `?` as a synonym for `*` (verified against
the vendored robfig/cron/v3 source: getRange treats it unconditionally as a
wildcard, not gated behind Quartz/Descriptor options) instead of incorrectly
rejecting valid backend syntax.
- Range validation now rejects start > end (e.g. "17-9"), matching the backend
parser's actual rejection of reversed ranges.
- Fixed a duplicated-word bug ("every every 15") in step-only explanations.
- Fixed an accessibility regression where CronScheduleInput's `id` prop was only
applied to the Advanced-mode input, leaving the Cron Expression label
unassociated with any control while in Simple mode (the default for new
workflows) — the widget now exposes an accessible group name via
aria-labelledby in both modes.
- Added a golden fixture test pinning the hand-written grammar against
documented real robfig/cron/v3 behavior, a WorkflowForm submit-blocking unit
test, and an Advanced->Simple success-path test — closing gaps a 4-agent code
review found before merge.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YH4Wu7Ue5LAuPMJBcefvhC
Contributor
✅ Registry ValidationTest Coverage: 18/179 features have
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backlog item: "Cron expression widget needs better explanation" — the Workflow form's cron field was a bare text
<input>with no explanation, no non-expert entry mode, and no client-side validation, forcing users to know cron syntax and round-trip to the backend to find out if their expression was even valid.What Changed
web-app/src/lib/cron/explainCron.ts: pure functionsvalidateCron,explainCron,buildCronFromSimple,parseCronToSimple. Validation grammar is pinned to the exact backend parser config (server/workflows/scheduler.go:cron.Minute|Hour|Dom|Month|Dow, noDescriptorbit) —@daily/@everymacros are rejected client-side too, matching real (not assumed) backend behavior confirmed by reading therobfig/cron/v3source.CronScheduleInputcomponent: live human-readable explanation (aria-live="polite", correct OR semantics when both day-of-month and day-of-week are restricted), a Simple builder (daily/weekly/weekdays/monthly + time) for non-cron-literate users, and an Advanced raw-text mode for power users (unchanged behavior).WorkflowForm.tsxnow blocks submission client-side when the cron field is enabled but invalid.docs/registry/features/frontend/workflow-cron-schedule-input.json.tests/e2e/workflow-cron-schedule.spec.ts(raw-cron power-user flow, invalid-cron submit blocking, Simple-mode build flow, and an Axe Core WCAG AA check).Explicitly out of scope: plain-English-to-cron NL parsing (tracked separately per the backlog item).
Test plan
cd web-app && npx jest --no-coverage --testPathPatterns="explainCron|CronScheduleInput"— 31/31 passednpx tsc --noEmit -p web-app— no errorscd web-app && pnpm run lint— zero warnings/errors on any touched file (one pre-existing, unrelatedError:elsewhere in the repo)make web-build && go build -o stapler-squad ., ran against a real isolated instance:cd tests/e2e && npx playwright test workflow-cron-schedule.spec.ts— 4/4 passed onchromium, 3/3 onchromium-domSessionDetail.embedded.test.tsx/BacklogEmptyState.test.tsx)make registry-aggregate— new feature entry present indocs/registry/frontend-features.json🤖 Generated with Claude Code
https://claude.ai/code/session_01YH4Wu7Ue5LAuPMJBcefvhC