Repository navigation
feat(doc): the SocialMedia Post and Profile views are templates (data-binding B4, part 2) - #5953
Conversation
…-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>
|
Auto-merge was not armed. This pull request targets |
There was a problem hiding this comment.
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>
…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>
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/DetailandProfile/Detail(both on the ratchet inventory) loaded the node on the hub, read its values through a hand-rolledJsonElementGetProphelper, and rendered hand-builtControls.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/LayoutAreasalready calledGetProp"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 returningIObservable<UiControl?>".What changed
Controls.MeshSearchwhose 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.nameon the node;platform, dates, counts andbodyin the content).Template.Bind.SocialMediaPostsvirtual data source,PostNode,LoadPostsand bothGetProphelpers. I searched core and Plugins and nothing references them.Test/foldersPostViewTests(4 cases) andProfileViewTests(1 case). Each builds the template from a path with a silent feed and assertsLayoutTemplate.DeferredViewsis empty and checks the bound pointers. One case covers the status rule.DataMesh/SocialMedia§3 and the checklist now show the template shape.GUI/LayoutAreasno longer points atGetProp.TotalBudget59 → 57.Some presentation changed:
ui.mdPostNotFoundandui.mdNoPostsnow have no caller in core. I left them in place because the Plugins mirror compares against the same catalog.Evidence
bake-then-gate.shonsrc/MeshWeaver.Documentation/Data): 5/5 compiled, both warning ratchets ENFORCED with 0 NEW, ALL GREEN.SocialMedia/Posttests 4/4,SocialMedia/Profile1/1, render=ok.check-tests-area-verdicts.py --require-testsreports 3 suites executed and counted.StackControl[3]: ViewStream1`.MeshWeaver.Documentation.Test: 660/660 pass, includingLayoutAreaDataBakeRatchetGuard3/3.dotnet build -c Release -warnaserrorreports 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/PostandDoc/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 notcellSurface.Implementers: none — no member added to a public interface.
Mirror-sync: none — no i18n catalog key added or changed.
🤖 Generated with Claude Code