feat(mobile): canvas-only mobile mode — pinch-zoom/pan/tap gestures + chrome-less editors

On a mobile device (or ?mobile=1) the editors run canvas-only with touch
gestures driving the view:

- touch-gestures.ts: pure recognizer (unit-tested) + DOM shim installed in
  boot preRun — one-finger drag → synthetic middle-drag (pan), pinch →
  synthetic wheel at the centroid (zoom-to-cursor), tap → left click.
  preRun registration order is what lets stopImmediatePropagation suppress
  the wx layer's single-finger→LEFT-drag touch mapping.
- kicadSetChrome(bool) embind: hides all AUI panes except DrawFrame + the
  menubar/status bar via generic wx APIs (kicad fork untouched); boot polls
  it after runtime init. Pairs with the wxwidgets IsShown layout fix.
- mobile-mode.ts: ?mobile=1/0 override or UA-CH/coarse-pointer autodetect;
  shell hides its overlays and the inherent-to-mobile preflight warnings.
- e2e: mobile-chromium project (Pixel 7) + 4 specs (chrome-less, tap,
  pinch, pan) with screenshot-invertibility assertions; also fixes
  tool-switch.spec's stale pre-scope-refactor URLs (was broken on main).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Istvan Matejcsok 2026-07-06 16:10:52 +02:00
commit dc7c60f723
13 changed files with 1039 additions and 24 deletions

View file

@ -43,12 +43,22 @@ export default defineConfig({
projects: [
{
name: 'firefox',
testIgnore: /mobile-.*\.spec\.ts/,
use: { ...devices['Desktop Firefox'], viewport: { width: 1280, height: 720 } },
},
{
name: 'chromium',
testIgnore: /mobile-.*\.spec\.ts/,
use: { channel: 'chrome', viewport: { width: 1280, height: 720 } },
},
{
// Canvas-only mobile mode (features/mobile). Mobile emulation is
// Chromium-only, and headless SwiftShader WebGL is broken on ARM Mac (see
// header) — run this project headed locally: --project=mobile-chromium --headed.
name: 'mobile-chromium',
testMatch: /mobile-.*\.spec\.ts/,
use: { ...devices['Pixel 7'], channel: 'chrome' },
},
],
webServer: {