Skip to content

test: keep a real pointer from moving the part grid grabber in its tests - #346048

Merged
Bryan Chen (bryanchen-d) merged 1 commit into
mainfrom
copilot/vscode/part-grid-real-pointer
Nov 4, 2026
Merged

Bryan Chen (bryanchen-d) merged 1 commit into
mainfrom
copilot/vscode/part-grid-real-pointer

Conversation

@bryanchen-d

@bryanchen-d Bryan Chen (bryanchen-d) commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

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 (afterQuiet was ["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, and PartGrid follows 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 is main (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 mouseleave on documentElement. The tests' own events are untrusted, so they still go through the real hit path and the product listeners unchanged. pointer-events: none on the container wouldn't help here: the grid listens on the document, and a trusted pointerover on body would clear the mark instead.

Local proof (Windows, Electron unit runner, --run partGrid.test.ts). A temporary, uncommitted hook in test/unit/electron/index.js sends a trusted mouseMove into the test window every 20 ms with webContents.sendInputEvent, standing in for the Xvfb pointer:

  • No injected pointer: 61 passing.
  • Pointer over main at (650,300), (750,500), (600,100), or alternating with the title row: 59 passing, 2 failing on main every time. The failures are the sibling grabber tests (the grabber shows for a part whose webview… and the 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.
  • With this change: 61 passing in 14 of 14 runs across all those pointer positions.
  • eslint clean, tsc --noEmit shows no errors in this file.
  • def 111 proof 492836 on this head, Linux x64: 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: none from #345320 can be removed.

Authored with Copilot

Copilot AI balanced review requested due to automatic review settings November 4, 2026 15:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the test-only change that isolates Part Grid tests from real pointer interference.

No open issues 🎉

Review effort: Balanced

@bryanchen-d
Bryan Chen (bryanchen-d) marked this pull request as ready for review November 4, 2026 18:21
@bryanchen-d
Bryan Chen (bryanchen-d) enabled auto-merge (squash) November 4, 2026 18:21
@bryanchen-d
Bryan Chen (bryanchen-d) merged commit 64c455b into main Nov 4, 2026
60 checks passed
@bryanchen-d
Bryan Chen (bryanchen-d) deleted the copilot/vscode/part-grid-real-pointer branch November 4, 2026 18:34
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 4, 2026
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.

3 participants