Repository navigation
Place building blocks with a styled dynamic text or a list view without a source - #2198
Merged
Merged
Conversation
`use building block PlatformDesignSystem.Icon_After_Text as b_` (and the three Wizard blocks) failed with `dynamictext "b_text13": an inline `style` crashes MxBuild`. The block's text is styled `--icon-size: auto;`. Cause: MDL-WIDGET03 (#673) refuses any dynamictext with a style in applyWidgetAppearance. A block is expanded by rendering its stored widgets to MDL and re-parsing them, so a style Studio Pro wrote reached the guard looking exactly like hand-written MDL. Fix: the expander marks every widget it copies in (ast.WidgetV3.FromBuildingBlock, kept by cloneWidget's struct copy), and the guard skips marked widgets. The block's style is written as stored. Hand-written MDL is still refused by both check and exec. Measured with Mendix 11.12.1 mxbuild: - testdata/testapp has a Studio Pro-authored dynamic text styled 'word-wrap: break-word;'. - A dynamic text with an inline style written by this engine (hand-written, guard stubbed, --no-check) passes mx check and `mxcli docker build`. The #673 NullReferenceException did not reproduce. The refusal for hand-written MDL may be obsolete, but it is not lifted here. - A copy of EvSpike whose Card block was patched to carry the styled text: main refuses the page; this branch places it, and the page builds. Tests: use_building_block_unauthored_2183_test.go. The block test fails with the reported error when markFromBuildingBlock is stubbed. A control checks that the hand-written refusal still applies. Refs #2183, mendixlabs#1836 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QiMsnXa9crge2qnSk9S7Zn
`use building block PlatformDesignSystem.Avatar_Group_SM as b_` (and Avatar_Group_XS) failed with `CreatePage: encode: ListView source <nil> is not supported by either engine`. The block's list view has no data source configured. A hand-written `listview` with no `DataSource:` passed `mxcli check` and then failed the same way at exec. Cause: listViewSourceToGen had no case for a nil source, so it hit the refusal meant for unknown source types (in place since the ListView writer was added). Forms$ListViewXPathSource also registered only SourceVariable as a null field, so an XPath source with no entity left out the EntityRef key. Fix: a nil source is written as Studio Pro's unconfigured source, Forms$ListViewXPathSource with: - EntityRef and SourceVariable null - XPathConstraint "" - ForceFullObjects false - an empty SortBar and Search (marker 2) This applies to block and hand-written list views alike. exec warns, and mx check reports CE0488 until the author binds a source. Reference: all 13 unconfigured List Views in the Atlas page templates of testdata/testapp (and 13 in PedApp's) have this exact key set. The new test pins it. Measured with Mendix 11.12.1 mxbuild, on a copy of EvSpike whose Card block carries a Studio Pro list view with no source (grafted in with $IDs and pointers renumbered): - main refuses the page. - This branch places it with a warning. mx check reports only CE0488 "No entity configured for the data source of this list view". - With `(datasource: database from Administration.Account)` mx check reports 0 errors and `mxcli docker build` succeeds. Also updates the skills that stated the refusals without the building-block exception, and adds the CHANGELOG entry covering both fixes. Tests: listview_no_source_2183_test.go (writer, plus a control that unknown source types are still refused) and use_building_block_unauthored_2183_test.go (the block is placed with a warning; a list view with a source does not warn). Before the fix both fail with the reported error or with no warning. Refs #2183, mendixlabs#1836 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QiMsnXa9crge2qnSk9S7Zn
…yle-and-sourceless-listview # Conflicts: # CHANGELOG.md
…yle-and-sourceless-listview # Conflicts: # CHANGELOG.md
…yle-and-sourceless-listview # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2183 (upstream mendixlabs#1836).
Two refusals meant for hand-written MDL blocked whole building blocks. Each has its own commit.
1. Inline style on a block's dynamic text (
4f9721012)applyWidgetAppearance(MDL-WIDGET03) refuses anydynamictextwith a style.use building blockexpands a block by re-parsing its rendered MDL, so a style Studio Pro wrote looked exactly like hand-written MDL. That blocked PDSIcon_After_Textand theWizard_*blocks.testdata/testappalready has a Studio Pro-authored styled dynamic text. Two styled dynamic texts written by this engine, including the block's--icon-size: auto;, passmx checkwith 0 errors and build withmxcli docker build. History records no measurement for the original claim.ast.WidgetV3.FromBuildingBlock), and the refusal skips them, so the block's stored style is carried through verbatim. Hand-written MDL is still refused at check and exec. Whether to lift that refusal too, given the measurement, is left as a separate decision.2. List view without a data source (
b31e469a0)listViewSourceToGenhad no case for a missing source, so it returned the generic "not supported by either engine — please file an issue" error. That blocked PDSAvatar_Group_*, and a hand-writtenlistviewwithoutDataSource:passed check and then failed at exec the same way.EntityRefjoinsSourceVariablein the type's null-written keys.mx checkthen reports CE0488 "No entity configured…" until a source is set.Verification
listview_no_source_2183_test.go: before the fix it failed with exactly the reported<nil>error; before the null-key change it failed on the missingEntityRef. A control shows unknown source types are still refused.use_building_block_unauthored_2183_test.go(a mock block): the style test fails with the reported refusal when the block marking is stubbed, and the list-view test fails when the warning is stubbed. Controls: hand-written style is still refused, and a list view with a source doesn't warn.Atlas_Web_Content.Cardblock in a copy was patched with the PDS style and a Studio Pro sourceless list view. The patched block builds on its own.<nil>error.mx checkreports only CE0488;docker buildsucceeds;mdl/ast,mdl/executor,mdl/backend/modelsdkandmdl/roundtrip, plusfmt-check,check-findingsandcheck-skill-index, pass.mainwas merged in to resolve a CHANGELOG conflict.Docs
theme-styling,create-pageandatlas-design(and itsbuilding-blocks.mdreference).Not in this PR
check-time warning for a hand-written list view without a source; only exec warns.Generated by Claude Code