Repository navigation
feat(tutorials): add Tabs, Card/CardGroup, Steps, Callouts and Accordion MDX components - #211
ccf-factory[bot] wants to merge 3 commits into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
🏭 Tracked by CCF Factory — view |
There was a problem hiding this comment.
ccf-review: APPROVE
3 Should-fix.
Stack (base-chain): #209 → #210 → #211
Non-blocking
- [Should-fix]
src/components/tutorials/Callout.tsx:82A callout's type reaches sighted readers only: the icon is aria-hidden and no label names the type: The icon span isaria-hidden="true"and nothing else says which of the five kinds the box is; the accent colour is the only thing that distinguishes a Tip from a Danger.titleis optional and is meant for the subject, not the kind. Docusaurus's own admonitions render the type as a visible label (Admonition/Type/Warningprints "Warning"), so the new components are quieter to a screen reader than the:::dangersyntax they replace: a reader who cannot see the accent or the icon gets a plain box. The five kinds are otherwise faithful to Docusaurus (checked innode_modules/@docusaurus/theme-classic/lib/theme/Admonition/Types.js: note, tip, info, warning, danger). Fix: Render the kind for assistive tech as well as for the eye, e.g.<span className="sr-only">{type}</span>beside the icon (or a visible label like the theme's admonitions when notitleis given), so the meaning does not rest on colour alone. (e2c1350d2801) - [Should-fix]
src/components/tutorials/Tabs.tsx:71CORE-DUP-001: Tabs' outer box, tablist div, per-tab button attributes (role,id,aria-selected,aria-controls, rovingtabIndex, focus-on-move) and their utility classes are a line-for-line copy ofCodeGroup.tsx:49-92, differing only infont-mono/text-[length:var(--ifm-code-font-size)]on the button andtabIndex={0}on the panel. The selection decisions are already shared incodeGroupTabs.mjs; the chrome is not, so a later change to one group's border, radius, shadow or ARIA attributes has to be remembered for the other, and the PR's claim that the two share one keyboard contract rests on that. The copy brings its tablist naming with it:aria-labelis the tab labels joined (tabs.map(...).join(', '), alsoCodeGroup.tsx:60), which restates what the tabs already announce and never names what the group is for; a label prop would suit both. Fix: Pull the shared shell into one internal piece (aTabRow/useTabGroupused by both CodeGroup and Tabs, with the mono styling as a prop), or note next to both that they are deliberately parallel and must change together. (7519dfb5a68a) - [Should-fix]
src/components/tutorials/cardLink.mjs:14A relative href, the link form STYLE.md tells authors to write, opens a Card in a new tab:isInternalHrefaccepts only a single leading/, sohref="./configuration.md"andhref="#evidence"fall through to<a target="_blank">. STYLE.md's Links section tells authors to link within a version with a relative path ([Configuration](./configuration.md)), and unlike a Markdown link a JSX attribute is not rewritten by Docusaurus's route-link rewriting, so what the author writes is what the component receives. A card linking to the next tutorial, written the way the style guide says, becomes a popup. The JSDoc does state the single-slash rule, so this is consistent internally; it just disagrees with the convention authors are told to follow, and the authoring guide (#208) is not in this PR. Fix: Either treat./and../(and a bare#anchor, which should not reload anything) as internal and hand them toLink, or state the root-relative requirement in the authoring guide in #208 and keepcardLink.test.mjscovering the added forms. (1ae75eee423a)
Checks
- build: the PR's
buildcheck passes at this head (yarn testthenyarn build, run 46056862977); run again locally in the review workspace: install clean, 62 tests pass,typecheckclean,buildsucceeds. - versioning:
instances.yamluntouched and still validates in the build; no*_versioned_docs/,*_versioned_sidebars/or*_versions.jsonin the diff, so no released line is edited. - i18n:
locales: ['en'], noi18n/directory, no new page and no hard-coded reader-facing string (labels come from props; icons and step numbers arearia-hidden), so no translation is left behind. - style: no
.md/.mdxpage changes, so no STYLE.md skeleton or media rule applies; the two author-facing items above are the STYLE.md surface that does. - accuracy: the diff states no setting, default, endpoint, permission, UI label, path, CLI flag or field list of a documented product, so there was nothing to read back in
api/ui/agent/a plugin repo at a tag. The claims it does make were checked in the pinned dependencies: the five admonition kinds against@docusaurus/theme-classic/lib/theme/Admonition/Types.js, none of the 15 new tag names against the theme's own MDX component keys, every--ifm-*variable used against bothinfima/dist/css/default/default.cssanddefault-dark.css, and the new utility classes in the built CSS (sm:grid-cols-1..4,z-[1],text-[var(--ifm-font-color-secondary)]→color:,shadow-[shadow:var(--ifm-global-shadow-lw)]→ a realbox-shadow).
5d98cf0 to
31d2176
Compare
9f420c3 to
89e51d5
Compare
There was a problem hiding this comment.
ccf-review: APPROVE
1 Should-fix.
Stack (base-chain): #210 → #211 → #212
Non-blocking
- [Should-fix]
src/components/tutorials/Tabs.tsx:81CORE-DUP-001: The tablist row - container classes, per-tab classes, selected/unselected states - is copied verbatim from CodeGroup.tsx into Tabs.tsx (only the keyboard logic was shared via codeGroupTabs.mjs). The two tab rows are the same visual element and must stay equal, but nothing keeps them in sync: a tweak to one (padding, radius, emphasis colour) will silently drift the other. Fix: Extract the shared pieces (the tablist/tab class strings, or a small TabRow component in src/components/tutorials) that CodeGroup and Tabs both render, the way the keyboard decisions were extracted to codeGroupTabs.mjs. (7519dfb5a68a)
Checks
- build: the PR's
buildcheck is SUCCESS on the head reviewed; at the stack headyarn install,yarn test(62 pass),yarn typecheck,yarn spellcheck(0 issues) andyarn buildalso pass locally, and tests/typecheck/spellcheck pass at this PR's head too. - i18n:
i18n.localesis['en']only and noi18n/tree exists, so the only locale is the one built; nothing half-translated; DOCS-TRANS-001 not applicable. - versioning:
instances.yamlis untouched by the stack (and validates during the build); no*_versions.jsonor*_versioned_docsfile changes, so no released line is touched and no minor line is duplicated. - style: docs-style checklist run against STYLE.md on the changed pages.
- source verification (DOCS-ACC-001): every setting, CLI command/flag, config field and path the diff adds was checked against the source repo it documents (instances.yaml) with
gh api ...?ref=<branch>; no docs page or memory was trusted.
|
No need to include a ccf-skills PR. |
There was a problem hiding this comment.
ccf-review: APPROVE
2 Should-fix.
Stack (base-chain): #210 → #211 → #212
Non-blocking
- [Should-fix]
src/components/tutorials/Tabs.tsx:81CORE-DUP-001: Tabs.tsx:71-113 and CodeGroup.tsx:50-92 render the same tablist: the same container classes, the samerole="tablist"div witharia-labelbuilt by joining the titles, the same per-buttonref/id/aria-selected/aria-controls/tabIndex/onClickand the same selected-versus-unselected classes, and both callinitialTab/clampTab/nextTab. Only the label styling differs (font-mono plus the code font size for file names). The keyboard and selection decisions were shared in codeGroupTabs.mjs precisely because they must stay equal; this markup has the same requirement and is the part that will drift first (round 1's review of #211 reported the same item and nothing changed here). Fix: Extract one TabList component (items, selected, onSelect, onKeyDown, className) that both groups render, leaving only the label class as a parameter; cover the extracted markup with the existing codeGroupTabs cases. (fd81e8133850) - [Should-fix]
src/components/tutorials/titledChildren.mjs:15A mistyped or makes its content disappear with no signal: The filter keeps only element children whosetitleis a string, which is right for the text and whitespace MDX leaves between elements, but it applies to elements too:<TabsItem title="yarn">…,<Tab title={1}>…or a stray paragraph beside the tabs is dropped, so the tab or step is simply missing on the built page.yarn buildsucceeds and nothing warns the author, on a tutorial page whose whole job is not losing a step. Fix: Tell the two cases apart: keep dropping text and whitespace children silently, but when an element child is dropped for lacking a string title, emit a console.warn in development (process.env.NODE_ENV !== 'production', naming the component and what was skipped), and cover the two branches in titledChildren.test.mjs. (eb87c752149d)
Checks and verification (round 2)
Nothing moved since round 1 (head still 89e51d5), so the checks were re-run at this head in the review workspace: yarn test 62 pass / 0 fail, yarn typecheck and yarn spellcheck clean; the PR's build check is SUCCESS at this head. No instances.yaml or *_versioned_docs/ file is touched (versioning), i18n.locales is ['en'] alone and nothing is half-translated (i18n), and the two CSS blocks follow the Infima variables the rest of custom.css uses (style). The components' own claims were checked against this repo's config and the Docusaurus 3.9.2 theme in node_modules, not against another page: the five callout types are Docusaurus's five admonitions, CardGroup cols really is 1-4 default 2, Card really routes internal hrefs through @docusaurus/Link (the repo's own convention, see src/pages/catalog.tsx:36), the Accordion is a native details, and the arrow/Home/End contract is nextTab. All sixteen names are registered in src/theme/MDXComponents/index.tsx, so "no import needed" holds.
89e51d5 to
3830c83
Compare
There was a problem hiding this comment.
ccf-review: APPROVE
2 Should-fix.
Stack (base-chain): #210 → #211 → #212
Non-blocking
- [Should-fix]
src/components/tutorials/Tabs.tsx:81CORE-DUP-001: Tabs.tsx:71-113 and CodeGroup.tsx:50-92 render the same tablist: the same container classes, the same role="tablist" div with an aria-label built by joining the titles, the same per-button ref/id/aria-selected/aria-controls/tabIndex/onClick and the same selected-versus-unselected classes, and both call initialTab/clampTab/nextTab. Only the label styling differs (font-mono plus the code font size for file names). The keyboard and selection decisions were shared in codeGroupTabs.mjs precisely because they must stay equal; this markup has the same requirement and is the part that will drift first. Reported in the previous round too; nothing changed here. Fix: Extract one TabList component (items, selected, onSelect, onKeyDown, className, labelClass) that both groups render, leaving only the label styling as a parameter; keep the existing codeGroupTabs cases covering the shared decisions. (7519dfb5a68a) - [Should-fix]
src/components/tutorials/titledChildren.mjs:15A mistyped or disappears with no signal: The filter keeps only element children whose title is a string, which is right for the text and whitespace MDX leaves between elements, but it applies to elements too: , or a stray paragraph beside the tabs is dropped, so the tab or step is simply missing on the built page. yarn build succeeds and nothing warns the author, on a tutorial component whose whole job is not losing a step. Reported in the previous round too; nothing changed here. Fix: Tell the two cases apart: keep dropping text and whitespace children silently, but when an element child is dropped for lacking a string title, emit a console.warn in development (process.env.NODE_ENV !== 'production') naming the component and what was skipped, and cover the two branches in titledChildren.test.mjs. (ebda0c167261)
Re-review at 3830c83
Nothing moved in this PR: ccfr last-review reports no new commits and no changed files since the last review (the head's sha moved only because the stack was rebased onto the fixture fix in #210).
Checks and verification
build: the PR'sbuildcheck is SUCCESS at this head; locallyyarn testis 62 pass / 0 fail,yarn typecheckandyarn spellcheckare clean, andyarn buildat the stack head succeeds with only the pre-existingvscode-languageserver-typeswarning.versioning: nothing in this diff touchesinstances.yaml,*_versioned_docs/or*_versions.json;prebuild'sgen-sidebars.mjsrevalidates the manifest on every build, and all three PRs leave released lines as released.i18n:i18n.localesis['en']alone, noi18n/directory, nothing half-translated.style: no page text in this PR; the new CSS and comments follow the Infima-variable conventions of the surroundingcustom.css.accuracy: the components' own claims were re-checked against this repo's config and the bundled Docusaurus theme innode_modules, not against another page — the five callout types are Docusaurus's five admonitions,CardGroup colsreally is 1-4 default 2, internal hrefs go through@docusaurus/Link(cardLink.mjskeeps//hostexternal), the Accordion is a nativedetails, the arrow/Home/End contract isnextTab, and all ofTabs/Tab/Card/CardGroup/Steps/Step/Callout/Note/Tip/Info/Warning/Danger/Accordion/AccordionGroupare registered insrc/theme/MDXComponents/index.tsxbesides #210's two, so the showcase page's "no import needed" holds.
Both non-blocking items are unchanged from the previous round — nothing moved in their files — and neither gates the merge.
3830c83 to
2782f55
Compare
There was a problem hiding this comment.
ccf-review: APPROVE
2 Should-fix.
Stack (base-chain): #211 → #212
Non-blocking
- [Should-fix]
src/components/tutorials/Steps.tsx:49Step numbers are hidden from screen readers while the list also loses its list semantics: The- carries Tailwind's list-none (list-style: none), which makes Safari/VoiceOver drop the list semantics of the element, and the number circle is aria-hidden="true" (line 49). A screen-reader reader of a Steps list therefore hears neither the ordering/count (VoiceOver announces neither 'list' nor 'item 3 of 5') nor the printed numbers - the one thing the component visualises. Sighted readers get the numbering; assistive-tech readers get bare titled divs. Fix: Restore list semantics with role="list" on the
- . (a1de03de2e11)
- [Should-fix]
src/components/tutorials/Tabs.tsx:80CORE-DUP-001: The tab row - group chrome ('rounded-[var(--ifm-code-border-radius)] border border-[var(--ifm-color-emphasis-300)] bg-[var(--ifm-background-surface-color)] shadow-[shadow:var(--ifm-global-shadow-lw)]'), the tablist bar classes, the button's ARIA wiring (role/id/aria-selected/aria-controls/roving tabIndex) and the selected/unselected button classes - is a near copy of CodeGroup.tsx:48-92. The keyboard decisions are already shared through codeGroupTabs.mjs, but this presentation half must now be edited twice to stay identical; a tweak to one (radius, padding, border, focus look) silently makes the two tab rows diverge. Fix: Extract the shared row into one presentational piece both groups use - e.g. an internal TabRow component (or, at minimum, shared class constants) under src/components/tutorials - so Tabs and CodeGroup render their tabs through it. The keyboard decisions stay in codeGroupTabs.mjs. (7519dfb5a68a)
- (the standard countermeasure for list-style: none) and let the number reach assistive tech: drop aria-hidden="true" from the circle, or keep it and add aria-label="Step {index + 1} of {steps.length}" on each
Closes
Closes #207 (part 3 of 4 of the Tutorials epic, #204).
Stacked on #210 (base branch
factory/stack/wi_2fa6b8bf808100304f9a/1): it builds on the Tutorials tab structure (#209) and reuses CodeGroup's tab-row pattern and keyboard helper (codeGroupTabs.mjs) and CopyBlock from #210.What
The Mintlify-style building blocks tutorials need besides code, as MDX components with no per-page import (registered through the
src/theme/MDXComponentswrapper the code blocks established):Tabs+Tab— variants of one step; click or arrow-keys/Home/End switch the panel (same keyboard contract asCodeGroup).Card+CardGroup— clickable cards; root-relativehrefnavigates through Docusaurus'sLink, anything else opens in a new tab withrel="noopener noreferrer"; responsive grid,cols1–4.Steps+Step— numbered stages joined by a line.CalloutplusNote/Tip/Info/Warning/Danger— the five Docusaurus admonition kinds; accent and icon follow the type.Accordion+AccordionGroup— details-based, so open/close works before JS loads.Styling is the site's own: Tailwind utilities over the existing Infima variables (
--ifm-color-emphasis-*, the semantic-darker/-lighttones), light and dark verified side by side; no third-party theme.Design decisions
Tabs/Stepstake<Tab>/<Step>children (Mintlify-style authoring); a shared, testedtitledChildren.mjspicks out the titled elements so both groups behave identically, and a stray child cannot half-render a group. The standalone<Tab>/<Step>still render their content.hrefdecision lives incardLink.mjs; likesnippetText.mjs/codeGroupTabs.mjs, both helpers are plain ESM covered bynode --test(new test files added to thetestscript).div(MDX hands them as<p>, which may not sit in a<span>).Verification
yarn build,yarn typecheck,yarn test(62 pass) andyarn spellcheckall pass.href/target, the five callout accents and the step line render in light and dark, zero console errors on hydration.No tutorial content and no screenshots: authoring guidance and the showcase page are #208, the last PR of the stack.