Charts docs skill: document <Source> code-block indentation convention#50098
Charts docs skill: document <Source> code-block indentation convention#50098adamwoodnz wants to merge 1 commit into
<Source> code-block indentation convention#50098Conversation
Storybook's <Source code={ `...` } /> blocks dedent the template literal
before rendering, so authoring the JSX body at column 0 causes props to
render flat against the component tag. This surfaced on CHARTS-218
(HeatmapChart PR #50065) where every heatmap doc example rendered with
flat props until the blocks were re-indented to match the other chart
docs.
Add an 'Authoring <Source> example blocks' section to the charts-docs
skill (.agents/skills/charts-docs.md) capturing the dedent gotcha, the
tabs-only body-indentation convention, an example matching the existing
bar-chart doc pattern, and a quick self-check for future authors. Also
cross-reference the convention from the in-package AI documentation
guide so authors landing there see the same guidance.
Co-authored-by: Adam Wood <adamwoodnz@users.noreply.github.com>
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
|
@claude are the new instructions clear and concise? |
|
Claude finished @adamwoodnz's task in 1m 14s —— View job Are the new instructions clear and concise? — yes, mostly. A few small notes.I read the new skill section, the cross-reference in What works well
Suggestions (all minor — nothing blocking)
Net: clear and usable as-is. Suggestion #1 is the only one I'd genuinely recommend acting on, since a reader reasoning from the stated mechanism could draw the wrong conclusion. #2 and #3 are polish. Want me to apply #1 (reword the dedent mechanism) and #2 (full path)? Just say the word and I'll push to this branch. |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
Fixes CHARTS-226.
Proposed changes
<Source>example blocks" section to thecharts-docsskill (.agents/skills/charts-docs.md) capturing:<Source code={…} />template literals..mdxfiles (the repo's pre-commit hook only formats JS/TS/JSON, so leaving.mdxalone is intentional — Prettier would introduce a tab/space mix and break the dedent).bar-chart/stories/index.docs.mdxpattern, using real tab characters.projects/js-packages/charts/docs/ai-documentation-guide.mdso authors who land in the in-package guide see the same pointer.Related product discussion/links
<Source>blocks were re-indented to match the other chart docs.Does this pull request change what data or activity we track or use?
No. Documentation-tooling change only.
Testing instructions
This PR is docs-tooling only; there is no runtime code to run.
.agents/skills/charts-docs.mdand confirm the new "Authoring<Source>example blocks" section is present and the embedded example uses real tab characters (verify withcat -A .agents/skills/charts-docs.md— indentation on the JSX body lines should show as^I).projects/js-packages/charts/docs/ai-documentation-guide.mdand confirm the new bullet under "Code Examples" references the skill section.projects/js-packages/charts/changelog/charts-docs-source-indent.Linear Issue: CHARTS-226