Skip to content

chore(server): introduce InputActionObserver on BrowserContext#40695

Open
dgozman wants to merge 3 commits intomicrosoft:mainfrom
dgozman:chore-input-action-observer
Open

chore(server): introduce InputActionObserver on BrowserContext#40695
dgozman wants to merge 3 commits intomicrosoft:mainfrom
dgozman:chore-input-action-observer

Conversation

@dgozman
Copy link
Copy Markdown
Collaborator

@dgozman dgozman commented May 7, 2026

Summary

  • Move onBeforeInputAction off Instrumentation and onto a new InputActionObserver on BrowserContext; observers receive (progress, target: Page | ElementHandle, point?, box?).
  • Tracing, Debugger, Screencast, and Recorder register themselves as observers; Screencast no longer needs to be an InstrumentationListener.
  • Drop annotate, box, and point from CallMetadata — they're now passed as observer arguments at the call site (with Screencast computing a boundingBox itself when needed and Recorder caching points by callId).

dgozman added 3 commits May 7, 2026 10:46
Replace `Instrumentation.onBeforeInputAction` with a dedicated
`InputActionObserver` registered on `BrowserContext`. The observer
receives `(progress, target)` where target is `Page | ElementHandle`.
`Tracing`, `Debugger`, and `Screencast` register themselves on the
context and remove themselves on close/dispose.
Pass the optional bounding box as a third argument to
`performOnBeforeInputAction`. Pointer actions in `dom.ts` already
have the box from clickable-point computation; for non-pointer
actions on an `ElementHandle`, `Screencast` computes the box itself
when it needs one. This also lets `Screencast` stop being an
`InstrumentationListener` (its only use of `onBeforeCall` was
flipping the now-removed `annotate` flag) and inlines the small
`_beforeNonPointerAction` helper at its 5 call sites.
Pass the action point as a fourth argument to
`performOnBeforeInputAction(progress, target, point?, box?)`. Mouse,
touchscreen, and pointer-action call sites supply it directly;
`Screencast` and `Tracing` consume it from the argument instead of
reading `metadata.point`. The trace's after-action event no longer
carries a point (the input event still does, which is what trace
viewer reads). `Recorder` now registers as an `InputActionObserver`
and caches points by callId so the overlay can keep drawing the
action-point dot.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Test results for "MCP"

9 failed
❌ [chrome] › mcp/annotate.spec.ts:137 › should abort MCP annotation when last screenshot is removed @mcp-windows-latest-chrome
❌ [chrome] › mcp/annotate.spec.ts:251 › should start dashboard and annotate when no dashboard is running @mcp-windows-latest-chrome
❌ [chromium] › mcp/test-run.spec.ts:126 › test_run should stop when aborted @mcp-windows-latest-chromium
❌ [firefox] › mcp/cli-devtools.spec.ts:217 › video-start-stop @mcp-windows-latest-firefox
❌ [firefox] › mcp/cli-devtools.spec.ts:231 › video-chapter @mcp-windows-latest-firefox
❌ [firefox] › mcp/cli-session.spec.ts:56 › close-all @mcp-windows-latest-firefox
❌ [firefox] › mcp/dashboard.spec.ts:123 › daemon show: closing page exits the process @mcp-windows-latest-firefox
❌ [firefox] › mcp/dashboard.spec.ts:159 › save recording streams WebM bytes to the chosen file @mcp-windows-latest-firefox
❌ [msedge] › mcp/test-run.spec.ts:126 › test_run should stop when aborted @mcp-windows-latest-msedge

7006 passed, 1058 skipped


Merge workflow run.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Test results for "tests 1"

14 fatal errors, not part of any test
1 failed
❌ [chromium-library] › library/video.spec.ts:275 › screencast › should capture navigation @ubuntu-22.04-chromium-tip-of-tree

3 flaky ⚠️ [chromium-library] › library/video.spec.ts:719 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/video.spec.ts:275 › screencast › should capture navigation `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-page] › page/page-leaks.spec.ts:85 › click should not leak `@firefox-ubuntu-22.04-node20`

41539 passed, 851 skipped, 112 did not run


Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant