Repository navigation
feat(docs): standardize Markdown controls with Styling - #18
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 813b694fbe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (member._type === 'tabs' || member._type === 'accordion') | ||
| return { | ||
| _key: member._key, | ||
| _type: 'raw', | ||
| markdown: docsValueToMarkdown([member] as unknown as Parameters< |
There was a problem hiding this comment.
Keep Markdown groups independent of the raw-block opt-out
When a host sets blocks={{ raw: false }} but leaves tabs or accordion enabled, this conversion still changes every legacy group into a raw block. However, enabledDocsBlocks(blocks) omits raw from the editor schema and the renderer list is filtered by the same option, so the resulting initial value contains a block type the editor has no definition or renderer for. Existing tabs and accordions therefore cannot load normally under this valid per-block configuration; use an internal group source type that remains registered, or preserve the structured group when raw is disabled.
Useful? React with 👍 / 👎.
| raw: ({ attributes: attrs, children, node, readOnly, blocks }) => ( | ||
| <div {...attrs} data-docs-editor-block="Raw Markdown"> | ||
| <Raw block={node} /> | ||
| {readOnly ? ( | ||
| <MarkdownContent markdown={node.markdown ?? ''} options={blocks} /> | ||
| ) : ( | ||
| <Raw block={node} /> | ||
| )} |
There was a problem hiding this comment.
Render only migrated group Markdown as live content
In read-only editors this now sends every existing raw block through the live Markdown parser, not just the newly migrated tab and accordion records. Raw blocks are also used to preserve literal imports, MDX examples, and unsupported source, so content such as import Nodes from '…' becomes a normal paragraph and group-like examples can become interactive controls instead of remaining source code as <Raw> previously rendered them. Use a distinct internal representation or marker for migrated groups and continue rendering ordinary raw blocks with <Raw>.
Useful? React with 👍 / 👎.
| export { renderTable } from '../components/terra/editor/docs/_Table.js'; | ||
| export { renderSections } from '../components/terra/editor/docs/_Tabs.js'; | ||
| export { TsDocs } from '../components/terra/editor/docs/_TsDocs.js'; |
There was a problem hiding this comment.
Preserve the published renderSections export in this patch release
This removes renderSections from the package root while publishing the change as version 0.4.11, even though it was a named public export and remains listed among the repository's framework entry exports. Existing JavaScript consumers importing it from @terra-symposium/docs will fail module instantiation with a missing-export error after a patch upgrade. Keep a compatibility export (it can be deprecated and unused internally), or defer the removal to a breaking release.
Useful? React with 👍 / 👎.
| function groupItemMarkdown(item: Record<string, unknown>): string { | ||
| const content = Array.isArray(item.content) ? item.content : []; | ||
| return content.length | ||
| ? docsValueToMarkdown(content as Parameters<typeof docsValueToMarkdown>[0]) | ||
| : typeof item.markdown === 'string' |
There was a problem hiding this comment.
Preserve legacy text shapes inside migrated groups
For legacy tab or accordion items whose body uses Terra's compact text form (_type: 'block' with c) or the supported paragraph/heading aliases, replacing stringifyDocBody with docsValueToMarkdown no longer produces their visible text. Those shapes fall back to typed directives; after reparsing, PortableTextBlockView only reads children, so compact blocks render empty while aliases surface as raw source. The previous serializer explicitly handled c, paragraph, and heading, so normalize these legacy shapes before the Markdown round trip or retain that serializer for group bodies.
Useful? React with 👍 / 👎.
Summary
|||[...]tabs and===[...]accordions through the shared@terra-symposium/styling/uicomponents in published pages and editor previews.0.4.11with a Changesets changelog entry.Verification
pnpm run checkpnpm run test:unit(69 passing)pnpm exec astro build --config config/astro.config.mjs && pnpm run test:browser(33 browser tests and 33 load budgets passing)pnpm run docs(15 pages built)