Skip to content

fix(dashboard): handle hidden pop-out transition readiness - #24470

Merged
nwparker merged 4 commits into
stablyai:mainfrom
innocarpe:fix-21323-dashboard-hidden-transition
Oct 24, 2026
Merged

nwparker merged 4 commits into
stablyai:mainfrom
innocarpe:fix-21323-dashboard-hidden-transition

Conversation

@innocarpe

@innocarpe innocarpe commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Dashboard snapshots received while the pop-out document is hidden could start a View Transition whose ready promise rejects with InvalidStateError, leaving an unhandled rejection even though the snapshot callback and finished complete.

Skip transitions while hidden and still apply each snapshot. If the document becomes hidden after a transition starts, consume its hidden DOMException/InvalidStateError rejection; 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:

  • 19 hook/neighbor tests pass; a temporary deferred-callback ordering control plus those suites passes 20 tests. Renderer typecheck, changed-code quality, formatting and diff checks pass.
  • Actual hidden mounted Orca pop-out, reached through the production dashboard IPC route: four status changes update the folder-workspace card correctly. Exact-main control produces four native transition rejections; this head produces zero.
  • Separate off-screen rendered screenshot confirms the card and columns. That paint-enabled document reports visible; the screenshot is not claimed as hidden-document pixel proof. All native windows remained unshown and unfocused.

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 eb9a68dc282b has terminal CI SUCCESS: 14 passed, 19 skipped, no failed or pending checks; all four workflows passed, including Windows packaging and packaged smoke checks.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Adds handling for hidden window state in dashboard view transitions.

The PR appears safe to merge, though unrelated transition failures will become harder to diagnose.

Findings

  1. P2 Other transition errors go unnoticed ▶

Summary

The PR skips dashboard card transitions when the pop-out document is hidden while continuing to apply snapshots, and consumes transition ready rejections that occur after a transition starts.

  • Adds tests for hidden-document updates and rejected ready promises.
  • The unrestricted rejection handler also removes diagnostics for unrelated transition failures.

Reviews (1) · Last reviewed commit: "fix(dashboard): skip hidden pop-out view..."

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 ready rejection — startViewTransition(cb).ready.catch(() => {}) handles the window being occluded after the transition starts, which the guard cannot cover. updateCallbackDone / finished are deliberately left alone so a real render error inside flushSync is still surfaced.
  • Tests — one test per half of the fix: the hidden case asserts startViewTransition is not called and the update still applies; the occlusion case collects unhandledRejection events 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.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 607f5a44-19a9-4ab2-ab6a-f70a7b98ae04
📥 Commits

Reviewing files that changed from the base of the PR and between 106f4da98886a6a33fbc56e8c5f2934fb0c96fa1 and f9d3f32ff58186789c20c85f5d1e8085dd4d3c27.

📒 Files selected for processing (2)
  • src/renderer/src/components/dashboard-popout/useDashboardSnapshot.test.tsx
  • src/renderer/src/components/dashboard-popout/useDashboardSnapshot.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

useDashboardSnapshot now skips view transitions when the document is hidden and applies the snapshot directly. For started transitions, it consumes rejection of the ready promise only when the document is hidden and the error is an InvalidStateError. Tests verify hidden-document behavior, rejection handling, and that card updates still apply.

Priority: ⬇️ Low

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to f9d3f

No actionable merge-blocking issue is established. The focused tests passed, though the full checks and live Electron behavior remain unverified.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description is thorough and mostly follows the repository template. It gives an ELI5-style summary of the problem and fix, explains the mechanism (skip transitions while hidden, consume only hidde… 1) In 'Linked Issue', replace the reference with a closing keyword and the real issue number (for example 'Fixes #21323'), since the template requires an actual linked issue for outside contributors. 2) In 'Visual Proof', add a before/after…
Passed Passed checks: 3 passed
Check name Status Explanation
Linked Issues check Passed Issue #21323 requires hidden-document updates to apply without starting a transition, and a late hidden-document InvalidStateError from ready must not become unhandled. useDashboardSnapshot.ts i…
Out of Scope Changes check Passed The diff changes only useDashboardSnapshot.ts and its test file. The implementation and tests support issue #21323. The change leaves updateCallbackDone and finished handling, the pane focus/inp…
Title check Passed The title clearly and concisely describes the main change: handling View Transition readiness when the dashboard pop-out is hidden.
Full details: Linked Issues check

