From 546cdbde6ba0e364f180aa30b7a62e7724c22c7c Mon Sep 17 00:00:00 2001 From: yetone Date: Sun, 1 Nov 2026 22:27:19 +0800 Subject: [PATCH] gui tests: claude-mode moves the pointer off the page once the editor is opened (#4638) The "both modes on hover" tests found the hover card up before their hover in WebKit. The click that opens the editor leaves the pointer on the provider row, at (450,110) at 900px and (210,110) at 420px, and the editor draws its TUI / claude -p switch there: a probe printed the switch at [306,96,515,121] (en 900) and [171,78,378,126] (en 420), and the card up in those runs. WebKit sends mouseenter for a pointer that never moved once something is drawn under it. openEditor now moves the pointer to (0,0) right after the click, before the editor is read. Run in WSL (magpie-desktop, Playwright 1.62.0) at origin/main 276c806db: - before (main): the webkit hover tests red in each run, 1 to 3 of 10 (ja, de, en, at 900 and 420; which ones changes from run to run); - after: BROWSER=webkit, the hover tests 3 times, 10/10 each; the whole file in chromium and webkit 44/44. Not tried: mote (its disk is full); the rest of the GUI suite (no other file uses this openEditor). Fixes #4638 --- internal/gui/tests/claude-mode.test.cjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/gui/tests/claude-mode.test.cjs b/internal/gui/tests/claude-mode.test.cjs index 606410ba9..38fabc755 100644 --- a/internal/gui/tests/claude-mode.test.cjs +++ b/internal/gui/tests/claude-mode.test.cjs @@ -89,6 +89,10 @@ async function openEditor(browser, lang, run, { id = "claude", width = 900, swit const row = page.locator(`.row.provider[data-id="${id}"]`); await row.waitFor({ timeout: 60000 }); await row.click(); + // the click's pointer stays where the editor draws its switch, and + // WebKit opens the hover card for a pointer that never moved (#4638): + // the pointer leaves the page before the editor is read + await page.mouse.move(0, 0); await page.locator("#modal .ebody").waitFor(); return { page, errors, reads }; }