rusackas opened a new pull request, #37502:
URL: https://github.com/apache/superset/pull/37502
### SUMMARY
Federates Storybook component stories into auto-generated MDX documentation
pages for the Developer Portal. Stories serve as the **single source of truth**
— the generator extracts props, controls, and examples from story metadata to
produce interactive documentation.
**Key changes across multiple commits on this branch:**
**Generator (`docs/scripts/generate-superset-components.mjs`):**
- Extracts `staticProps`, `sampleChildren`, `renderComponent`,
`triggerProp`/`onHideProp`, `liveExample`, and `examples` from story
`parameters.docs`
- Generates interactive `<StoryWithControls>` Live Example sections with
prop controls
- Generates `tsx live` code blocks for Try It and additional examples
- Produces Props tables, Import sections, and "Improve this page" links back
to story source
- Fixes false-positive shorthand `options` detection in description text
**StorybookWrapper (`docs/src/components/StorybookWrapper.jsx`):**
- `StoryWithControls` renders components with interactive controls (boolean,
text, number, select, radio, color)
- Supports `sampleChildren` for layout components, `renderComponent` for
namespace components (Icons)
- Supports `triggerProp`/`onHideProp` for components like Modal that need a
trigger button
- Skips `extractChildren` when `sampleChildren` is explicitly provided
(fixes Popover/Tooltip content handling)
**Story migrations (10 components fixed in latest commit):**
- **Menu**: `staticProps` for items array, vertical menu and icon examples
- **Modal**: `triggerProp`/`onHideProp` pattern prevents auto-open on page
load
- **ModalTrigger**: Fixed nested button issue in triggerNode
- **Popover**: `sampleChildren` for Button trigger, content stays as prop
- **ProgressBar**: Inlined args (removed spread refs), all controls with
descriptions
- **Select**: Restructured to CSF2, `staticProps` for options, fixed garbled
controls
- **Slider**: Range slider, marks, dots, vertical examples
- **Steps**: `staticProps` for items array, vertical/status/dot examples
- **Switch**: Title tooltip properly demonstrated, settings panel example
- **TableView**: `staticProps` for columns/data (fixes crash), matching
Storybook data
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — documentation-only changes, best reviewed by running the docs dev
server.
### TESTING INSTRUCTIONS
1. `cd docs && npm start` to run the Docusaurus dev server
2. Navigate to Developer Portal > Components and verify:
- Each component page has a working Live Example with interactive controls
- "Try It" live code editors render and are editable
- Additional examples render correctly
- Props tables show descriptions
3. Verify Storybook still works: `cd superset-frontend && npm run storybook`
4. Run the generator: `cd docs && node
scripts/generate-superset-components.mjs`
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [x] Introduces new feature or API
- [ ] Removes existing feature or API
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]