Explanation

Issue #21323 requires hidden-document updates to apply without starting a transition, and a late hidden-document InvalidStateError from ready must not become unhandled. useDashboardSnapshot.ts implements both behaviors. It consumes only ready rejections that meet the hidden-document and DOMException name checks; other rejections remain visible. The tests cover hidden updates, mid-transition hiding, and a visible-document rejection.

Full details: Out of Scope Changes check

Explanation

The diff changes only useDashboardSnapshot.ts and its test file. The implementation and tests support issue #21323. The change leaves updateCallbackDone and finished handling, the pane focus/input issue, and the WebGL atlas-reset path unchanged.

Full details: Description check

Explanation

The description is thorough and mostly follows the repository template. It gives an ELI5-style summary of the problem and fix, explains the mechanism (skip transitions while hidden, consume only hidden InvalidStateError ready rejections, keep visible and unrelated failures), and links the scope to issue #21323. It lists validation evidence, including tests, a live hidden pop-out check, CI status, and native-platform limits. Gaps: the 'Linked Issue' section uses 'Refs' style text and does not show a 'Fixes #' line with an issue number, so the required actual linked issue is not clearly attached in the template format. The 'Visual Proof' section has no before/after media or an N/A statement, although the template requires it for behavior changes. The 'Testing' checkboxes are not ticked, the AI Disclosure section is not addressed, and the 'Why' section does not explain why the chosen approach beats the alternatives. The description does mention a rationale ('Scheduling, subscriptions, callback ordering and snapshot application stay on the existing path'), but it is not framed as a comparison with alternatives.

Resolution

  1. In 'Linked Issue', replace the reference with a closing keyword and the real issue number (for example 'Fixes #21323'), since the template requires an actual linked issue for outside contributors. 2) In 'Visual Proof', add a before/after comparison of the pop-out card behavior, or write N/A with a reason that the change is not visible during normal rendering. The author's off-screen screenshot does not show the hidden state, so a before/after video or screenshot of the hidden transition case would be better. 3) Add a 'Why' explanation that compares this approach with alternatives, such as catching all ready rejections or suppressing the transition only at the caller. 4) Tick the 'Testing' checkboxes that apply, or state which platforms were tested locally (the description names macOS for native evidence only). 5) Fill in the 'AI Disclosure' section if an AI model was used, or confirm the author is a StablyAI team member. 6) Complete the 'Review' and 'Agent skill upstream boundary' sections, and confirm the checklist items.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@innocarpe
innocarpe force-pushed the fix-21323-dashboard-hidden-transition branch from 106f4da to f9d3f32 Compare October 4, 2026 17:07

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Narrowed the ready rejection 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 same renderer_unhandled_rejection diagnostic channel the issue traces.
  • Added a visible-failure regression test — the new case asserts a ready InvalidStateError on a visible document propagates, while the existing occlusion case asserts the hidden-mid-transition abort is consumed.
  • Test scaffolding generalized — the startViewTransition mock now takes a readyRejection value plus a hideDocumentAfterTransitionStart toggle, and returns a DOMException-shaped rejection instead of a bare Error.

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.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@innocarpe
innocarpe force-pushed the fix-21323-dashboard-hidden-transition branch 3 times, most recently from 2fea082 to 3512570 Compare October 22, 2026 00:04
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
@innocarpe
innocarpe force-pushed the fix-21323-dashboard-hidden-transition branch from 3512570 to 038e6bd Compare October 22, 2026 00:26
@nwparker nwparker changed the title fix(dashboard): skip hidden pop-out view transitions fix(dashboard): handle hidden pop-out transition readiness Oct 23, 2026
@nwparker
nwparker merged commit 770e39f into stablyai:main Oct 24, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants