Skip to content

fix(desktop): keep hit-test fixtures out of foreground - #1667

Merged
Astro-Han merged 3 commits into
mainfrom
fix/1565-background-hit-test
Jul 30, 2026
Merged

fix(desktop): keep hit-test fixtures out of foreground#1667
Astro-Han merged 3 commits into
mainfrom
fix/1565-background-hit-test

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Refs #1565.

The Astryx hit-test contract needs a compositor-mapped Electron window for elementFromPoint, but it does not need foreground focus. The harness previously set MAKA_E2E_SHOW_WINDOW=1, which routed startup through BrowserWindow.show() and interrupted the developer once per fixture route.

  • expose one purpose-specific mapWindowInactive option instead of parallel hidden/inactive/visible mode state
  • map the exact Playwright page's BrowserWindow through showInactive(), then fail closed unless it is visible and unfocused
  • preserve the existing hidden visual-contract path and Linux CI/Xvfb visible path
  • force only inactive Wayland-session launches through XWayland because Electron does not support showInactive() on native Wayland
  • cover platform launch arguments, the Playwright-to-Electron boundary, postcondition failure, and hit-test wiring with script tests

Verification

  • npm run build — passed
  • npm run test:scripts — 224 passed
  • npm run lint — passed
  • npm run format:check — passed
  • npm run typecheck — passed
  • npm run check:hit-test — 5/5 routes clean; frontmost-app sampling remained on Ghostty throughout the final run
  • npm run check:visual-contract — 20/20 comparisons clean against main; frontmost-app sampling remained on Chrome throughout

Review focus

withFixtureWindow owns the mapping policy: captures stay hidden by default, hit testing requests inactive mapping, and only isolated Linux CI displays use the existing visible startup path. On a Wayland session, the inactive launch adds --ozone-platform=x11; all other launch modes retain Electron's platform default.

@Astro-Han
Astro-Han force-pushed the fix/1565-background-hit-test branch from d6bd266 to 799e4f6 Compare July 30, 2026 17:26
@Astro-Han
Astro-Han merged commit 5483501 into main Jul 30, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the fix/1565-background-hit-test branch July 30, 2026 17:36
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