docs(annotation): explain that Mendix has no annotation height (#1014) - #367
Merged
Conversation
`Height: n` on a domain-model annotation was a bare parse error —
"mismatched input 'Height' expecting {POSITION, CAPTION, WIDTH}" — which
reads like a missing mxcli feature, and was reported as one.
It is not. Mendix stores no annotation height: DomainModels$Annotation has
exactly Caption, ExportLevel, Location and Width, so the note auto-sizes to
its caption and there is nowhere to write a height into. Accepting the
property would mean inventing a key the platform does not have.
The metamodel in this repo could not settle that on its own — it is an
11.6.0 snapshot and the report was against 11.12.2, so a later property
would be invisible to it. Three further sources agree, measured on 11.13.0:
`mx dump-mpr` (Mendix's own serializer) emits those four keys on real
projects; `mx convert -p`, which rewrites the model through Mendix's own
object model and would materialise a property that merely had a default,
adds nothing; and the published Model SDK's domainmodels.Annotation lists
caption, exportLevel, location and width.
So the deliverable is an error that says which it is and names the levers
that do exist — the reporter's actual goal, a note that does not overlap the
entities below it, was reachable already:
- WIDTH is the height lever, because the box wraps: narrower is taller.
- ALTER ENTITY … SET POSITION moves what the note overlaps, so nothing has
to be nudged by hand.
Any other unsupported property gets the four-property statement without the
height-specific advice. Both branches key on the `expecting {POSITION,
CAPTION, WIDTH}` token set rather than on the word "Height" — a page
widget's Height is valid MDL, and a name-keyed hint would misfire on it
(control: TestWidgetHeightIsNotAnnotationHinted).
Control: disabling the branches fails both hint tests and leaves the widget
control passing.
Refs mendixlabs#1014
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s476QkXr9CFMvKspVzcvu
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.
Refs mendixlabs#1014, which asks for a writable
Heighton domain-model annotations.The feature cannot be built — Mendix has no annotation height
DomainModels$Annotationhas exactly four properties:Caption,ExportLevel,Location,Width. The note auto-sizes to its caption, so there is nowhere to write a height into. AcceptingHeight: nwould mean inventing a key the platform does not have, and it would be silently discarded.The reporter's own aside — "Height values are determined by Studio Pro" — turns out to be the whole answer.
Why four sources, not one
generated/metamodelsays the same, but on its own it could not settle this: it is an 11.6.0 snapshot and the report was against 11.12.2, so a property added since would be invisible to it.generated/metamodel(11.6.0 snapshot)mx dump-mpron 11.13.0, two projectsmx convert -pon 11.13.0mx convertis the one that settles it: it rewrites the model through Mendix's own object model, so a property that merely had a default and was not stored would be materialised. Nothing appeared. An absent key in stored BSON proves nothing by itself — it may just be unwritten — which is why the dump alone was not enough.What this PR does instead
The reporter's actual goal (a note that does not overlap the entities below it) was reachable already, so the deliverable is an error that says which problem this is and names the levers that exist.
Both of those already work:
ALTER ENTITY … SET POSITIONmakes entity layout fully scriptable (so nothing needs nudging by hand), andWidthchanges the wrapping and therefore the height.A second branch covers any other unsupported property with the four-property statement, without the height-specific advice.
Both branches key on the
expecting {POSITION, CAPTION, WIDTH}token set, not on the word "Height". That set is unique toannotationPropertyand survivessimplifyExpectinguntouched (three tokens, no statement-start keywords). A page widget'sHeightis valid MDL, and a name-keyed hint would misfire on it —TestWidgetHeightIsNotAnnotationHintedis the control.Docs: the syntax topic's "THERE IS NO COLOUR" paragraph becomes "THERE IS NO HEIGHT, AND NO COLOUR", and
ast_annotation.gorecords the four-way measurement where the type is defined, so nobody re-derives it.Verification
gofmtclean,make check-findings884 records, 206 skill MDL blocks pass.One limit worth stating: this establishes what the model stores, not what Studio Pro's canvas draws. That the renderer derives height from caption + width follows necessarily from nothing being stored, but there is no Studio Pro here to watch it reflow.
Note on the issue
Suggest closing mendixlabs#1014 as not implementable rather than deferring it — the constraint is in the platform, so it will not change with an mxcli release. A reply is drafted and ready to post if wanted.
Generated by Claude Code