Repository navigation
fix(terminal-pane): resolve React #185 setState loop via state identity - #10632
Merged
Merged
Conversation
Preserve object identity in pane-title overlay rect state to fix infinite
re-renders. A fresh {} literal creates a new reference on every call, causing
React to treat the state as changed even when logically equivalent, triggering
the layout effect to continuously re-measure and re-set state (React #185).
Add cold-park verdict flip telemetry to diagnose crash cluster C5: records
whether parking state churns in the field for next crash bundle analysis.
Document that AddressPicker crash (cluster C6) originates in radix-ui's
SelectItem unmount cleanup, not in our component code.
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughAdds per-tab terminal park-verdict flip telemetry with time-window handling, stale-record cleanup, and crash breadcrumb emission. Renderer breadcrumb coalescing now supports the new telemetry and broader keying rules. Pane-title overlay rectangle types and helpers move into a shared module, with state reset updates and unit tests for comparison and reference stability. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
1 of 5 tasks
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…e identity (stablyai#10632) Preserve object identity in pane-title overlay rect state to fix infinite re-renders. A fresh {} literal creates a new reference on every call, causing React to treat the state as changed even when logically equivalent, triggering the layout effect to continuously re-measure and re-set state (React stablyai#185). Add cold-park verdict flip telemetry to diagnose crash cluster C5: records whether parking state churns in the field for next crash bundle analysis. Document that AddressPicker crash (cluster C6) originates in radix-ui's SelectItem unmount cleanup, not in our component code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes React #185: a setState loop in TerminalPane's pane-title overlay measurement effect. The effect was calling
setPaneTitleOverlayRects({})with a fresh object literal on every pass, violating React's referential equality contract and forcing redundant renders.Root Cause
In TerminalPane, layout measurement effects needed to reset overlay rects when the manager or container unmounted. Calling
setPaneTitleOverlayRects({})creates a new object on every effect execution, so React sees it as a state change even when the previous state was also empty — triggering the effect again immediately, forming a loop.Solution
Extract state-identity helpers to
pane-title-overlay-rects.ts:clearPaneTitleOverlayRects(prev)returnsprevunchanged if already empty, or a new{}only if it was populated. This preserves referential equality when nothing changes.arePaneTitleOverlayRectsEqual(a, b)compares rect maps with sub-pixel tolerance, used when state does legitimately change.Call
clearPaneTitleOverlayRects()instead of{}in measurement effects, guaranteeing no spurious renders when clearing.Add telemetry to detect park-verdict churn (crash cluster C5):
recordParkVerdictFlipsobserves whether the rendered cold-park status actually oscillates, emitting one breadcrumb per 60s window if ≥12 flips occur. This is observation-only and changes no logic.Extend crash-reporting coalescing to handle per-tab, high-frequency breadcrumbs like
terminal_park_verdict_churnby coalescing on name alone (not message), so a many-tab storm doesn't evict the pre-crash trail.Testing
pane-title-overlay-rects.test.ts: identity contracts (empty-stable returns, sub-pixel tolerance, map-count diffs)terminal-park-verdict-flip-telemetry.test.ts: breadcrumb emission, window re-arming, backwards-clock handling, per-tab independencecrash-reporting-renderer-breadcrumbs.test.ts: coalescing by name for park-verdict churn across multiple tabsNotes