fix(app): show next run time for pending one-shot automations - #1178
Conversation
The detail page only surfaced a "Next run" row for recurring automations. One-shot definitions carry a `fireAt` timestamp that serves the same purpose before the task fires, but it was never displayed. Use `fireAt` when the one-shot has no runs yet and is not paused.
|
Warning Review limit reached
More reviews will be available in 39 minutes and 19 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR makes AutomationDetail reload recent runs when the shown automation changes and updates nextRunLabel to show scheduled fire times for one-shot automations until they have a run on/after fireAt. It also adds E2E tests (and a local oneshot helper) that seed future one-shot automations and verify detail-view behavior, including manual-run interactions. ChangesOne-shot automation display support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Suggested priority: P2 (includes user-path files (packages/app/src/pages/automations/automation-detail.tsx)).
P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.
There was a problem hiding this comment.
Code Review
This pull request adds support for displaying the next run time of pending one-shot automations in the detail panel, along with a corresponding E2E test. Feedback suggests ensuring that the UI components and state dependencies are consistently derived from a single state signal to prevent state mismatches and layout flashes during asynchronous transitions.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
A one-shot's next run was hidden as soon as any run existed, but the scheduler only treats it as spent once a run lands at or after fireAt (hasRunTriggeredAtOrAfter). A manual Run now before fireAt produced a run at "now", wrongly hiding the still-pending next run while the backend would still fire at the original fireAt. Gate the one-shot next-run label on a run with triggeredAt >= fireAt, matching the scheduler. Add an e2e covering: a manual run before fireAt keeps the next run visible.
|
Follow-up fix in 3f46c16: a second-opinion review surfaced a correctness bug in the one-shot next-run logic (independent of the earlier flash thread). Problem: the label was gated on Fix: gate on |
The detail view loaded runs only in onMount, but a deep-link jump (the automate tool's 'open in Automations') swaps props.automation in place without remounting — the detail Show is non-keyed. After this PR the next-run label (and the existing last-run / recent-runs rows) derive from runs(), so switching to an already-fired one-shot via a deep-link left runs() empty and wrongly showed a spent fireAt that never self-corrected. Move loadRuns into a createEffect keyed on the shown automation so a direct A->B switch refetches. Covered by the existing 'second tool card jump' e2e plus the one-shot cases.
|
Second follow-up in 8821572: another independent review flagged a real correctness edge that the first fix exposed. Problem: the detail view loaded runs only in Fix: move Deferred (advisory): two suggested e2e additions not taken — (a) a spent one-shot hides next run case needs a run with |
The pending one-shot test only checked that a Next run row exists. Assert its value equals fireAt formatted in the automation's UTC timezone, using the same Intl call the component uses, so a wrong timezone or a broken formatter regresses the test instead of passing on a present-but-wrong row.
Summary
Show the "Next run" timestamp on the automation detail page for pending one-shot automations. Previously only recurring definitions surfaced this row; one-shots carried a
fireAtfield but the UI never displayed it.No related issue — spotted during UI polish.
Why
A user creating a one-shot automation sees when it repeats ("Once") and its status ("Active"), but has no indication of when it will fire. The data is already on the definition; the detail page just skipped it for the
oneshotkind.Related Issue
None — discovered during automation page polish.
Human Review Status
Pending
Review Focus
nextRunLabelmemo inautomation-detail.tsxnow branches onkind: for oneshot it usesfireAtand hides the row once any run exists (the task is spent). Verify this doesn't regress the recurring path.fireAtone day out, then asserts the "Next run" text is visible in the detail.Risk Notes
None.
How To Verify
Screenshots or Recordings
No visible layout change beyond the new row appearing; the row uses the existing
InfoRow/DetailGroupcomponents and the sameformatTimestampformatter already used by recurring automations.Checklist
bugapplied.appapplied.Pending,Approved by @<reviewer>, orNot required: <reason>(default isPending; "not required" is restricted to bot-authored low-risk PRs).dev, and my PR title and commit messages use Conventional Commits in English.Summary by CodeRabbit
Tests
Bug Fixes