feat: render element:metadata_viewer + ```metadata doc fence (ADR-0051 P1)#1774
Merged
Conversation
…data doc fence (ADR-0051 P1)
The objectui half of ADR-0051 "inline metadata views in docs". A
```metadata fenced block in a doc is lifted into a live, read-only
`element:metadata_viewer` SDUI component — the same component a page
node renders, so docs and pages share one runtime.
- components: new `element:metadata_viewer` renderer (Content element,
read-only). Resolves the target live via useMetadataItem and renders
read-only projections of:
· state_machine — transition graph from a `state_machine` validation
rule (initial/final badges, field-option colors)
· flow — ordered step list; `detail: business` folds technical nodes
· permission — object-level C/R/U/D matrix
Registered in ComponentRegistry; degrades to a clear placeholder on a
missing/forbidden reference.
- plugin-markdown: dispatch ```metadata at the <pre> level (beside
```mermaid) into the SDUI component via the shared ComponentRegistry;
flat `key: value` body parser (data, not code); `metadata` added to
rehype-highlight plainText so the body is read verbatim.
Verified in browser against the app-showcase backend: task/project state
machines, a flow (technical steps folded), and a permission matrix all
render live with no console errors.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
… parser - metadata-viewer.test.tsx: renders the component via ComponentRegistry with a mocked metadata context — asserts state_machine (option labels, initial/final badges), flow (business-altitude folding of technical nodes + the hidden-count note, and detail:technical revealing them), permission (CRUD matrix), missing-rule + unknown-type degradation. - metadata-fence.test.ts: pins the flat `key: value` body contract (quote stripping, comments, colon-in-value, malformed-line skipping). Exports parseMetadataFence for the unit test. 13 tests, all green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
added a commit
to objectstack-ai/objectstack
that referenced
this pull request
Jun 16, 2026
…1951) A `doc` whose Markdown embeds four ```metadata fences — two state machines (task/project lifecycles), a flow at business altitude, and a permission matrix — demonstrating ADR-0051 inline metadata views. Compiles via the existing doc collector (the fence is valid CommonMark, not MDX); renders live once the objectui `element:metadata_viewer` (objectstack-ai/objectui#1774) is deployed. Verified end-to-end in the browser against this showcase backend. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The objectui half of ADR-0051 — "inline metadata views in docs". Pairs with framework spec PR #1942 (
element:metadata_viewerschema) and a framework showcase example.A
```metadatafenced block in adocis lifted into a live, read-onlyelement:metadata_viewerSDUI component — the same component a page node renders, so docs and pages share one runtime (no parallel renderer).Changes
components— newelement:metadata_viewerrenderer (a read-only Content element, deliberately not Interactive). Resolves the target metadata live viauseMetadataItemand renders:state_machine— transition graph from astate_machinevalidation rule (initial/final badges, field-option colors)flow— ordered step list;detail: businessfolds technical nodes (scripts, record I/O…)permission— object-level C/R/U/D matrixRegistered in
ComponentRegistry; degrades to a clear placeholder on a missing/forbidden reference.plugin-markdown— dispatch```metadataat the<pre>level (beside```mermaid) into the SDUI component through the sharedComponentRegistry. Flatkey: valuebody parser (data, not code).metadataadded torehype-highlightplainTextso the body is read verbatim.Verification (browser)
Ran the framework
app-showcasebackend (:3000) + this console dev (Vite,/apiproxied) and opened the showcase doc. All four embeds resolve live with no console errors:task_status_flow/project_status_flowstate machines — colored chips, INITIAL badge, real transitionsshowcase_reassign_wizardflow — business steps, "1 technical step hidden" noteshowcase_contributorpermission — C/R/U/D matrix🤖 Generated with Claude Code