Repository navigation
Conversation
…r widget key (mendixlabs#1573) A pluggable widget takes every one of its settings under the key its package declares, and exec stores them: datagrid dg (DataSource: database Shop.Ord, configurationStorageType: localStorage, itemSelectionMethod: rowClick, refreshInterval: 30) `describe page` printed only the properties MDL has a keyword for (PageSize, Pagination, Selection, onClick), so executing the description wrote the widget's default over each of the others. Measured on Mendix 11.12.5: a grid with 22 settings changed came back with the 4 that have keywords, with `mx check` at 0 errors throughout, and a Studio Pro-authored grid lost its `onClickTrigger: double`. The describers for datagrid2 and gallery now also print every setting whose stored value differs from the default, under its key: enumerations and plain values, text templates with their `{N}` parameters, expressions, attributes, a column's own settings (minWidth, minWidthLimit, allowEventPropagation, …) and the empty-state placeholder slot. The default is read from the widget's own stored definition (Type.ObjectType, and the item type of `columns`), not from a list. It is not always the schema's DefaultValue: four text templates have '' there and store the text the widget ships for them, so a text template counts as default when it holds that text, and a grid that sets none of the settings describes byte for byte as before (16 pages of a Studio Pro-authored project and 16 of the committed PedApp: the one that differs is a marketplace page, by the setting it had been losing). An Expression prints unquoted, except an expression that is only a string literal, which would be read back as the string and stored without its quotes. An attribute prints bare where exec resolves a bare name (inside a data container) and qualified where it would not. A setting with no spelling (an attribute reached over associations) is named in a `-- NOT re-executable` comment. Selection-typed keys are carried by `Selection:` and not repeated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
AI Code ReviewReview SummaryCritical IssuesNone found. Moderate IssuesNone found. Minor IssuesNone found. What Looks Good
RecommendationApprove. The PR is well-tested, correctly implements the fix according to the project's architecture and guidelines, and provides strong evidence of resolving the described issue without regressions. The dependency on #1574 should be respected as noted in the PR description, but the code itself is sound. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
This branch has not been deployed
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 #1573 together with #1574 (this is the describe half). Please merge after #1574. That PR makes a no-project
checkaccept the expression-typed settings this one now prints.What it fixes
describe pageprinted only a few keyword properties of a Data grid 2 (PageSize,Pagination, …) and of a Gallery. Every other setting thatcheckandexecaccept by widget key was dropped, so a describe → exec round trip reset it to the default. That includesrefreshInterval,columnsHidable, the personalization settings, row classes, text-template labels, a column's own settings, and theemptyPlaceholderslot.How
cmd_pages_describe_bykey.go(new):Type.ObjectType.PropertyTypes[].ValueType, and from thecolumnsitem type for columns, with no hard-coded list.DefaultValue: four text templates have''there but store their shipped translations. Without this rule, every grid would print four labels.<key>Params;onClickand the named action slots (Feature: MDL surface for named pluggable-widget action slots beyond onClick/onChange (FileUploader createFileAction / onUploadSuccessFile) #956), and selection-typed keys bySelection:.-- NOT re-executable:comment instead of being lost.Evidence
Tests:
cmd_pages_describe_bykey_test.go. With the by-key reads switched off, 9 of 10 fail with the symptom, for exampleconfigurationStorageType was not printed. The tenth guards an untouched grid's output. All pass with the fix.Real round trip (Mendix 11.12.5 scratch app; five grid pages and one gallery page, from
bug-tests/1573-datagrid-by-key-settings-describe.mdl).describe → execover a stored page only proves pass-through, so the real test is describe → drop page → exec → BSON compare, with ids stripped:mx checkreports 0 errors after the round trip. Describing the untouched Studio Pro pages of the scratch app and of PedApp changes exactly one page in each:Administration.Account_Overviewnow keepsonClickTrigger: 'double', which v0.27.0 lost.Round-trip suite:
go test -tags integration ./mdl/roundtrip -run TestPedAppRoundTripis ok. The full package gives 2181 pass and 1 Windows TempDir-lock failure (a microflow test), which is identical on the other branch.Tests and vet:
go test ./mdl/executor/shows the same 28 pre-existing Windows failures asmain.go vetandgofmtare clean.Linux (
golang:1.26.6-bookworm, ANTLR 4.13.2):make grammar build test check-mdl check-findings check-conformance check-migration-reference lint-goall pass.Also included: a CHANGELOG entry (Fixed), a finding in
findings/mdl-executor/, and awidget-types.mdnote that any Data grid 2 setting can be set by its key, with the personalization example.Not covered
exportDialogLabel: '') is written as the shipped default text, so that can't be represented in MDL.🤖 Generated with Claude Code