Repository navigation
feat(check,lint): warn when a snippet call carries Class/Style/design properties (mendixlabs/mxcli#1511) - #1529
Merged
Conversation
… properties (mendixlabs#1511) A snippet call renders no element of its own: the snippet's widgets are inlined into the parent, so the Class, Style, DynamicClasses and design properties stored on a Forms$SnippetCallWidget never reach the DOM. check, exec and mx check were all clean, so the setting was silently useless. Measured on Mendix 11.15.0 (run --local + playwright check): a snippetcall with Class 'probe-x', Style 'border: 3px solid red', DynamicClasses 'probe-dyn' and 'Align self' / 'Hide on' produced no element carrying any of them (the snippet's container was a direct child of the enclosing container), while a container on the same page with the same four settings carried every one. - MDL-WIDGET48 (check, warning): in the widget-tree walk for CREATE PAGE / SNIPPET and ALTER PAGE INSERT / REPLACE; and in the reference pass for `alter page ... { set (Class|Style|DynamicClasses|<design prop>) on sc }` and `alter styling ... widget sc set ...`, where the stored widget's $Type comes from the page mutator. Clearing a value stays silent. - MPR013 (lint, correctness/warning): catalog Class/Style/DynamicClasses, plus design properties read from the stored document. - Docs: lint rule table, create-page skill + widget reference, docs-site widget types, `syntax snippet` help. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W3x8Fyvir8kLyPgJs1BDmF
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.
Implements mendixlabs#1511 (#1393), approved by the maintainer.
Measured first, in the running app
On an 11.15.0 fixture copy booted with
run --local, a page hassnippetcall snippetCall1inside a container. The call carriesClass: 'probe-x', a Style, DynamicClasses, and two design properties.mxcli playwright checkresults:.mx-name-snippetCall1..probe-outer > .mx-name-sc_innermatched). The snippet's widgets are inlined, with no wrapper element.mxcli check --referencesandmx check(0 errors) were clean throughout, so nothing flagged the dead settings.What this adds
snippetcallwith Class, Style, DynamicClasses or design properties in create page/snippet and in alter page insert/replace. This needs no project.--referencespass it also coversalter page … { set (…) on <snippetcall> }andalter styling … widget <snippetcall> set …. There the widget type comes from the stored page (widgetStorageTyper).SnippetCallAppearance(lint, warning)Tests
validate_snippetcall_appearance_test.go:snippet_call_appearance_test.go: catalog fields and design properties from the document.Revert check:
Also in this PR: lint rule table, create-page skill and widget reference,
docs-site/src/language/widget-types.md,syntax snippethelp, a finding file, andmdl-examples/bug-tests/1511-snippetcall-class-style.mdl.make build,make testandmake lintpass.Notes
alter pages … where widgettype = snippetcallform.Generated by Claude Code