feat(wasm-dom): Phase 7 complete — KiCad runs on the DOM port

All six apps build and run; full kicad e2e suite green under WX_PORT=dom
(28 passed / 1 flaky / 2 skipped / 0 failed). Closing fixes this phase:
menu JSON serializer (wxString::Format empty-return on KiCad labels),
main-frame visibility root (browser page has no hidden state), stateless
keyboard arbitration (Firefox fires no focusout on element removal),
out_dir scope in upstream's pipelined postprocess. Docs + visual notes
updated; per-port kicad reference screenshots in place.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Viktor Vaczi 2026-06-11 14:54:44 +02:00
commit bb26fc0807
3 changed files with 40 additions and 5 deletions

View file

@ -6,10 +6,14 @@ instead of wxUniversal pixels on a canvas. Goals: styleable modern UI,
native text input/IME, accessibility, crisp rendering — while the existing
canvas port keeps working unchanged from the same source tree.
Status: wxWidgets-side port complete (Phases 05); both e2e suites green
from one tree. KiCad-on-DOM is the next phase. Work intentionally stays on
`feature/wx-dom-port` (root + wxwidgets + kicad) — not merged to
`main`/`wasm-port`.
Status: COMPLETE (Phases 07). wxWidgets-side port done, both wx e2e
suites green from one tree, and all six KiCad apps (pcbnew, eeschema,
calculator, pl_editor, symbol_editor, gerbview) build and run on the DOM
port — full kicad e2e suite green under `WX_PORT=dom` (28/0, 1 flaky,
2 skipped). Build with `WX_PORT=dom docker/build.sh <app>` (outputs in
`output/dom/`); test with `WX_PORT=dom npm run test:kicad`. Work
intentionally stays on `feature/wx-dom-port` (root + wxwidgets + kicad) —
not merged to `main`/`wasm-port`.
## Architecture in one page

View file

@ -131,3 +131,34 @@ slider/statline/statbox wired:
wxDomGetLastCommandId + wxDOM_EVENT_MENU → wxMenu::SendEvent. Toolbar
identical shape (wxDomToolbarSetTools / wxDOM_EVENT_TOOL →
wxToolBarBase::OnLeftClick with radio-group + veto handling).
## Phase 7 (2026-06-11) — KiCad on the DOM port
- **All six apps build and run** (pcbnew, eeschema, calculator,
pl_editor, symbol_editor, gerbview); full kicad e2e suite under
WX_PORT=dom: 28 passed / 1 flaky / 2 skipped / 0 failed.
- **Screenshots:** pcbnew = layer manager, appearance panes, toolbars,
WebGL board canvas, native menubar (File…Help, 9 menus) — near-twin of
the canvas reference modulo native chrome styling. eeschema = full
editor with real checkbox filter panels. calculator = native DOM form
controls (inputs, radios, buttons) beside canvas-island diagrams.
Port-aware reference images: tests/wizard-04-finish-headless-dom.png.
- **Bugs found & fixed by KiCad-on-DOM:**
16. DomMenuItemsToJson passed labels through wxString::Format, which
returns "" when vsnprintf rejects an argument (some KiCad labels)
→ empty JSON item → whole menu document unparseable. Labels are
now concatenated; wxDomJsonEscape hardened for ctrl chars < 0x20.
17. The first TLW (the browser page) started logically hidden; KiCad
never calls Show(true) on it (canvas renders regardless), so every
pre-Show child stayed display:none. Main frame now starts shown.
18. Keyboard arbitration was stateful (focusin/focusout flag); Firefox
fires no focusout when a focused element is REMOVED (wizard page
destroyed mid-focus) → flag stuck → all keys except Escape
swallowed for the session (eeschema Backspace/Delete dead). Now a
stateless document.activeElement check.
19. Build pipeline: fresh build trees failed at the embind pre-compile
(generated pcb_lexer.h not yet emitted) — found here and fixed
independently upstream (f936eb1); upstream's version kept.
- **Known cosmetic gap:** DOM menubar/toolbar styling differs from univ
pixels by design (native buttons, system font); the kicad reference
regions therefore use per-port reference images.