Skip to content

C-1: selection events carry per-item client data (wx DOM port fix + tests)#35

Open
matejcsok-ee wants to merge 3 commits into
mainfrom
c1-clientdata
Open

C-1: selection events carry per-item client data (wx DOM port fix + tests)#35
matejcsok-ee wants to merge 3 commits into
mainfrom
c1-clientdata

Conversation

@matejcsok-ee

Copy link
Copy Markdown
Contributor

What

Extracts the parity audit's single Critical finding (C-1) from the wxwidgets-diff umbrella branch into a standalone change: the wxWidgets DOM port's hand-rolled wxEVT_CHOICE/wxEVT_LISTBOX/wxEVT_COMBOBOX dispatch never called InitCommandEventWithItems(), so event.GetClientObject()/GetClientData() was always NULL — even for items appended with client data.

Product impact: pcbnew's Track & Via Properties dialog reads a VIA_DIMENSION* off the selection event with no null guard; in WASM the null deref silently reads 0 (no trap), so picking a predefined via size set the diameter/drill fields to 0 instead of the predefined value.

Fix

wxwidgets@730b8862 (branch c1-clientdata on the wx fork, atop wasm-port): call InitCommandEventWithItems() before dispatch in src/wasm/{choice,combobox,listbox}.cpp — 3 files, 7 insertions, wasm layer only.

Tests

  • tests/kicad/via-clientdata.spec.ts — KiCad-level e2e: crafted one-via board, Track & Via Properties, pick predefined 0.9 / 0.45 → Via diameter field must become 0.9, not 0. (RED on the unfixed binary: field goes to 0.)
  • tests/apps/standalone/selevent-clientdata/ + tests/e2e/parity-audit.spec.ts — widget-level repro driving all three widget types; self-reports [REPRO] <widget>_clientdata: PASS/FAIL to the console.

Verification

Local run on a fresh kicad_editor build: e2e green (diameter 0.7 → 0.9), screenshot-checked. Both tests previously ran RED→GREEN on wxwidgets-diff (CI run 29019091857 green includes them).

🤖 Generated with Claude Code

matejcsok-ee and others added 2 commits July 10, 2026 11:23
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>
Standalone Emscripten test app driving the exact buggy path: wxChoice/
wxListBox/wxComboBox items appended WITH client data; the selection handler
checks the command event carries it (InitCommandEventWithItems), self-reporting
[REPRO] <name>: PASS/FAIL to the console. Plus its Makefile.wasm target and the
Playwright parity-audit spec that drives all three widgets.

Extracted from the wxwidgets-diff parity-fix branch (e8f3b4c slice: C-1 only).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 10, 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 10, 2026 3:06pm

Request Review

…-bugs)

Cherry-pick of the wxwidgets-diff EH fix (wx cfadc51cc2, orig ac1427d156):
wxApp::OnExceptionInMainLoop() returns true so a throwing event handler no
longer reaches WXConsumeException -> ExitMainLoop(), which under native
wasm-EH destroys the top-level window (blank page). Needed here because the
dom-port-bugs e2e on main exercises exactly this path and fails without it
(PR #35 CI run 29090433643).

Co-Authored-By: Claude Fable 5 <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