Repository navigation
fix(dashboard): handle hidden pop-out transition readiness - #24470
Conversation
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Skip the transition while hidden —
documentIsHidden()joins the existing reduced-motion / open-dialog skip list; a hidden pop-out still receives the new snapshot, only the morph is skipped. - Consume the
readyrejection —startViewTransition(cb).ready.catch(() => {})handles the window being occluded after the transition starts, which the guard cannot cover.updateCallbackDone/finishedare deliberately left alone so a real render error insideflushSyncis still surfaced. - Tests — one test per half of the fix: the hidden case asserts
startViewTransitionis not called and the update still applies; the occlusion case collectsunhandledRejectionevents and asserts none escape. I confirmed both fail with their respective half reverted, and ran the file locally: 11 passed.
The change matches the fix proposed in #21323 and useDashboardSnapshot is the only startViewTransition call site in the repo. No behavioral change for a visible pop-out.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to
|
106f4da to
f9d3f32
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Narrowed the
readyrejection handler —startViewTransition(cb).ready.catch(...)now swallows only the occlusion case (documentIsHidden() && error instanceof DOMException && error.name === 'InvalidStateError') and rethrows everything else, so genuine failures (e.g. duplicate transition names while visible) still surface. This directly addresses the greptile P2 thread; the rethrow lands on the discarded promise, which is the samerenderer_unhandled_rejectiondiagnostic channel the issue traces. - Added a visible-failure regression test — the new case asserts a
readyInvalidStateErroron a visible document propagates, while the existing occlusion case asserts the hidden-mid-transition abort is consumed. - Test scaffolding generalized — the
startViewTransitionmock now takes areadyRejectionvalue plus ahideDocumentAfterTransitionStarttoggle, and returns aDOMException-shaped rejection instead of a bareError.
The primary guard from the prior commit is unchanged and remains covered. Focused file re-run this run: 12 passed. No behavioral change for a visible pop-out.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
2fea082 to
3512570
Compare
A column change in a hidden Agent Dashboard pop-out started a View Transition whose ready promise rejects with InvalidStateError. Nothing observed that promise, so each move became an unhandled rejection. Skip the transition while the document is hidden, and consume ready when a transition still starts. Fixes stablyai#21323
3512570 to
038e6bd
Compare

Dashboard snapshots received while the pop-out document is hidden could start a View Transition whose
readypromise rejects withInvalidStateError, leaving an unhandled rejection even though the snapshot callback andfinishedcomplete.Skip transitions while hidden and still apply each snapshot. If the document becomes hidden after a transition starts, consume its hidden
DOMException/InvalidStateErrorrejection; preserve diagnostics for visible or unrelated failures. Scheduling, subscriptions, callback ordering and snapshot application stay on the existing path.Preserves @innocarpe's two original commits and implementation, refreshed against current main. Scope is the hidden-ready rejection in #21323. Broader React185, ghost-tab, memory and terminal-input reports in #21345/#21358 remain separate.
Validation:
The actual after-start native visible-to-hidden race remains deferred to CI or an isolated display; deterministic tests cover its promise handling. macOS Chromium supplies the native hidden rejection evidence; no native Windows acceptance is claimed. Published head
eb9a68dc282bhas terminal CI SUCCESS: 14 passed, 19 skipped, no failed or pending checks; all four workflows passed, including Windows packaging and packaged smoke checks.