Skip to content

fix(pages): describe and write a layout-grid row's Visible: (mendixlabs/mxcli#1461) - #1360

Merged
ako merged 4 commits into
mainfrom
fix/1461-layoutgrid-row-visible
Oct 14, 2026
Merged

ako merged 4 commits into
mainfrom
fix/1461-layoutgrid-row-visible

Conversation

@ako

@ako ako commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Fixes mendixlabs#1461 (rows; columns have no visibility in Mendix — see below).

Problem

  • Rows: a row is built outside buildWidgetV3, pages.LayoutGridRow had no field, describe never read the setting, and the writer always wrote null. So row (Visible: …) passed check and exec and was not written.
  • Data loss (measured): on a pedapp copy with three conditional rows, describe → exec with the old binary reported "Replaced page" and all three row conditions were gone. ALTER does not lose it (it edits stored BSON). TestApp's only conditional row sits inside a pass-through timeline slot, which is why the roundtrip harness never caught this.
  • Columns: none of the 732 Studio Pro layout-grid columns in TestApp + PedApp carries visibility, while all 483 rows carry the setting; the vendored gen LayoutGridColumn has no such property. So column visibility is not a thing to write.

Fix

  • LayoutGridRow.ConditionalVisibility (sdk/pages).
  • Builder: pb.childVisibility (expression and Attr in (…) forms), now shared by buildTabPageV3 (Tab page CaptionParams and Visible: pass check and exec, then are silently not written mendixlabs/mxcli#1465) and the row builder. A top-level row keeps the condition on its wrapping container only.
  • Writer: layoutGridRowToGen writes the setting instead of null.
  • Describe: parseLayoutGridRows reuses extractConditionalSettings.
  • Check: validate_layoutgrid_column_visible.go warns MDL-WIDGET07 for Visible: on a column inside a row and points at the row or a container. The file is added to TestWidgetRuleIDsAreNotReused's list of MDL-WIDGET07 raisers.
  • Skill note in create-page/reference/widgets.md (example written as a full create page so the conformance gate parses it).

Tests

  • TestLayoutGridRow_VisibleIsWritten, TestLayoutGridRow_TopLevelRowVisibleOnContainerOnly, TestDescribe_LayoutGridRowVisible, TestCheck_LayoutGridColumnVisibleDropped
  • backend: TestLayoutGridRow_WritesConditionalVisibility

Proof by revert: each fails with its fix stubbed.

Real tools: the TestApp snippet now describes with its Visible: and re-executes as "Unchanged"; with the fix the pedapp describe → exec reports "Unchanged" instead of wiping rows. mx check on a pedapp copy with all three row forms: same error count as the same page without visibility (no new errors).

Validation

  • go test mdl/backend/modelsdk, mdl/executor, sdk/pages, mdl/conformance; roundtrip TestTestAppRoundTrip + TestPedAppRoundTrip pass, no allowlist change; go vet, gofmt, make check-findings clean
  • Not validated in Studio Pro.

Noticed, not changed

MDL-WIDGET43 ("datagrid column … $currentObject", an error) also fires on a layout-grid column with Visible: $currentObject/… — a misleading label, out of scope here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VKmbj53BC2vuUWYmgWgfQ5


Generated by Claude Code

…bs#1461)

A row is built outside buildWidgetV3, pages.LayoutGridRow had no slot, describe
never read Forms$LayoutGridRow.ConditionalVisibilitySettings and the writer left
the null default: describe -> exec DESTROYED a Studio Pro row's condition (row
always visible). Now read, printed, built (shared childVisibility with tab pages)
and written. Columns have no such property (0/732 stored): check warns MDL-WIDGET07.
Tests fail with each fix stubbed out; describe -> exec Unchanged on pedapp/TestApp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VKmbj53BC2vuUWYmgWgfQ5
…endixlabs#1461)

The conformance gate parses every MDL block in a skill; the bare
`row (…) { … }` fragment was one finding over the file's allowlist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VKmbj53BC2vuUWYmgWgfQ5
Resolve the tab-page visibility conflict with #1460 (role-based
visibility): childVisibility now also attaches Visible: roles (…), so tab
pages keep main's behaviour and layout-grid rows carry roles too (DESCRIBE
prints them since #1460, so a row would otherwise lose them on re-exec).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VKmbj53BC2vuUWYmgWgfQ5
The legacy-grid note (mendixlabs#1459) grew the file without
regenerating its "Find it fast" ranges, so `make check-skill-index` fails
on main and on every branch that merges it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VKmbj53BC2vuUWYmgWgfQ5
@ako
ako merged commit 5e1924f into main Oct 14, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DESCRIBE does not print conditional visibility on layout-grid rows and columns, so restating a page makes every row always visible

2 participants