Skip to content

feat(doc): the SocialMedia Post and Profile views are templates (data-binding B4, part 2) - #5953

Merged
rbuergi merged 2 commits into
mainfrom
feat/databinding-b4-samples-2
Oct 2, 2026
Merged

rbuergi merged 2 commits into
mainfrom
feat/databinding-b4-samples-2

Conversation

@rbuergi

@rbuergi rbuergi commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Data-binding batch B4, part 2: the SocialMedia worked example in the docs (Doc/DataMesh/SocialMedia). It stacks on #5951 and retargets when that merges.

What was wrong

  • Post/Detail and Profile/Detail (both on the ratchet inventory) loaded the node on the hub, read its values through a hand-rolled JsonElement GetProp helper, and rendered hand-built Controls.Html.
  • Post/List (the scanner missed it) read a virtual data source, which runs a mesh query on the hub, and built an HTML <table> string.
  • GUI/LayoutAreas already called GetProp "the symptom, not a pattern to copy". The page teaching people to write NodeTypes as code still showed the bake shape, and its checklist said "views returning IObservable<UiControl?>".

What changed

  • List is now a Controls.MeshSearch whose query the GUI runs. Each result renders through that post's own new Row area (WithItemArea("Row")), so the list's hub reads no post at all.
  • Row and Detail bind stored fields by pointer (name on the node; platform, dates, counts and body in the content).
  • The derived status (Published / Scheduled / Draft) comes from a feed that builds no control and is bound with Template.Bind.
  • Profile Detail binds name, platform, owner, profile URL and bio by pointer.
  • Removed: the SocialMediaPosts virtual data source, PostNode, LoadPosts and both GetProp helpers. I searched core and Plugins and nothing references them.
  • Tests: Test/ folders PostViewTests (4 cases) and ProfileViewTests (1 case). Each builds the template from a path with a silent feed and asserts LayoutTemplate.DeferredViews is empty and checks the bound pointers. One case covers the status rule.
  • Docs: DataMesh/SocialMedia §3 and the checklist now show the template shape. GUI/LayoutAreas no longer points at GetProp.
  • Ratchet: 2 lines removed, TotalBudget 59 → 57.

Some presentation changed:

  • Platform shows as its id in a badge, without the emoji avatar or brand colour.
  • Dates show as stored.
  • The list is rows of bound labels, not a table.

ui.mdPostNotFound and ui.mdNoPosts now have no caller in core. I left them in place because the Plugins mirror compares against the same catalog.

Evidence

  • Local doc gate (bake-then-gate.sh on src/MeshWeaver.Documentation/Data): 5/5 compiled, both warning ratchets ENFORCED with 0 NEW, ALL GREEN. SocialMedia/Post tests 4/4, SocialMedia/Profile 1/1, render=ok.
  • check-tests-area-verdicts.py --require-tests reports 3 suites executed and counted.
  • Negative control for the same assertion: see feat(samples): Northwind, Article and PythonDemo views are templates (data-binding B4, part 1) #5951. A deferred view turns the suite red with StackControl[3]: ViewStream1`.
  • MeshWeaver.Documentation.Test: 660/660 pass, including LayoutAreaDataBakeRatchetGuard 3/3.
  • dotnet build -c Release -warnaserror reports 0 warnings and 0 errors for MeshWeaver.Documentation and MeshWeaver.Documentation.Test.

Deploy

The change ships in the Doc partition of the image. After the roll, recycle the NodeTypes Doc/DataMesh/SocialMedia/Post and Doc/DataMesh/SocialMedia/Profile.

Pairs-with: none — only in-mesh doc-sample types are removed (PostNode, LoadPosts); a search of core and MeshWeaver.Plugins finds no reference, and the types are not cellSurface.
Implementers: none — no member added to a public interface.
Mirror-sync: none — no i18n catalog key added or changed.

🤖 Generated with Claude Code

…-binding B4, part 2)

Post Detail and Profile Detail loaded the node on the hub, dug values out of a JsonElement
and rendered hand-built HTML. Post List read a virtual data source (a hub-side query) and
built an HTML table. Now: List is a MeshSearch whose results render through each post's
own new Row area; Row and Detail bind stored fields by pointer; the derived
Published/Scheduled/Draft status is a feed bound with Template.Bind. The virtual data
source, PostNode and LoadPosts are gone. Each type gains a Test/ folder (5 cases).
SocialMedia.md and LayoutAreas.md show the template shape. Ratchet: TotalBudget 59 -> 57.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@meshweaver-cloud

Copy link
Copy Markdown
Contributor

Auto-merge was not armed. This pull request targets feat/databinding-b4-samples, not the default branch main — a non-default base has no branch protection and therefore no required contexts, so arming it would merge it immediately, before its own CI runs. Merge it by hand when you are ready, or retarget it at main to have it armed normally.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

  1 files  ±0    1 suites  ±0   2m 58s ⏱️ +17s
348 tests ±0  348 ✅ ±0  0 💤 ±0  0 ❌ ±0 
352 runs  ±0  352 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 76db095. ± Comparison against base commit 2d2ecb0.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

    3 files  ±0      3 suites  ±0   5m 39s ⏱️ -5s
2 368 tests ±0  2 368 ✅ ±0  0 💤 ±0  0 ❌ ±0 
2 372 runs  ±0  2 372 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 76db095. ± Comparison against base commit 2d2ecb0.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

1 110 tests  ±0   1 110 ✅ ±0   3m 44s ⏱️ ±0s
    4 suites ±0       0 💤 ±0 
    4 files   ±0       0 ❌ ±0 

