Stop observing chat layout while the pet is disabled - #332346
Stop observing chat layout while the pet is disabled#332346Bryan Chen (bryanchen-d) wants to merge 5 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aacd276e-cf84-48bd-a2ab-6f6a4d4c3431
There was a problem hiding this comment.
Pull request overview
Stops disabled or inactive chat pets from observing layout bounds, preventing ResizeObserver loop warnings.
Changes:
- Gates layout observations on pet visibility and enablement.
- Adds unit coverage for observation lifecycle.
- Adds a Playwright regression fixture and test.
Show a summary per file
| File | Description |
|---|---|
chatPetWidget.ts |
Manages observations with a MutableDisposable. |
chatPetWidget.test.ts |
Tests enable/disable observation behavior. |
chatWidget.fixture.ts |
Adds the disabled-pet regression fixture. |
chatPetResizeObserver.spec.ts |
Verifies no loop warnings occur. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Balanced
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aacd276e-cf84-48bd-a2ab-6f6a4d4c3431
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aacd276e-cf84-48bd-a2ab-6f6a4d4c3431
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aacd276e-cf84-48bd-a2ab-6f6a4d4c3431
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aacd276e-cf84-48bd-a2ab-6f6a4d4c3431
|
Additional stable 1.134 impact signal: the broad Using matched complete rollout windows (1.133 Aug 13–14 vs. 1.134 Aug 20–21):
Post-merge, I plan to compare commit-bounded Insiders telemetry for both the Sessions family and terminal-confirmation contexts. If the terminal residual remains, the next proof is a multi-confirmation carousel fixture with one-variable observer disconnect/no-op differentials.
|
Summary
Stops
ChatPetWidgetfrom observing chat layout while the pet is disabled or not visible in the active window.Root cause
Stable 1.134 telemetry showed a concentrated Sessions-window runaway:
ChatPetWidgetstill observeddragBounds,movementBounds, andparentwhile disabled. Its callback returned immediately, but the no-op nested observer could still become a skipped target when a deeper observer resized one of those ancestors.The regression fixture uses the real disabled ChatPet and reproduces the observer-depth topology:
Fix
ResizeObserverinstance.No frame deferral or enabled-pet behavior change is introduced.
Validation
compile-clientChatPetWidgetunit testsPart of #316501.