docs(swc): convert 2nd-gen pattern and controller story JSDoc to per-unit MDX#6351
docs(swc): convert 2nd-gen pattern and controller story JSDoc to per-unit MDX#6351caseyisonit wants to merge 26 commits into
Conversation
Introduce two genre-aware Storybook doc blocks that own the standard top
and bottom of every per-unit docs page. Components, patterns, and
controllers compose a page as:
<Meta of={Stories} />
<DocsHeader />
...prose + Canvas references...
<DocsFooter />
DocsHeader renders Title, StatusBadge, Subtitle, Description, the overview
story, and getting-started instructions. DocsFooter renders the API
section (skipping ApiTable for tag='controller'), Primary, Controls,
optional custom API stories, and the feedback link.
Rewrite DocumentTemplate.mdx in terms of the new blocks so the
template-driven docs page and the forthcoming per-unit MDX pages share
the exact same chrome with no duplicate boilerplate to drift.
Also adds research.md documenting the broader conversion plan.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
….mdx Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Auto-generated by update-nav.js for newly added migration analysis docs (action-button, button-group, close-button, grid, infield-button, link migration plan, popover migration plan, changelog strategy guide). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
….mdx Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…roup-navigation-controller.mdx Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
📚 Branch Preview Links🔍 First Generation Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
…patterns # Conflicts: # 2nd-gen/packages/swc/components/tabs/tabs.mdx
rise-erpelding
left a comment
There was a problem hiding this comment.
This one is looking pretty good also! Would love a response about the controller docs and a tiny change there before approving but otherwise, once we rebase with the previous PR, this should be good to go!
There was a problem hiding this comment.
This should go away on its own once the .gitignore changes from the other branch are in!
There was a problem hiding this comment.
this should have been removed with the merge from main but ill make sure its gone before this merges.
There was a problem hiding this comment.
Hey, is this doc set to only be visible in Storybook when run locally? I don't see it in the preview build, just local. Do we want to surface this to consumers at some point?
There was a problem hiding this comment.
yeah this is an internal doc. i think thats a larger discussion down the road about core and when and what we expose. for the scope of this work i didnt change any architecture.
| - [Keyboard navigation inside components (APG)](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#keyboardnavigationinsidecomponents) | ||
| - [Focusgroup explainer (Open UI)](https://open-ui.org/components/scoped-focusgroup.explainer/) | ||
|
|
||
| <DocsFooter /> |
There was a problem hiding this comment.
ahh i just need to move the API header in to the conditional render so if its not a component footer then the table is left out.
|
|
||
| <Meta of={ConversationThreadStories} /> | ||
|
|
||
| <DocsHeader /> |
There was a problem hiding this comment.
I wonder if a follow-up ticket to refine these conv AI stories would be helpful here - now that we're using mdx, we have a bit more freedom in the way these components get documented, is there anything we would want to change?
Maybe it's not necessary though? Just a thought, maybe @aramos-adobe has thoughts here.
There was a problem hiding this comment.
yes i totally 100% agree with this, this feels like its own initiative and touches on the team sync convo we need to have about "what are patterns and how do we approach them structuraly"
| export const Playground: Story = { | ||
| render: renderThread, | ||
| tags: ['autodocs', 'dev'], | ||
| tags: ['dev'], |
There was a problem hiding this comment.
We weren't supposed to have autodocs tagged on Playground stories, right? So we've trimmed that story from all the docs pages for Conv AI?
There was a problem hiding this comment.
Correct, the autodocs tag will trigger Storybook's internal mechanism that will use DocumentTemplate over the MDX, so we remove this so MDX wins. dev will make sure it's exposed in the sidebar.

Description
Follow-up to PR #6349 (components). Move long-form documentation that previously lived as JSDoc comments above story exports in
.stories.tsfiles into per-unit MDX files at each unit's root, for the remaining 2nd-gen genres: conversational AI patterns and the focusgroup navigation controller.Scope (this PR): 11 patterns + 1 controller.
2nd-gen/packages/swc/patterns/conversational-ai/<name>/<name>.mdx):2nd-gen/packages/core/controllers/focusgroup-navigation-controller/focusgroup-navigation-controller.mdx):DocsFooter, which auto-omits<ApiTable />(controllers expose a TypeScript class, not a custom element manifest) and renders a hand-authored## APIsection instead.This branch is based on
caseyisonit/docs-to-mdx. Merge that PR first; this PR contains pattern + controller changes only.Motivation and context
Same as PR #6349: story-level JSDoc was the only mechanism for long-form prose attached to each story, which forced documentation-only stories (
tags: ['description-only']) andsection-orderparameters to influence rendering order. Per-unit MDX provides:<Canvas of={Story} />references.Usage,API,Accessibility,Appendixprose).DocsHeader/DocsFooterblocks shipped in PR docs(swc): convert 2nd-gen component story JSDoc to per-component MDX #6349 — no new infrastructure.Related issue(s)
Screenshots (if appropriate)
Visual parity verified by spot-checking
system-message,conversation-thread, and thefocusgroup-navigation-controllerDocs pages against the template-driven rendering.Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Per-pattern Docs pages render via MDX
yarn storybookin2nd-gen/packages/swc//docs/patterns-conversational-ai-system-message--docs,patterns-conversational-ai-suggestion-item--docs,patterns-conversational-ai-conversation-turn--docs,patterns-conversational-ai-message-sources--docs,patterns-conversational-ai-upload-artifact--docs,patterns-conversational-ai-user-message--docs,patterns-conversational-ai-suggestion-group--docs,patterns-conversational-ai-message-feedback--docs,patterns-conversational-ai-response-status--docs,patterns-conversational-ai-prompt-field--docs,patterns-conversational-ai-conversation-thread--docsController Docs page omits
<ApiTable />/docs/core-controllers-focus-group-navigation-controller--docs## What it does,## Basic usage,## Behaviors,## Accessibility,## API(hand-authored table — no auto-generatedApiTable),## Appendix, and<Primary />/<Controls />from the playground. Confirm the Behaviors stories render correctly (HorizontalToolbar, BothAxesLinear, VerticalMenu, SkipDisabledMenu, Grid, ProgrammaticFocus, TextPrefixFocus).No regressions in untagged stories
conversation-thread'sFullPatternstory (no section tag) is not surfaced on the Docs page; it remains an opt-in story export.Device review
Accessibility testing checklist
Required: Complete each applicable item and document your testing steps.
Keyboard (required — document steps below)
<Canvas>(form controls, prompt-field textarea, suggestion buttons, focus-group toolbar items, etc.).<Canvas>regions.Screen reader (required — document steps below)
hideTitle=falsesections like Options/Behaviors), h4/h5 (JSDoc-derived subsections).