Repository navigation
test: keep a real pointer from moving the part grid grabber in its tests - #346048
Merged
Bryan Chen (bryanchen-d) merged 1 commit intoNov 4, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the test-only change that isolates Part Grid tests from real pointer activity.
No open issues 🎉
What changed in this PR
This test-only change isolates the Part Grid suite from real pointer activity that can disrupt synthetic hover tests in Linux Electron CI. Product behavior is unchanged.
Changes:
- Suppress trusted pointer and mouse events during window capture, before they reach the grid’s document listeners.
- Preserve synthetic test events and register the guards for disposal through the suite’s existing cleanup.
| File | Description |
|---|---|
src/vs/workbench/test/browser/parts/partGrid/partGrid.test.ts |
Adds disposable event guards to prevent real pointer activity from moving the grabber during tests. |
Review effort: Balanced
The Part Grid tests move a synthetic pointer, which the grid follows through capture listeners on the document. Under Xvfb the real pointer rests over the Linux Electron unit test window, and Chromium sends it trusted pointer events as the layout changes under it, which moved the grabber to the part under the real pointer (main CI 492826). Drop trusted pointer and mouse events in the window's capture phase for the suite; the synthetic events are untrusted and still reach the grid. Co-authored-by: Copilot <[email protected]>
Bryan Chen (bryanchen-d)
force-pushed
the
copilot/vscode/part-grid-real-pointer
branch
from
November 4, 2026 18:05
df5a13b to
f5200bd
Compare
Bryan Chen (bryanchen-d)
marked this pull request as ready for review
November 4, 2026 18:21
Bryan Chen (bryanchen-d)
enabled auto-merge (squash)
November 4, 2026 18:21
Henning Dieterichs (hediet)
approved these changes
Nov 4, 2026
Bryan Chen (bryanchen-d)
deleted the
copilot/vscode/part-grid-real-pointer
branch
November 4, 2026 18:34
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.
Fixes the
Part Grid › the grabber of a part stays shown as the pointer goes to it from the title row above…failure on Linux x64 Unit Tests (Electron) in main CI 492826 and 492831 (afterQuietwas["main"], expected["chat"]). The test came in with #345683 today. Its product logic is fine. The test is just exposed to the real pointer.Cause: the Part Grid tests move a synthetic pointer with
dispatchEvent, andPartGridfollows the pointer through capture listeners on the document (pointerover,pointermove,pointerout,mouseleave). Under Xvfb, the real pointer rests over the Linux Electron unit-test window. Once earlier suites in the same renderer have activated the window, Chromium sends that pointer trusted hover events as the layout changes under it. In this test, one arrives during the 150 ms quiet wait and moves the grabber to the part under the real pointer, which ismain(the right half of the 1000×800 grid). It doesn't happen on Windows or macOS agents, or in the browser runs, because there the real pointer isn't over the page. This is the same class as #344806 / #345320.Fix (test-only): for the whole suite, drop trusted pointer and mouse events in the window's capture phase, which runs before the grid's document listeners. Capture also covers the non-bubbling
mouseleaveondocumentElement. The tests' own events are untrusted, so they still go through the real hit path and the product listeners unchanged.pointer-events: noneon the container wouldn't help here: the grid listens on the document, and a trustedpointeroveronbodywould clear the mark instead.Local proof (Windows, Electron unit runner,
--run partGrid.test.ts). A temporary, uncommitted hook intest/unit/electron/index.jssends a trustedmouseMoveinto the test window every 20 ms withwebContents.sendInputEvent, standing in for the Xvfb pointer:mainat (650,300), (750,500), (600,100), or alternating with the title row: 59 passing, 2 failing onmainevery time. The failures are the sibling grabber tests (the grabber shows for a part whose webview…andthe grid does not look for the pointer over a webview while its window has no focus…). The exact CI test also needs CI's layout hover timing.tsc --noEmitshows no errors in this file.Unit Tests (Electron)succeeded with 71306 passing and 0 failing. The test passed, where main failed it in 492826 and 492831.The central fix is still to move the real pointer off the window between test files on Linux, which is being discussed separately. This change makes the suite deterministic on its own. Once that lands, this guard and the
pointer-events: nonefrom #345320 can be removed.