feat: simpler schedule picker#53
Merged
Merged
Conversation
Replaces raw cron exposure in the schedule editor with a structured "Every N [hours|days|weeks] starting on [date] at [time]" composer that supports multiple rules per task (plus-button to add). - DB: nullable scheduled_tasks.schedule_rules JSONB (idempotent ALTER). Legacy cron_expr/cron_expression columns stay populated from rule[0] for back-compat with the croner engine. - API: POST/PATCH /api/scheduled-tasks accepts EITHER cron_expr (legacy) OR schedule_rules. Server derives + stores both. next_3_runs preview merges fires across all rules. - Scheduler registry: arms one Cron registration per rule; all fires route to dispatcher.fire(taskId). 5s cross-rule dedupe guard prevents overlapping rules from double-firing. Per-rule start_at gate skips pre-start fires; weekly interval>1 enforced in-process. - Web: new ScheduleRulesBuilder + ScheduleRuleRow components, native date/time inputs, mobile-stacked layout, indigo accent. Editor hydrates from schedule_rules when present, else seeds a default rule. Tests: 19 new unit tests for schedule-rules.ts. Existing 265 hub tests remain green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d2a34b1 to
fcf6aea
Compare
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
Replaces the raw 5-field cron exposure in the schedule editor with a structured "Every N [hours|days|weeks] starting on [date] at [time]" composer with a plus-button for multiple rules per task. Task fires on ANY rule.
scheduled_tasks.schedule_rules JSONB(idempotent ALTER). Legacycron_exprcolumn stays populated from rule[0] for back-compat with croner.POST/PATCH /api/scheduled-tasksaccepts EITHERcron_expr(legacy) ORschedule_rules(new). Server derives + stores both.next_3_runspreview merges across all rules.Cronregistration per rule, all routing todispatcher.fire(taskId). 5s cross-rule dedupe guard prevents overlapping-rule double-fires. Per-rulestart_atgate skips pre-start fires; weekly interval > 1 enforced in-process.ScheduleRulesBuilder+ScheduleRuleRowcomponents — native date/time inputs, mobile-stacked layout, indigo accent, subtle rounded-lg, no heavy borders. Editor hydrates fromschedule_ruleswhen present, else seeds a default rule.19 new unit tests for
schedule-rules.ts. Existing 265 hub tests remain green. Web build clean.Test plan
🤖 Generated with Claude Code