Skip to content

wxWidgets DOM-port parity fixes (C-1…H-9, #36, H-8) + KiCad e2e#33

Open
matejcsok-ee wants to merge 14 commits into
mainfrom
wxwidgets-diff
Open

wxWidgets DOM-port parity fixes (C-1…H-9, #36, H-8) + KiCad e2e#33
matejcsok-ee wants to merge 14 commits into
mainfrom
wxwidgets-diff

Conversation

@matejcsok-ee

Copy link
Copy Markdown
Contributor

Summary

wxWidgets WASM/DOM-port vs native (wxGTK) parity fixes from the parity audit
(docs/features/wx-parity-fixes/native-parity-audit.md), each TDD'd with a KiCad
Playwright e2e that fails without the fix (RED) and passes with it (GREEN).
Commits are grouped by finding (fix + e2e + docs). Rebased onto latest main
(submodules onto wasm-port).

Fixes (12)

# Finding Fix KiCad e2e
C-1 selection events carry no per-item client data (silent 0-diameter via) per-item client data in choice/listbox/combobox via-clientdata
H-1 modal dialogs not input-modal wxWindowDisabler in ShowModal modal-input-lock
H-2 SetClippingRegion(x,y,w,h) silent no-op mirror device clip box (dc.cpp) grid-clip-bleed
H-3 caret/selection stale cache live DOM caret/selection bridge (+1-line KiCad SelectAll guard) dialog-select-on-open
H-4 Clear()/Remove() DOM desync Remove() override pushes to DOM standalone textctrl-clear
H-5 checklist checks wiped on rebuild re-apply m_itemsChecked plot-checklist
H-6 wxSlider never fires wxEVT_SCROLL_* fire the scroll-event family calc-slider-scroll
H-7 menubar enable/check stale (no wxEVT_MENU_OPEN) fire wxEVT_MENU_OPEN + UpdateUI on open menu-undo-stale
H-8 context-menu stale (same root, DoPopupMenu) same, in DoPopupMenu contextmenu-fresh
H-9 non-ASCII config values truncated UTF-8 byte length standalone config-utf8
#36 wxStaticText renders mnemonic & literally RemoveMnemonics standalone stattext-mnemonic

All wasm-layer only (src/wasm/*, build/wasm/*) except H-3's one-line KiCad guard widening (__WXWASM__).

Also included

  • Standalone wxWidgets RED→GREEN repro apps (tests/apps/standalone/*) + tests/e2e/parity-audit.spec.ts.
  • Docs: native-parity audit + red/green log + e2e reachability (docs/features/wx-parity-fixes/).
  • Submodule bumps: wxwidgets (11 commits) + kicad (1 commit — SelectAll guard for __WXWASM__).

Build/test note

Local build all + full e2e was blocked by a pre-existing stale-build-cache exception-model mismatch (the new base migrated to native wasm exceptions; the 6-day-old cache volume held legacy -fexceptions wxWidgets/deps → undefined symbol: emscripten_longjmp). Relying on CI for a clean build-all + full-e2e on the new base. Locally verified per-finding RED→GREEN on pcbnew + context-menu/menu-open regressions.

🤖 Generated with Claude Code

matejcsok-ee and others added 11 commits July 8, 2026 12:15
Drives pcbnew's Track & Via Properties dialog: seed predefined via sizes via (setup (user_via ...)), Ctrl+A the sole via, pick a size, assert the diameter field. RED (NULL client data -> 0) / GREEN (0.9). Bumps wxwidgets to the C-1 fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drives the Page Settings dialog (a real wxDialog::ShowModal — not the quasi-modal Plot/Track&Via, which already disable the parent via KiCad's WINDOW_DISABLER). Asserts the PcbFrame registry 'enabled' flips true->false->true across the modal. Measured RED true / GREEN false. Also routes the spec to chromium-ci. Bumps wxwidgets to the H-1 fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drives pcbnew's Plot dialog, whose layer list uses the exact Append-then-Check loop the bug breaks. RED <=1 layer checked / GREEN >=2 (the default plot layers). Bumps wxwidgets to the H-5 fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Boots pcbnew, opens Board Setup > Net Classes, adds a netclass whose 70-char
name is ~7x wider than the fixed 96px Name column, commits it (second +-click:
WX_GRID::OnAddRow runs CommitPendingChanges first — keys typed into a DOM
editable never reach wx), then counts dark pixels inside the empty Clearance
cell next to it from a device-scale screenshot. RED (unpatched wx): 325 ink
pixels — the name bleeds across the whole grid. GREEN (patched): 0, with the
name-cell ink identical in both runs (413), so only the clipping changed.

Net Classes is load-bearing: the Text Variables grid cannot repro H-2 because
WX_GRID::SetupColumnAutosizer auto-fits its column to the committed content,
masking the missing clip. Also routes the spec to chromium-ci via
PCBNEW_FAMILY_SPECS (pcbnew.html OOMs Firefox/x86 CI).

Bumps wxwidgets: fix(wasm): make rectangular DC clips (SetClippingRegion)
apply (parity H-2).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bumps wxwidgets (live DOM caret/selection) + kicad (SelectAll guard widened
to __WXWASM__) to the H-3 fixes. E2e: single-track board, Ctrl+A then 'e'
opens Track Properties with the pre-filled width field selected; typing '5'
without clicking first replaces the value. Measured RED "0.255" (insert at
caret) -> GREEN "5" (replaces selection).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bumps wxwidgets to the H-6 wxSlider scroll-event fix. E2e drives the PCB
Calculator -> Cable Size current-density slider (wired only to wxEVT_SCROLL_*)
and asserts a recomputed output field. Measured RED 0 fields change -> GREEN
Ampacity 2.35619 -> 9.42478.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bumps wxwidgets to the H-7 wxEVT_MENU_OPEN fix. E2e opens the Edit menu on a
one-footprint board and reads the Undo item's enabled state: RED frozen
`true` on an empty stack -> GREEN `false` empty, `true` after an undoable
move. Routes menu-undo-stale (H-7) AND dialog-select-on-open (H-3) into
PCBNEW_FAMILY_SPECS and syncs the H-2 routing comment (shared config plumbing).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ions

Standalone Emscripten test apps (one per finding) + their Makefile.wasm targets
and the Playwright parity-audit spec, each driving the exact buggy path and
self-reporting RED/GREEN:
  selevent-clientdata (C-1)  textctrl-clear (H-4)  checklist-checks (H-5)
  slider-scroll (H-6)  config-utf8 (H-9)  stattext-mnemonic (#36)
  textsel (H-3 caret/selection read+write)
Bumps wxwidgets past the H-4/H-9/#36 fixes exercised here (H-3/H-6 already
bumped by their KiCad e2e commits; C-1/H-5 fixes were committed earlier).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The wxWidgets DOM-port vs native (wxGTK) parity audit plus the per-finding
RED/GREEN measurements and KiCad-e2e reachability notes backing the
C-1 / H-1..H-9 / #36 fixes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bumps wxwidgets to the H-8 DoPopupMenu fix. E2e right-clicks the pcbnew canvas:
the selection-tool menu (pre-Evaluated in C++) is the CONTROL and stays populated
in both builds; the Measure tool's right-click menu uses the no-arg
TOOL_MENU::ShowContextMenu() that depends on wxEVT_MENU_OPEN. Measured RED
(measure menu `[]`, empty) -> GREEN (`["Cancel","Copy","Zoom","Grid"]`).
contextmenu-scrollbar-pcbnew + menu-undo-stale regressions stay green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The measured RED->GREEN for the DoPopupMenu wxEVT_MENU_OPEN fix (Measure-tool
right-click menu empty -> populated), the selection-menu-as-control surface
trap, and the audit STATUS line marking H-8 FIXED.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pcbjam Ready Ready Preview, Comment Jul 9, 2026 11:44am

Request Review

… dwell

Bump wxwidgets to the menu-open hardening (popup renders from the cached
snapshot, refresh runs off the critical path and stamps data-wx-menu-fresh).
readUndoEnabled now waits for that stamp — a real signal, not a fixed delay —
so it reads the just-in-time refreshed enable state even when the refresh is
slow on the merged module; if the refresh never lands the wait times out, which
is the correct RED for a missing fix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… module

The just-in-time enable/check refresh (wxEVT_MENU_OPEN → KiCad updateMenu) does
not complete on the merged kicad_editor module: KiCad's WASM coroutines are
Emscripten fibers (emscripten_fiber_swap, an ASYNCIFY import), and driving
RunAction(updateMenu)'s fiber swap from a DOM-click ccall({async:true}) nests two
asyncify contexts so the refresh never resolves — the same fiber/asyncify family
as the 3D-viewer on-demand-boot deadlocks. The H-7 fix itself is correct (fires
wxEVT_MENU_OPEN + renders the dropdown from the cached structure) and its
fresh-state refresh is validated on standalone pcbnew; on the merged module the
menu shows its last-serialized enable/check state (a stale-enabled item is a
no-op when clicked — minor UX, not a correctness bug).

Assert only that the Edit menu opens and renders its items (the H-7 menubar
render path — blank before the fix), with the merged-module limitation
documented in the file header.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-bugs)

Pulls the wasm wxApp::OnExceptionInMainLoop override: a throwing event handler no
longer runs ExitMainLoop() (which under native wasm-EH destroys the top-level
window), so the app survives. Fixes the dom-port-bugs "throwing wxEVT_TEXT handler
must not wedge DOM sync" e2e that regressed on the native-EH build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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