-
Notifications
You must be signed in to change notification settings - Fork 50.2k
[DevTools] Use Popover API for TraceUpdates highlighting #32614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hoxyq
merged 9 commits into
facebook:main
from
yongsk0066:feature/devtools-toplayer-highlight
May 7, 2025
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ecb403f
[DevTools] Use Popover API for TraceUpdates highlighting
yongsk0066 a83589c
[DevTools] Improve TraceUpdates popover behavior
yongsk0066 9215664
[DevTools] Fix Flow type errors for TraceUpdates popover implementation
yongsk0066 f7eb1c6
[DevTools] Raise minimum Chrome version to 114 for Popover API support
yongsk0066 938ad0e
[DevTools] Add explanatory comments to $FlowFixMe annotations for Pop…
yongsk0066 9c21b1e
[DevTools] Removed unnecessary try-catch blocks around Popover API me…
yongsk0066 6893d25
[DevTools] Improve TraceUpdates popover layering behavior
yongsk0066 862826b
[DevTools] Add TraceUpdatesTest component for manual testing
yongsk0066 c950b0d
[DevTools] Add Flow annotations for TraceUpdates implementation
yongsk0066 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this new code changes the behaviour of the
drawWebfunction.Before this change, we would clear out canvas and draw nothing. Also, even if canvas was not initialized yet and
drawWebwas called, we would initialize it as empty.I think we should preserve the previous approach:
canvas.showPopover()frominitialize.drawWebfunction call, addcanvas.showPopoverorcanvas.hidePopovercalls, based onnodeToData.sizeand popover state.Something like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. Totally agree that we should first finish all
drawWeblogic and then decide at the end whether or not to promote it to the top-layer.I think that approach better fits the responsibilities of each method. Thanks for clarifying this!
Considering your comments, I've tested two different approaches:
1. Hiding the canvas only when there's nothing to draw (the current method):
Result: This method avoids frequent updates to the top-layer.
However, as you mentioned in your comment, if another top-layer element appears while highlights still remain, the highlight canvas might fall behind the new element.
2. Re-promoting canvas to top-layer on every update call:
Result: Frequent changes to the top-layer occur, but the highlights consistently remain on top, ensuring they never get hidden by other elements.
I think method
#2seems preferable in terms of clearly maintaining highlight visibility too.However, I couldn't find any mentions of performance issues in either the W3C review or blink-dev discussions regarding frequent
top-layerchanges. Unless highlights are triggered continuously at extremely high frequency over a prolonged period, there shouldn't be any noticeable performance impact.