feat(cron): Redesign Cron Jobs page with card UI, inline editing, and run history#313
Conversation
- Fix cron data flow: handle {jobs:[...]} response shape, nested state fields
- Add missing gateway API methods: AddCronJob, UpdateCronJob, RequestCronRuns
- Add auto-refresh on cron events and cron.add/update/remove/run responses
- Redesign cron cards with click-to-expand pattern matching agent events UI
- Add schedule formatting for cron/every/at types with human-readable output
- Add compact summary line with relative times (ran Xm ago, next in Xh)
- Add job actions: Run Now, Enable/Disable toggle, Remove
- Add inline badges for schedule, enabled status, and run result
- Add chips with labels for session target, wake mode, and delivery
- Cache cron data in HubWindow for page navigation persistence
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ting - FormatCronSchedule now shows readable text (e.g. 'daily at 9am') instead of raw cron expressions for common patterns - Checkbox text vertically centered with explicit TextBlock content - Font size bumped to 14 to match other form elements - Selected preset gets bold text in addition to accent style Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Edit form now appears inline, replacing the job card in-place - Replaced ListView with manually-managed StackPanel for full control - Fixed timezone bug: 'at' schedule now correctly converts UTC to local - Replaced scroll-wheel DatePicker/TimePicker with CalendarDatePicker + TextBox - Added validation: 'at' schedule rejects past dates with error message - Guard against card rebuild while editing inline Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add inline per-job run history with status badges, summaries, durations
- Fix RunCronJobAsync to send correct API params ({id} not {jobId})
- Add persistent card expand state across data refreshes
- Add Running badge on card header (detects via runningAtMs and scheduled time inference)
- Suppress overdue label when job is actively running
- Add InfoBar notification for completed one-shot (delete-after-run) jobs
- Fix InfoBar layout overlap (own Grid row)
- Fix timer race conditions (Run Now and InfoBar dismiss)
- Default scheduled time to 5 minutes from now
- Wire CronRunsUpdated event through App -> HubWindow -> CronPage
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…lean up unused param - Remove redundant DeleteAfterRun checkbox from Advanced section (was unsynced with At schedule checkbox) - Dispose CancellationTokenSource before replacing in InfoBar auto-dismiss - Remove unused force parameter from RunCronJobAsync Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolved conflicts from upstream connection manager refactor: - Removed old direct _gatewayClient subscribe/unsubscribe blocks - Kept upstream's _connectionManager pattern - Added CronRunsUpdated event to OnOperatorClientChanged subscribe/unsubscribe Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Thanks for the Cron Jobs redesign — the card UI, inline editing direction, local-time handling, and run history UX are all useful improvements. CI is green, and I confirmed the interface was updated, so there is no compile blocker. I do think a few correctness/security items should be addressed before merge. 1. Advanced form fields are shown but not savedThe form exposes controls such as Examples from the PR:
Impact: users can toggle these settings and click save, but their choices are silently discarded. That is worse than not showing the controls because it looks like the setting was accepted. Suggested fix:
2. Run history renders raw gateway
|
Blockers: - Remove unsupported FormOnFailure/FormClearContext controls (gateway doesn't support these fields) - Add SanitizeForDisplay() for defense-in-depth error string sanitization (paths, tokens) - Centralize cron API wire format: UpdateCronJobAsync(id, patch), consistent 'id' param naming Non-blocking: - Fix Run Now stuck state: add failure handling + 90s safety timeout - Switch card click from PointerReleased to Tapped to prevent scroll-triggered toggles - Remove redundant list refresh in OnRemoveClick (HandleKnownResponse already refreshes) Other: - Disabled job buttons use opacity dimming with click guards (WinUI disabled buttons leak pointer events) - Add 12 unit tests: 6 payload shape tests + 6 display sanitization tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🤖 This is an automated response from Repo Assist. Complementing 1.
|
Summary
Complete redesign of the Cron Jobs management page in the companion app, replacing the basic list view with an interactive card-based UI that supports inline editing, per-job run history, and real-time status indicators.
Demo
Video walkthrough
Changes
Card-based UI redesign
Inline job editing
Job creation
Per-job run history
cron.runsgateway RPCReal-time status
runningAtMsfield AND infers from scheduled time passingOne-shot job feedback
deleteAfterRunjob completes and is removed from the listBug fixes
RunCronJobAsyncsending wrong API params ({id}not{jobId})Files changed
src/OpenClaw.Tray.WinUI/Pages/CronPage.xaml— Page layout with InfoBar, job list, empty statesrc/OpenClaw.Tray.WinUI/Pages/CronPage.xaml.cs— All card building, editing, history, state managementsrc/OpenClaw.Shared/OpenClawGatewayClient.cs— FixedRunCronJobAsyncparamssrc/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs— Event routing forCronRunsUpdatedsrc/OpenClaw.Tray.WinUI/App.xaml.cs— Event subscription forCronRunsUpdatedTesting
Demo