fix(snapshot): clean up stale highlight overlays before each snapshot#194
Open
Hexthebaldy wants to merge 1 commit intoepiral:mainfrom
Open
fix(snapshot): clean up stale highlight overlays before each snapshot#194Hexthebaldy wants to merge 1 commit intoepiral:mainfrom
Hexthebaldy wants to merge 1 commit intoepiral:mainfrom
Conversation
|
Have you tried these ref IDs? Can they accurately perform the click operation? |
Author
Yes, I've used these ref IDs and they reliably perform clicks. |
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.
Closes #173
Problem
When running

snapshot -imultiple times on a single page (common inSPAs with client-side navigation), old highlight overlays accumulate
inside the
playwright-highlight-container. The container is reusedacross invocations but never cleared, so previous highlight boxes and
their scroll/resize event listeners pile up.
snapshot 1:
snapshot 2:

twitter space is closed yet old highlight boxes remains
Solution
At the top of
buildDomTree(), remove the existing highlight containerand run all stored cleanup functions before building the new tree. This
ensures each snapshot starts clean regardless of how many times it has
been called on the same page.
Also i moved the
HIGHLIGHT_CONTAINER_IDconstant declaration earlier inthe function
After fix: stale highlights cleaned up on re-snapshot
snapshot 1:

close twitter space
snapshot 2:
