Skip to content

Commit 2f330b5

Browse files
akoclaude
andcommitted
fix(describe): tell a button's three icon elements apart (#1059)
`describe page` -> `create or replace page` rebuilt a button's icon as the wrong element, or deleted it. Mendix stores three icon elements and two of them put a qualified name under the same BSON key: Forms$IconCollectionIcon{Image} -> CustomIcons$CustomIcon Forms$ImageIcon{Image} -> Images$Image (a different document) Forms$GlyphIcon{Code} -> a font code point, no name at all The page describer read `Image` off whichever element was there and discarded the `$Type`, and the page builder writes Forms$IconCollectionIcon unconditionally. So an image icon came out as a bare `Icon: '<qn>'` and went back in as a custom-icon reference: [error] [CE1613] "The selected custom icon 'DesignSystem.Icons_SVG.edit' no longer exists." A glyph icon was worse: DESCRIBE emitted nothing for it at all, and since CREATE OR REPLACE PAGE is a full replacement, replaying that output removed the icon at exit 0 with a success message. This is not a limit on third-party collections, as the report read it — a third-party icon collection round-trips fine, and CE1613 naming the reference is itself evidence the name was never a custom icon. The same three-way split was already understood in navigation (#1008, types.MenuIconKindOf); the page path never received it. That resolver is now shared rather than duplicated. DESCRIBE emits `Icon:` only for the variant mxcli can author and flags every other kind — the unrecognised `$Type` included, so the next variant Mendix adds is reported rather than dropped — with a `-- NOT re-executable` note naming the reference and its element. Measured on the FeedbackModule pages of a stock marketplace project: three glyph icons per page went from zero mentions in describe output to three notes; icon-collection clauses are unchanged (10 on that project) and the emitted script still parses (the one parse failure there is a pre-existing nameless-statictext defect, confirmed identical against the base binary). Authoring the other two variants (`Icon: image <qn>` / `Icon: glyph <n>`, as navigation spells them) is not part of this: the loss is now visible, not yet reversible. NavigationList item and DropDownButton icons are still not read at all — noted in the finding. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017s476QkXr9CFMvKspVzcvu
1 parent 41f5b70 commit 2f330b5

8 files changed

Lines changed: 267 additions & 21 deletions

File tree

‎.claude/skills/fix-issue/findings/mdl-executor.jsonl‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,3 +610,4 @@
610610
{"area": "mdl-executor", "date": "2026-09-13", "symptom": "DESCRIBE silently deletes an ExclusiveMerge: describe -> exec leaves the microflow with fewer merge nodes than the stored graph, with no warning, no MDL-FLOW01 and mx check clean", "cause": "The nested describer walks straight through a merge with a single incoming path without emitting anything for it, so the rebuild has no reason to create it. Only two merge shapes were represented: a split's join point (rendered by `end if`) and a labelled error rejoin (`merge <label>`).", "file": "mdl/executor/cmd_microflows_show_merge.go", "fix": "droppedMergeWarnings() emits a describe-time warning for any ExclusiveMerge that is neither a split join point, nor a labelled error rejoin, nor has in-degree >= 2. Wired into both describe paths beside irreducibleGraphWarnings.", "insight": "The obvious rule (represented == the join point findSplitMergePoints pairs with a split) is WRONG on real code and produces a false positive on ordinary Marketplace microflows. findMergeForSplit needs a join common to ALL branches, so a split where one branch returns pairs with nothing -- yet its merge is still emitted as the continuation after `end split` and survives with its $ID intact (Administration.ManageMyAccount). The in-degree clause is what separates the two. Establish the rule by CORRELATING survival with structure over a corpus rather than reasoning from the describer's code: measuring merge $IDs before and after a round trip over 21 microflows gave in-degree=1 deleted 7 of 7, in-degree>=2 survived 6 of 7. The one exception is a merge lost to flattening in an irreducible graph, which MDL-FLOW01 already owns with a stronger message. Also: count-based comparison cannot tell 'preserved' from 'deleted and recreated' -- compare $IDs. And when scanning describe output for your own warning, grep a string unique to it: MDL-FLOW01's text also contains 'is not represented', which faked a false positive for one round of measurement."}
611611
{"area":"mdl-executor","date":"2026-09-13","symptom":"DESCRIBE renders a microflow whose branches cross as `c1 and c2` when the activity actually runs on `not(c1) or c2` — a program that always logs described as one that never does, with mx check clean","cause":"Nested if/then/else is single-entry/single-exit; a Mendix microflow is an arbitrary digraph. When an inner split's branch lands where an outer split's branch lands, the describer walks the graph as a tree and emits the conjunction of the guards along one path.","file":"mdl/executor/cmd_microflows_normalize.go","fix":"DESCRIBE MICROFLOW ... NORMALIZED (Mode 3): fold the branch guards into one condition via mdl/microflownorm and rewrite a COPY of the graph into the equivalent nested one, then let the existing describer render it. Refuses per-decision when the region holds an activity, a rule-based split, or genuinely interleaved branches.","insight":"Do not write a second describer for a second rendering mode — rewrite the GRAPH and reuse the one describer, or the two drift and every activity renderer is implemented twice. Two verification lessons. (1) A boolean simplifier needs a truth-table equivalence test over generated formulas, not per-rule unit tests: an unsound rewrite produces a pretty WRONG guard, which is the original bug from the other direction. Run it with a rule deliberately broken as the control — mine caught it at the first assignment. (2) Algebra is not behaviour: build the original and the microflow rebuilt from its normalized description side by side and compare return values over the whole input truth table on a real runtime. The rows that matter are the ones the OLD rendering got wrong, so make the fixture's return value distinguish them (a `log` activity is invisible to a test; a `$Result` string is not). Also: the fold leaves the entry merge with in-degree 1, which describe->exec would then silently delete, so splice it out in the transform — otherwise Mode 3's output does not describe the graph its own re-execution builds."}
612612
{"area":"mdl/executor","date":"2026-09-13","symptom":"CATALOG.GRAPH_CYCLES returns 0 rows on a project whose CATALOG.GRAPH_MODULE_COUPLING lists mutual Source/Target module pairs, so a user reads 'no circular dependencies' from a table that was never computed (mendixlabs/mxcli#1060)","cause":"graph_cycles_data is written only by the graph-analysis pass (REFRESH CATALOG COMMUNITIES), while graph_module_coupling is a plain SQL view over refs that any full-mode catalog answers. GRAPH_CYCLES and its four siblings appeared in neither fullOnlyTables nor sourceOnlyTables, so no warning fired; and the recorded build mode is only fast/full/source, so a communities-augmented cache is indistinguishable from a plain full one — which also let a later `refresh catalog full` drop the graph tables silently","file":"`mdl/executor/cmd_catalog.go` (`communitiesOnlyTables`, `warnIfCatalogModeInsufficient`, `tableRequiredMode`, `carryGraphAnalysis`, `cachedCatalogInfo`), `mdl/catalog/catalog.go` (`MetaGraphAnalysis`), `mdl/catalog/builder_graph.go`, `mdl/catalog/builder.go`","insight":"**An empty analytic table is only an answer once something distinguishes 'computed and empty' from 'never computed'.** The mode ladder could not carry that bit: fast/full/source is a LEVEL, and the graph pass is orthogonal to it (it augments any level), so folding it in makes 'source' and 'full+graph' incomparable — it has to be a flag, not a rank. Guard it by MEASUREMENT, not a second hand-written list: run the pass on a synthetic refs graph and diff which tables went from empty to non-empty, then compare that set to the classification map. Shape the fixture so every table fills — two clusters for the community split and the integration surface, one MUTUAL pair for cycles — or the guard silently skips the very table the bug was about","fix":"Record MetaGraphAnalysis/MetaGraphResolution when the pass runs; classify the six tables in communitiesOnlyTables and warn 'requires refresh catalog communities (not run for this catalog)'; report it in SHOW CATALOG STATUS; re-run the pass when a full rebuild replaces a cache that had it"}
613+
{"area": "mdl/executor", "date": "2026-09-13", "symptom": "describe page -> create or replace page broke a button's icon. An icon into an IMAGE collection came back as `Icon: 'DesignSystem.Icons_SVG.edit'` and the build failed [CE1613] \"The selected custom icon 'DesignSystem.Icons_SVG.edit' no longer exists.\" A GLYPH icon produced no describe output at all -- no clause, no comment -- and replay DELETED it at exit 0.", "cause": "Mendix stores three icon elements and two put a qualified name under the same BSON key: Forms$IconCollectionIcon{Image}->CustomIcons$CustomIcon, Forms$ImageIcon{Image}->Images$Image, Forms$GlyphIcon{Code}. extractIconRef read `Image` off whichever element was there and threw the $Type away, and the page builder writes Forms$IconCollectionIcon unconditionally -- so the two named variants were spelled identically on the way out and collapsed into one on the way back in.", "file": "mdl/executor/cmd_pages_describe_output.go (extractButtonIcon, widgetIconMDL, widgetIconNote), mdl/executor/cmd_pages_describe.go (rawWidget.IconType/IconCode), mdl/executor/cmd_pages_describe_parse.go; tests mdl/executor/cmd_pages_describe_icon_test.go", "insight": "The identical three-variant defect was fixed in NAVIGATION eight days earlier (2026-09-05, same area file) and the page path never received it -- so the cheapest possible diagnosis was `grep MenuIconKindOf`, and the fix reuses that resolver rather than adding a second one. **Generalisable: when a fix teaches a layer to distinguish polymorphic variants, grep for every OTHER reader of the same element.** The find was one `git grep Forms\\$ImageIcon` away all along. Two things the report got understandably wrong and that the fix depends on getting right: it is not about third-party vs native collections (a third-party ICON collection round-trips fine -- and CE1613 naming the reference is itself proof the name was never a custom icon, since mxbuild would otherwise have resolved it), and the reported image-icon case is the CHEAPER half -- the glyph case is silent on both sides, so nothing in the output even hints at the loss. **Measure the silence, not the wrong answer**: `grep -c icon` over describe output of a stock marketplace project's FeedbackModule pages returned 0 before and 3 after, which is the only form the glyph bug has. The note has to fire on an UNRECOGNISED $Type too, not a known-bad list, or the next variant Mendix adds is dropped the same way. Controls that matter: an icon-collection icon must still emit a bare `Icon:` and NO note (else the fix passes by flagging everything), and an iconless button must emit neither. No .mdl repro is possible -- mxcli cannot author an image or glyph icon on a button, so the input to the round trip cannot be constructed in MDL; the reproduction is a stored-widget map in the unit test. Also observed in passing and NOT fixed: a nameless `statictext` makes describe output unparseable (pre-existing, confirmed against the base binary), and NavigationList item / DropDownButton icons are never read at all, so they are dropped as silently as the glyph was.", "refs": ["#1059", "#1008", "#602"], "ce": ["CE1613"]}

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
2020

