en un clic
debug-widget
// Use when debugging a Mendix pluggable widget bug — visual glitch, broken scrolling, missing data, stale state, or interaction bugs that need runtime evidence before fixing.
// Use when debugging a Mendix pluggable widget bug — visual glitch, broken scrolling, missing data, stale state, or interaction bugs that need runtime evidence before fixing.
| name | debug-widget |
| description | Use when debugging a Mendix pluggable widget bug — visual glitch, broken scrolling, missing data, stale state, or interaction bugs that need runtime evidence before fixing. |
Evidence-first debugging for Mendix pluggable widgets. You MUST reproduce the bug with Playwright before reading source code, and MUST verify the fix with Playwright before declaring success.
REQUIRED BACKGROUND: superpowers:systematic-debugging for general root-cause methodology.
Before starting, confirm with the user:
http://localhost:8080. Ask: "Is the Studio Pro project running?"Identify the target from the bug report:
combobox-web, datagrid-web, …)Find the page — see page-discovery.md
Write a diagnostic Playwright script that follows the JIRA reproduction steps and captures the symptom as a measurable assertion or console output diff.
See diagnostic-patterns.md for templates by bug category.
Save it as: packages/pluggableWidgets/<widget>-web/e2e/<bug-id>-diagnostic.spec.js
Run it:
cd packages/pluggableWidgets/<widget>-web
npx playwright test e2e/<bug-id>-diagnostic.spec.js --headed
Confirm reproduction:
Now you may read source code.
Trace the reactive chain from DOM symptom to root cause. See reactive-chain.md.
Find root cause using superpowers:systematic-debugging Phase 1–3:
Apply the fix at the root cause, not the symptom.
Bump the version (patch for bugfixes, minor for new behavior). Two files must stay in sync:
packages/pluggableWidgets/<widget>-web/package.json — "version" fieldpackages/pluggableWidgets/<widget>-web/src/package.xml — version= attribute on <clientModule>Add a changelog entry in packages/pluggableWidgets/<widget>-web/CHANGELOG.md under the existing ## [Unreleased] section:
### Fixed
- We fixed an issue where <brief description of the bug>.
Ensure MX_PROJECT_PATH is set to the Studio Pro project directory (ask the user if not already set).
Build and deploy the widget:
export MX_PROJECT_PATH=/Users/<user>/Mendix/<ProjectName>
pnpm --filter @mendix/<widget>-web run build
The build copies the .mpk directly into $MX_PROJECT_PATH/widgets/. If shared packages were modified, build them first — check the widget's AGENTS.md for the dependency list.
Once the build succeeds, proceed directly to Phase 4 — no manual browser refresh or Studio Pro action needed.
You CANNOT claim the fix works until the Playwright script confirms it.
Re-run the same diagnostic script from Phase 1:
cd packages/pluggableWidgets/<widget>-web
npx playwright test e2e/<bug-id>-diagnostic.spec.js --headed
Playwright's page.goto("http://localhost:8080/...") navigates fresh and picks up the latest deployed widget automatically — no manual browser refresh needed.
Evaluate result:
superpowers:systematic-debugging Phase 4.5.After confirmed fix:
cd packages/pluggableWidgets/<widget>-web && pnpm run testconsole.log to expect() assertions), or delete itPhase 2 (fix) → Phase 3 (build + deploy) → Phase 4 (verify)
│
passes? ──┤
yes: done │
no: ──────→ back to Phase 2
(max 3 attempts, then question architecture)
| Category | Symptom Signals | Diagnostic Pattern |
|---|---|---|
| Layout/CSS | Wrong size, overflow broken, misaligned | Dimensions, CSS custom properties, max-height |
| Data | Missing rows, wrong values, stale content | Row count, datasource status, item text |
| Stale State | Value not updating, external change ignored | Read display → trigger change → read again |
| Interaction | Click/keyboard unresponsive, wrong selection | Event handling, aria-selected, MobX actions |
| Performance | Janky scroll, slow render, high rerender rate | Frame timing, render count, DOM node count |
| Lifecycle | Flash of old content, double render | Gate prop timing, MobX reaction order |
window.mx.session.logout() after each test. Mendix caps at 5 concurrent sessions.widget-plugin-grid or other workspace deps changed, build them first..mpk to $MX_PROJECT_PATH/widgets/.This skill applies to all pluggable widgets and grows with each debugging session. After fixing a bug, consider adding:
| What to add | Where | When |
|---|---|---|
| New bug category / diagnostic pattern | diagnostic-patterns.md | You encountered a symptom type not yet covered |
| Widget-specific selectors | diagnostic-patterns.md (under the relevant pattern's selector table) | You debugged a widget and know its key CSS selectors |
| Widget architecture section | reactive-chain.md | The widget uses DI/MobX and isn't documented there yet |
| New page discovery method | page-discovery.md | Existing tiers didn't work for a specific project setup |
| Widget context file | packages/pluggableWidgets/<widget>-web/AGENTS.md | The widget has no AGENTS.md — create one to document its architecture for future sessions |
Keep patterns widget-agnostic. Use <placeholder> selectors in templates. Add widget-specific selector tables below each pattern so the next developer can reuse your selectors without re-discovering them.
| File | Contents |
|---|---|
| page-discovery.md | Tier 0/1/2/3 page discovery procedures with code |
| reactive-chain.md | Architecture tiers, tracing procedure, key files |
| diagnostic-patterns.md | Playwright script templates by bug category |
Review a pull request in the mendix/web-widgets monorepo. Checks Mendix widget conventions, React/MobX patterns, versioning, test coverage, Atlas UI styling, security, and accessibility.
Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.