Repository navigation
feat(catalog): page and layout appearance, and the widgets of layouts (#1302) - #2012
Merged
Merged
Conversation
…#1302) A Starlark rule "no inline styles" could not see a page's own Class/Style or any widget of a layout, the two places whose styling reaches every page (mendixlabs#1311). - pages and layouts gain Class, Style and DynamicClasses (full build), and pages()/layouts() expose class_name, style and dynamic_classes; reading one raises a rule to the full catalog. - widgets gains a layout's widgets (ContainerType LAYOUT): Content.Widgets, a nested layout's call arguments, a native layout's header placeholder and sidebar. Their refs make a layout the caller of a microflow only its button calls. - Built-in rules report a layout finding against the layout, and the React-client rule skips native layouts as it skips native pages. - UPDATE WIDGETS keeps selecting page and snippet widgets only. Schema version 34. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 8, 2026
Merged
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 #1302 (mirror of mendixlabs#1311).
Problem
A Starlark rule "no inline styles" could not see:
Class/Style:pages()had no such fields;widgets()returned noLAYOUTrows.Those are the places whose styling reaches every page, so the rule missed the widest-reaching cases.
Change
mdl/catalog)pages_dataandlayouts_datagainClass,StyleandDynamicClasses, read from the unit'sAppearancein a full build.buildLayoutswrites a layout's widgets towidgets_datawithContainerType = 'LAYOUT'. They come from:Content.Widgets;Content.LayoutCall.Arguments;RightHeaderPlaceholderandSidebarWidgets.They go through the same
walkWidgetas page widgets. Their refs come with them, so a microflow that only a layout's button calls now has the layout as its caller.Schema version 34.
pages()andlayouts()gainclass_name,styleanddynamic_classes. These are added tofullFields, so reading one builds a full catalog."page"now usewidgetDocType, which giveslayoutfor a layout.NativePages()now also includes native layouts, so MPR012 skips them as it skips native pages.update widgetsstill selects page and snippet widgets only. Writing to layouts through it would be a separate decision, and this PR only changes reads.Evidence
TestLayoutWidgetsAreIndexed_Issue1302is the issue's repro layout. It failed with "ctnLayoutBanner not indexed; widgets_data has map[]".TestExtractLayoutWidgets_NestedAndNative.TestPageAppearanceColumns_Issue1302failed with "no such column: Class".TestStarlarkSeesPageAndLayoutAppearance_Issue1302failed with "page struct has no .class_name attribute".TestAppearanceFieldsRequireFullCatalog.TestReactUnsupportedWidgetRule_LayoutWidgetsfailed with both symptoms: the layout was reported aspage, and the native layout was flagged.TestUpdateWidgetsLeavesLayoutWidgetsAlone_Issue1302.refresh catalog full force:SourceType = 'LAYOUT'.make ci-localpasses with toolchain go1.27.3. Two caveats:mdl/executorcompile was OOM-killed under the parallel run, as before. It passes on its own withgo test -p 1.check-skill-pack-jsneedsnode, which isn't installed locally.Not covered: snippets have no Appearance of their own (
Forms$Snippethas none in the metamodel), sosnippets()has nothing to add.🤖 Generated with Claude Code