feat(annotate): instrument input actions and show subtitle overlay#39797
feat(annotate): instrument input actions and show subtitle overlay#39797pavelfeldman merged 2 commits intomicrosoft:mainfrom
Conversation
8152196 to
589cb02
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| for (const entry of this._renderedEntries) { | ||
| entry.box = entry.targetElement.getBoundingClientRect(); | ||
| if (!entry.box && !entry.targetElement) | ||
| continue; |
There was a problem hiding this comment.
I think we still want to update the tooltip in this case.
| const title = renderTitleForCall(metadata); | ||
| const utility = await page.mainFrame()._utilityContext(); | ||
|
|
||
| // Run this outside of the progress timer. |
There was a problem hiding this comment.
Why? The progress timer is ticking anyway, so it still takes away from the action timeout.
There was a problem hiding this comment.
I never want this animation to interrupt, probably need to do something about progress there in general.
|
|
||
| async apiUp(progress: Progress, options: { button?: types.MouseButton, clickCount?: number } = {}) { | ||
| progress.metadata.point = this.currentPoint(); | ||
| await this._page.instrumentation.onBeforeInputAction(this._page, progress.metadata); |
There was a problem hiding this comment.
It seems like we now capture the same tracing snapshot twice - on onBeforeCall and onBeforeInputAction immediately after it.
| const utility = await page.mainFrame()._utilityContext(); | ||
|
|
||
| // Run this outside of the progress timer. | ||
| await utility.evaluate(async options => { |
There was a problem hiding this comment.
Let's catch this one, or even better - the whole method?
| const target = targetElements[0]; | ||
| const targetBox = target?.getBoundingClientRect(); | ||
| const targetCenter = target ? { x: targetBox.left + targetBox.width / 2, y: targetBox.top + targetBox.height / 2 } : null; | ||
| const isAligned = !targetCenter || Math.abs(targetCenter.x - pointX) > 10 || Math.abs(targetCenter.y - pointY) > 10; |
There was a problem hiding this comment.
| const isAligned = !targetCenter || Math.abs(targetCenter.x - pointX) > 10 || Math.abs(targetCenter.y - pointY) > 10; | |
| const isAligned = !targetCenter || (Math.abs(targetCenter.x - pointX) < 10 && Math.abs(targetCenter.y - pointY) < 10); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
589cb02 to
c9c52b2
Compare
Test results for "tests 1"3 flaky38818 passed, 845 skipped Merge workflow run. |
Test results for "MCP"5458 passed, 340 skipped Merge workflow run. |
Summary
onBeforeInputActioninstrumentation for raw keyboard/mouse/touchscreen viaapi*methodsmetadata.boxfrom element bounding rectpausesBeforeActiontopausesBeforeInput