fix: observe existing simulator root for size updates#27
Merged
lihbr merged 1 commit intoMay 25, 2026
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
AlexGalays
approved these changes
May 25, 2026
lihbr
approved these changes
May 25, 2026
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.
Description
Fixes slice zone size updates when
.slice-simulator--rootalready exists beforeSimulatorManagerinitializes its listeners.The existing
MutationObserveronly handles roots added later. This calls the existing observer setup once during listener initialization and adds a regression test for that behavior.Checklist
How to QA
npm run test.Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.Note
Low Risk
Small listener-init fix plus a unit test; no auth, data, or API contract changes.
Overview
Fixes slice zone size reporting when
.slice-simulator--rootis already in the DOM before listeners start. AMutationObserveronly ranobserveSimulatorRootwhen children were added later, so an existing root never got aResizeObserveruntil the DOM changed again.SimulatorManagernow callsobserveSimulatorRoot()once right after wiring the mutation observer, reusing the same hook that attaches the resize observer. A regression test stubsResizeObserverand asserts the existing root is observed whensliceZoneSizeAPIis enabled.Reviewed by Cursor Bugbot for commit 727b2a1. Bugbot is set up for automated code reviews on this repo. Configure here.