Repository navigation
fix(ui): stop automation refreshes in hidden tabs - #140097
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 8:54 AM ET / 12:54 UTC. ClawSweeper reviewWhat this changesThe Automations page pauses scheduler, task-list, and run-history refreshes in hidden tabs and catches up on return while preserving drafts and submitted operations. Merge readiness✅ Ready for maintainer review Keep open: the fix remains useful against pinned main, and no actionable introduced defect was found. The prior review had no findings, and this maintainer-authored PR is protected from cleanup closure. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI’s Automations page reads scheduler status, jobs, and run history from the Gateway. Page visibility now controls refresh admission, including queued reads, while submitted mutations retain their existing execution flow. flowchart TD
A[Gateway events and initial load] --> C[Page refresh admission]
B[Browser visibility changes] --> C
C -->|Hidden| D[Skip background reads]
C -->|Visible| E[Coalesced Gateway reads]
E --> F[Status jobs and run history]
G[Submitted saves and runs] --> H[Existing mutation flow]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +18, Tests +331, Docs +1. Total +350 across 6 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep visibility admission at the page boundary and reuse the existing coalesced loaders without resetting drafts or interrupting submitted operations. Do we have a high-confidence way to reproduce the issue? Yes, from source: a connected Automations page on pinned main dispatches cron-event refreshes and queued continuations without checking visibility; runtime reproduction was not executed. Is this the best way to solve the issue? Yes. The patch reuses the existing activation and coalescing mechanisms and gates read dispatch at its owner without adding another refresh system. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 897013c73351. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* fix(ui): pause automation refreshes in hidden tabs * test(ui): tighten hidden cron refresh lifecycle coverage * test(ui): fix hidden refresh test lint
What Problem This Solves
Fixes an issue where users leaving the Automations page open in a background tab would continue generating scheduler-status, automation-list, and run-history requests. Refreshes queued before hiding the tab could also dispatch later.
Why This Change Was Made
The page now decides whether all three refresh loaders may dispatch, including their queued continuations. Returning to the tab requests one coalesced catch-up through the existing refresh flow. Accepted saves, runs, and configuration-conflict recovery keep their existing behavior.
User Impact
Hidden Automations tabs avoid unnecessary Gateway work. Returning to the tab refreshes the current selection while preserving filters and unsaved drafts. There are no new settings, dependencies, database changes, or protocol changes.
Evidence
948e937c5392: targeted lint and 274 focused tests across five files passed, covering queue completion, hidden mount/reconnect, Gateway replacement, retained filters/drafts, accepted create-and-run, conflict recovery, and existing lifecycle behavior.check:changedpassed on the same head, including all 16 core-test type graphs, UI types, i18n, coercion/dead-export guards, and changed-file lint/styles. Independent P2 review and the current ClawSweeper review have no actionable findings.The first browser attempt lacked Playwright's matching video encoder; installing its pinned FFmpeg asset made the complete browser file pass. CI also caught four test-only lint findings, which were fixed without changing production behavior.
The captures below show the same synthetic page while hidden and after catch-up. This change affects request scheduling, so its visible layout stays unchanged.