Skip to content

fix: widget init gives a widget whose name is a built-in keyword its own - #2762

Merged
ako merged 1 commit into
mainfrom
claude/issue-triage-prioritization-24rqgv
Dec 2, 2026
Merged

ako merged 1 commit into
mainfrom
claude/issue-triage-prioritization-24rqgv

Conversation

@ako

@ako ako commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Fixes #2707 (upstream mendixlabs#1993).

Problem

In a project with List View Controls, widget init wrote com.mendix.widget.custom.listviewcontrols.DropDownFilter as .mxcli/widgets/dropdownfilter.def.json with mdlName: DROPDOWNFILTER. That is the keyword of the built-in Data grid 2 drop-down filter. Every command loading the widget registry then warned three times that the definition is not registered as dropdownfilter. Deleting the file and re-running widget init regenerated the same one.

scanProjectWidgets already separated two project widgets that derive one name (#1848). It did not count a built-in keyword as taken. The registry refuses a definition on an embedded definition's keyword or a builder-owned keyword (#1463), but widget init didn't know those.

Fix

  • builtinWidgetKeywords: the embedded definitions' keywords, each with its widget ID, plus the builder-owned keywords. They seed the taken set, and a project widget deriving one of them for another widget is renamed through qualifiedMDLName.
  • custom is now a generic ID segment, so the package names the widget: LISTVIEWCONTROLSDROPDOWNFILTER.
  • removeRenamedDefinitions deletes a generated definition (one carrying generatorVersion) for the same widget under its old name. Without it, the old file would keep the warning alive. A hand-written definition is left alone.
  • WidgetDefGeneratorVersion 20 → 21, so existing projects regenerate once and pick up the rename.

Evidence

  • Test first: mdl/executor/widget_defs_builtin_keyword_2707_test.go builds a List View Controls .mpk and the reporter's stale dropdownfilter.def.json. Before the fix it failed with "the widget is registered as DROPDOWNFILTER". After it:
    • the widget is LISTVIEWCONTROLSDROPDOWNFILTER;
    • the stale file is gone;
    • loading the registry no longer warns.
    • Control: dropdownfilter still resolves to the Data grid 2 filter.
  • Regression check: widget init on KnightShift's 40 real packages produces the same names before and after.
  • make ci-local passed.

Generated by Claude Code

List View Controls' com.mendix.widget.custom.listviewcontrols.DropDownFilter
derived DROPDOWNFILTER, the keyword of the Data grid 2 drop-down filter,
and every command warned that its definition is not registered. widget
init told project widgets apart but never counted a built-in keyword as
taken. Embedded definitions' and builder-owned keywords now seed the taken
set, the package names the widget (LISTVIEWCONTROLSDROPDOWNFILTER), the
file under the old name is removed, and the generator version is bumped
so existing projects regenerate.

Fixes #2707

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
@ako
ako merged commit 63ffd12 into main Dec 2, 2026
19 checks passed
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.

[up#1993] widget init gives a generated definition a keyword that is already taken (List View Controls DropDownFilter)

2 participants