feat: Revise tab renderers#3
Merged
Merged
Conversation
FormatTabs renders `content` byte-for-byte and does no conversion, pretty-printing, or validation — those are the consumer's job. Make that explicit so the common misuses (a flat compact-OSCAL line, a missing raw YAML tab, expecting the component to validate) don't read as renderer bugs. - README: state that `content` is verbatim; show the pretty-print idiom (`JSON.stringify(JSON.parse(x), null, 2)`), the raw-YAML-is-free tip, and that validation lives upstream in go-gemara/the spec; point at the example. - examples/astro: add a MultiFormatViewer island (Preview + raw YAML + pre-converted OSCAL). The wrapper composes FormatTabs inside React because a rendered `preview` node can't cross Astro's island boundary as a prop. - examples/astro: commit a real OSCAL projection generated by go-gemara's oscalexport as a fixture, read via a `?raw` import. No changes to the component. Signed-off-by: Eddie Knight <knight@linux.com>
Round out the example's raw-format trio (it had YAML + OSCAL; Markdown was missing). FormatTabs already handled it — the gap was only in the example. - MultiFormatViewer: add a `markdown` prop and a Markdown code tab. - index.astro: `?raw` import of the new fixture, passed in. - Commit a real Markdown projection generated by go-gemara's `ControlCatalog(c).ToMarkdown` (no CLI exists, so via a one-off program). Signed-off-by: Eddie Knight <knight@linux.com>
Wrap each entry's outbound mapping sections in a collapsed-by-default "References to Other Documents" disclosure, across all three mapping-bearing renderers: ControlCatalog (guidelines + threats), ThreatCatalog (capabilities + vectors), GuidanceCatalog (principles). Implemented as an uncontrolled native <details>/<summary> so the renderers stay server-component-clean — no useState, no "use client" (unlike CollapsibleGroup, whose state is the only reason it lives in /interactive). Consumers style the open/closed states via the native details[open] selector. The existing data-gemara-part="mappings" sections are unchanged, just nested inside the new data-gemara-part="references" element (with "references-summary" on the <summary>), so existing CSS selectors keep working. - Add per-renderer References wrapper + expose it on each compound API. - Tests: assert the details exists, is collapsed by default, has the summary label, and wraps the mapping sections. - README + CLAUDE.md: document the new data-gemara-part values. Signed-off-by: Eddie Knight <knight@linux.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.
No description provided.