2121
A full rebuild also dropped the graph tables silently while the recorded mode stayed `full` — measured on a 16-module app: 150 community rows before `refresh catalog full force`, 0 after. It now re-runs the pass at the same resolution instead. A fast build is deliberately not promoted: it never overwrites a full cache, so it has nothing to preserve.
2222

23+
- **`describe page` → `create or replace page` rebuilt a button's icon as the wrong element, or deleted it** (mendixlabs/mxcli#1059) — an icon pointing into an **image** collection came back out as a bare `Icon: 'DesignSystem.Icons_SVG.edit'`, which the page builder writes as a custom-icon reference: `[error] [CE1613] "The selected custom icon 'DesignSystem.Icons_SVG.edit' no longer exists."` A **glyph** icon was worse — DESCRIBE emitted nothing for it at all, neither a clause nor a comment, and since `CREATE OR REPLACE PAGE` is a full replacement, replaying that output removed the icon with an exit 0 and a success message.
24+
25+
Mendix stores three icon elements and two of them put a qualified name under the same BSON key — `Forms$IconCollectionIcon{Image}` into a `CustomIcons$CustomIcon`, `Forms$ImageIcon{Image}` into an `Images$Image`, `Forms$GlyphIcon{Code}` into a font with no name at all. The page describer read `Image` off whichever element was there and discarded the `$Type`, so the emitter could not tell the two named variants apart; the builder has exactly one icon element, so any name reaching `Icon:` became a custom-icon reference. Not a limit on *third-party* collections, as the report reasonably read it: a third-party **icon** collection round-trips fine, and CE1613 naming the reference is itself the evidence that the name was never a custom icon.
26+
27+
The same three-way split was already understood one layer over, in navigation (`types.MenuIconKindOf`, ako/mxcli#1008) — the page path never received it, and the shared resolver is now used on both. DESCRIBE emits `Icon:` only for the variant mxcli can author and flags every other kind, the unrecognised `$Type` included, with a `-- NOT re-executable` note naming the reference and its element. Measured on the FeedbackModule pages of a stock marketplace project: three glyph icons per page went from **zero mentions** in describe output to three notes; the `Icon:` clauses on icon-collection icons are unchanged (10 on that project), and the emitted script still parses.
28+
29+
Authoring the other two variants (`Icon: image <qn>` / `Icon: glyph <n>`, as navigation spells them) is not part of this — the loss is now visible, not yet reversible.
30+
2331
- **A parallel split written from MDL ran every path empty** (reported in ako/view-entity-examples FINDINGS §6). `PARALLEL SPLIT … PATH 1 { … } PATH 2 { … }` passed `mxcli check`, built at 0 errors and round-tripped through `describe`, and at runtime each path ran from the split straight to its end: the activities inside never executed and left **no activity record**. Every gate said the workflow was fine, including the one that reads the model back.
2432

2533
Mendix stores an `EndOfParallelSplitPathActivity` as the last activity of every path, and its engine executes a path up to that marker. mxcli wrote paths without one — on both engines, and through `ALTER WORKFLOW … INSERT PATH` on both mutators — so the runtime synthesised an end ahead of the path's contents. Measured on Mendix 11.14.0 with the marker as the only variable between two instances of the same workflow, reading `system$workflowactivity`: without it neither path's call-microflow produced a record; with it both finished. The shipped fix was then booted on its own and the same query shows both paths' activities `Finished`, plus an end record for an empty path.

‎cmd/mxcli/syntax/features_page.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ CREATE PAGE Sales.Detail (Title: 'Detail', Layout: Atlas_Core.Atlas_Default) {
228228
"icon", "linkbutton", "link button",
229229
"nothing", "no action", "inert", "dead button",
230230
},
231-
Syntax: "Action: NOTHING -- deliberately no action (Forms$NoAction)\nAction: SAVE_CHANGES\nAction: SAVE_CHANGES CLOSE_PAGE -- save, then close the pop-up\nAction: CANCEL_CHANGES\nAction: CANCEL_CHANGES CLOSE_PAGE\nAction: CLOSE_PAGE\nAction: DELETE\nAction: DELETE CLOSE_PAGE\nAction: DELETE_OBJECT\nAction: NANOFLOW Module.NF\nAction: NANOFLOW Module.NF(Param: $val)\nAction: OPEN_LINK 'https://example.com'\nAction: SIGN_OUT\nAction: COMPLETE_TASK 'OutcomeName'\nAction: SHOW_PAGE Module.Page\nAction: SHOW_PAGE Module.Page(Param: $currentObject)\nAction: MICROFLOW Module.MF\nAction: MICROFLOW Module.MF(Param: $val)\nAction: CREATE_OBJECT Module.Entity THEN SHOW_PAGE Module.Page\n\nThe list above is exhaustive. Anything else in an action slot is an\nERROR (MDL-WIDGET28), including a real keyword short its argument --\n`Action: OPEN_LINK` without a URL, `Action: SHOW_PAGE` without a page.\nSuch a widget used to be written with NO action at all and rendered as a\ndead control, with check, exec and mxbuild all clean, because a\nno-action widget is legal Mendix (mendixlabs/mxcli#1062). Write NOTHING\nwhen a control really is meant to be inert.\n\nThe same forms serve `OnClick:` (an alias of `Action:`) and `OnChange:`.\n\nA microflow or nanoflow action is a CALL: it needs an argument for every\nparameter the flow declares, or Mendix rejects the page with CE1571. The\nargument list is the same on every widget that takes an action -- a\nCONTAINER (which is clickable) as much as an ACTIONBUTTON. An enclosing\ndata container of the right type supplies it without an argument; a data\ngrid's CONTROL BAR does not, because it is not row-scoped -- pass the\ngrid's selection there (`$dgOrders`).\n\nA SHOW_PAGE argument must be the enclosing widget's context object --\neither $currentObject or the name of the variable the enclosing data\nwidget is bound to. Mendix infers it from that widget, so naming any\nother variable is refused (MDL-PAGEARG01); call a microflow instead.\n\nOPEN_LINK takes a static web address and stores it as a\nForms$StaticOrDynamicString. Mendix also supports a DYNAMIC address, read\nfrom an attribute at runtime; MDL cannot author that one, and DESCRIBE\nflags such a button rather than printing its address as a literal.\n\nButton styles: Default, Primary, Success, Info, Warning, Danger\nIcon: 'Module.IconCollection.IconName' -- e.g. 'Atlas_Core.Atlas_Filled.pencil'\nUse `linkbutton` instead of `actionbutton` for link render mode (same properties).",
231+
Syntax: "Action: NOTHING -- deliberately no action (Forms$NoAction)\nAction: SAVE_CHANGES\nAction: SAVE_CHANGES CLOSE_PAGE -- save, then close the pop-up\nAction: CANCEL_CHANGES\nAction: CANCEL_CHANGES CLOSE_PAGE\nAction: CLOSE_PAGE\nAction: DELETE\nAction: DELETE CLOSE_PAGE\nAction: DELETE_OBJECT\nAction: NANOFLOW Module.NF\nAction: NANOFLOW Module.NF(Param: $val)\nAction: OPEN_LINK 'https://example.com'\nAction: SIGN_OUT\nAction: COMPLETE_TASK 'OutcomeName'\nAction: SHOW_PAGE Module.Page\nAction: SHOW_PAGE Module.Page(Param: $currentObject)\nAction: MICROFLOW Module.MF\nAction: MICROFLOW Module.MF(Param: $val)\nAction: CREATE_OBJECT Module.Entity THEN SHOW_PAGE Module.Page\n\nThe list above is exhaustive. Anything else in an action slot is an\nERROR (MDL-WIDGET28), including a real keyword short its argument --\n`Action: OPEN_LINK` without a URL, `Action: SHOW_PAGE` without a page.\nSuch a widget used to be written with NO action at all and rendered as a\ndead control, with check, exec and mxbuild all clean, because a\nno-action widget is legal Mendix (mendixlabs/mxcli#1062). Write NOTHING\nwhen a control really is meant to be inert.\n\nThe same forms serve `OnClick:` (an alias of `Action:`) and `OnChange:`.\n\nA microflow or nanoflow action is a CALL: it needs an argument for every\nparameter the flow declares, or Mendix rejects the page with CE1571. The\nargument list is the same on every widget that takes an action -- a\nCONTAINER (which is clickable) as much as an ACTIONBUTTON. An enclosing\ndata container of the right type supplies it without an argument; a data\ngrid's CONTROL BAR does not, because it is not row-scoped -- pass the\ngrid's selection there (`$dgOrders`).\n\nA SHOW_PAGE argument must be the enclosing widget's context object --\neither $currentObject or the name of the variable the enclosing data\nwidget is bound to. Mendix infers it from that widget, so naming any\nother variable is refused (MDL-PAGEARG01); call a microflow instead.\n\nOPEN_LINK takes a static web address and stores it as a\nForms$StaticOrDynamicString. Mendix also supports a DYNAMIC address, read\nfrom an attribute at runtime; MDL cannot author that one, and DESCRIBE\nflags such a button rather than printing its address as a literal.\n\nButton styles: Default, Primary, Success, Info, Warning, Danger\nIcon: 'Module.IconCollection.IconName' -- e.g. 'Atlas_Core.Atlas_Filled.pencil'\n\nAny icon collection in the project works, third-party ones included.\nWhat `Icon:` cannot spell is Mendix's other two icon ELEMENTS -- an\nimage icon (a reference into an IMAGE collection) and a glyph icon (a\nfont code point). The first is spelled like a collection reference and\nwould be rebuilt as one, which is CE1613; the second has no name at\nall. DESCRIBE flags both with a `-- NOT re-executable` note rather\nthan emitting a clause that would swap the element\n(mendixlabs/mxcli#1059). Set those in Studio Pro.\n\nUse `linkbutton` instead of `actionbutton` for link render mode (same properties).",
232232
Example: "ACTIONBUTTON btnSave (Caption: 'Save', Action: SAVE_CHANGES, ButtonStyle: Primary)\nACTIONBUTTON btnEdit (Caption: 'Edit',\n Action: SHOW_PAGE Module.EditPage(Item: $currentObject))\nLINKBUTTON btnDelete (Caption: 'Delete', Action: DELETE,\n Icon: 'Atlas_Core.Atlas_Filled.pencil')\n\n-- A clickable CONTAINER in a data grid's control bar, calling a nanoflow\n-- with the grid's selection as its argument.\nDATAGRID dgOrders (DataSource: DATABASE FROM Sales.Order, Selection: Single) {\n COLUMN colNr (Attribute: Number, Caption: 'Order #')\n CONTROLBAR cb {\n CONTAINER cShip (Class: 'command',\n Action: NANOFLOW Sales.ACT_Ship($Order = $dgOrders)) {\n ACTIONBUTTON btnShip (Caption: 'Ship')\n }\n }\n}",
233233
SeeAlso: []string{"page.widgets"},
234234
})

0 commit comments

Comments
 (0)