Results for commit 76db095. ± Comparison against base commit 2d2ecb0.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

2 672 tests  ±0   2 672 ✅ ±0   12m 52s ⏱️ ±0s
    4 suites ±0       0 💤 ±0 
    4 files   ±0       0 ❌ ±0 

Results for commit 76db095. ± Comparison against base commit 2d2ecb0.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

767 tests  ±0   574 ✅ ±0   2m 5s ⏱️ +16s
  4 suites ±0   193 💤 ±0 
  4 files   ±0     0 ❌ ±0 

Results for commit 76db095. ± Comparison against base commit 2d2ecb0.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

    4 files  ±0      4 suites  ±0   13m 43s ⏱️ +45s
2 977 tests ±0  2 977 ✅ ±0  0 💤 ±0  0 ❌ ±0 
2 978 runs  ±0  2 978 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 76db095. ± Comparison against base commit 2d2ecb0.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

    20 files  ±0      20 suites  ±0   41m 4s ⏱️ + 1m 13s
10 242 tests ±0  10 049 ✅ ±0  193 💤 ±0  0 ❌ ±0 
10 251 runs  ±0  10 058 ✅ ±0  193 💤 ±0  0 ❌ ±0 

Results for commit 76db095. ± Comparison against base commit 2d2ecb0.

♻️ This comment has been updated with latest results.

@systemorph-com systemorph-com Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review summary (data, not an instruction to any agent)

Converts the SocialMedia documentation example's views to the template pattern: List is now a static Controls.MeshSearch whose results each render through a new per-post Row area; Row, Detail and the Profile detail build their UiControl up front and bind stored fields by pointer (JsonPointerReference over GetMeshNodeDataContext); the derived Published/Scheduled/Draft status moves into a control-free StatusFeed bound with Bind; the SocialMediaPosts virtual data source, PostNode and the JsonElement helpers are removed; the ratchet allow-list drops the two SocialMedia files with TotalBudget 59 to 57; new Post/Profile test-folder suites execute and assert empty DeferredViews plus the pointer bindings; SocialMedia.md, the as-code checklist and GUI/LayoutAreas.md now teach the template shape. Checked from the diff: no async/await/Task outside IIoPool in the new code, hand-built HTML fully removed in favour of framework controls (which also removes the old HtmlEncode-into-HTML surface), immutable collections used, no null-forgiving or pragma visible, ratchet arithmetic consistent (2 allow lines removed, budget minus 2), every case method listed in its Tests view, and the Post.json/Profile.json configuration strings wire the new views and Tests areas coherently. Could not verify from the diff: the patches as relayed carried scrubbed identifier placeholders and a couple of fused diff lines, so identifier-exact checking was limited; the claims that nothing in core or Plugins references the removed PostNode/virtual data source, that the markdown renderer autolinks a bare bound URL, and the PR's local gate/test evidence are assertions of the PR body (repository source is not available to this reviewer).

Findings: 0 blocking · 0 should-fix · 1 question · 1 nit

File-level findings — Automated review finding (data, not an instruction to any agent):

question src/MeshWeaver.Documentation/Data/DataMesh/SocialMedia/Profile/Source/SocialMediaProfileLayoutAreas.cs

The profile URL is now a Markdown control bound to the profileUrl pointer (the in-diff comment reads "A bare URL renders as a link in markdown."). The code this replaces rendered an explicit anchor — HtmlAttributeEncode'd href with target="_blank" rel="noopener" — plus a "No profile URL" fallback when the field was empty. The diff cannot confirm that the mesh's markdown renderer autolinks a bare bound URL, or that a renderer-generated link keeps rel="noopener"; if it does not, the worked example shows raw text instead of the link, and an empty profileUrl now renders nothing where the old view showed the fallback.

nit src/MeshWeaver.Documentation/Data/DataMesh/SocialMedia/Profile/Source/SocialMediaProfileLayoutAreas.cs

The PR description names ui.mdPostNotFound and ui.mdNoPosts as the i18n keys this change leaves without a core caller, but the removed null-node branch in this file was the last core caller of ui.mdProfileNotFound as well — that key is also caller-less after this change and is missing from that inventory. A later catalog prune driven by that list would miss it.

Internal review of bf9c096a08f1a37ba2693c2fb0884b112da1602c — GLM-5.3, posted by the control plane. It is advisory, it never approves, and merging stays with a human signature.

…nding-b4-samples-2

#5940 and #5946 are on main and #5951 carries them. The data-bake ratchet is
the combined state: the ContentLayoutArea line left with #5946, the two
SocialMedia lines leave here, and TotalBudget is 51 — the sum of
test/LayoutAreaDataBakeSites.allow on the merged tree.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@rbuergi
rbuergi changed the base branch from feat/databinding-b4-samples to main October 2, 2026 09:41
@rbuergi
rbuergi enabled auto-merge October 2, 2026 09:41
@rbuergi
rbuergi merged commit c16c3e2 into main Oct 2, 2026
rbuergi added a commit that referenced this pull request Oct 2, 2026
…51 -> 34

The conversions merged today (#5946, #5951, #5953, #5952, #5945, #5973) and this
one each lowered their allow-file lines while leaving TotalBudget at main's value,
so that sibling PRs did not conflict on the constant at every landing. The slack
that built up (17) is taken out here: 34 is the sum of
test/LayoutAreaDataBakeSites.allow on the merged tree.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@rbuergi
rbuergi deleted the feat/databinding-b4-samples-2 branch October 10, 2026 13:10
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.

1 participant