Skip to content

feat(tutorials): add Tabs, Card/CardGroup, Steps, Callouts and Accordion MDX components - #211

Open
ccf-factory[bot] wants to merge 3 commits into
mainfrom
factory/stack/wi_2fa6b8bf808100304f9a/2
Open

ccf-factory[bot] wants to merge 3 commits into
mainfrom
factory/stack/wi_2fa6b8bf808100304f9a/2

Conversation

@ccf-factory

@ccf-factory ccf-factory Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

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/MDXComponents wrapper the code blocks established):

  • Tabs + Tab — variants of one step; click or arrow-keys/Home/End switch the panel (same keyboard contract as CodeGroup).
  • Card + CardGroup — clickable cards; root-relative href navigates through Docusaurus's Link, anything else opens in a new tab with rel="noopener noreferrer"; responsive grid, cols 1–4.
  • Steps + Step — numbered stages joined by a line.
  • Callout plus Note/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/-light tones), light and dark verified side by side; no third-party theme.

Design decisions

  • Tabs/Steps take <Tab>/<Step> children (Mintlify-style authoring); a shared, tested titledChildren.mjs picks 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.
  • The internal-vs-external href decision lives in cardLink.mjs; like snippetText.mjs/codeGroupTabs.mjs, both helpers are plain ESM covered by node --test (new test files added to the test script).
  • Card descriptions render children in a div (MDX hands them as <p>, which may not sit in a <span>).

Verification

  • yarn build, yarn typecheck, yarn test (62 pass) and yarn spellcheck all pass.
  • Behaviour was checked headlessly against a production build served locally with a temporary scratch page (not committed): tabs switch on click and arrow keys, accordions open/close, cards produce the right 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.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 134c6492-abc6-4c05-8dcf-9f1f01787654

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ccf-factory

ccf-factory Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

🏭 Tracked by CCF Factory — view

@ccf-factory-reviewer ccf-factory-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ccf-review: APPROVE

3 Should-fix.

Stack (base-chain): #209 → #210 → #211

Non-blocking

  • [Should-fix] src/components/tutorials/Callout.tsx:82 A callout's type reaches sighted readers only: the icon is aria-hidden and no label names the type: The icon span is aria-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. title is optional and is meant for the subject, not the kind. Docusaurus's own admonitions render the type as a visible label (Admonition/Type/Warning prints "Warning"), so the new components are quieter to a screen reader than the :::danger syntax 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 in node_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 no title is given), so the meaning does not rest on colour alone. (e2c1350d2801)
  • [Should-fix] src/components/tutorials/Tabs.tsx:71 CORE-DUP-001: Tabs' outer box, tablist div, per-tab button attributes (role, id, aria-selected, aria-controls, roving tabIndex, focus-on-move) and their utility classes are a line-for-line copy of CodeGroup.tsx:49-92, differing only in font-mono/text-[length:var(--ifm-code-font-size)] on the button and tabIndex={0} on the panel. The selection decisions are already shared in codeGroupTabs.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-label is the tab labels joined (tabs.map(...).join(', '), also CodeGroup.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 (a TabRow/useTabGroup used 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:14 A relative href, the link form STYLE.md tells authors to write, opens a Card in a new tab: isInternalHref accepts only a single leading /, so href="./configuration.md" and href="#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 to Link, or state the root-relative requirement in the authoring guide in #208 and keep cardLink.test.mjs covering the added forms. (1ae75eee423a)

Checks

  • build: the PR's build check passes at this head (yarn test then yarn build, run 46056862977); run again locally in the review workspace: install clean, 62 tests pass, typecheck clean, build succeeds.
  • versioning: instances.yaml untouched and still validates in the build; no *_versioned_docs/, *_versioned_sidebars/ or *_versions.json in the diff, so no released line is edited.
  • i18n: locales: ['en'], no i18n/ directory, no new page and no hard-coded reader-facing string (labels come from props; icons and step numbers are aria-hidden), so no translation is left behind.
  • style: no .md/.mdx page 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 both infima/dist/css/default/default.css and default-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 real box-shadow).

@ccf-factory-reviewer ccf-factory-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ccf-review: APPROVE

1 Should-fix.

Stack (base-chain): #210 → #211 → #212

Non-blocking

  • [Should-fix] src/components/tutorials/Tabs.tsx:81 CORE-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 build check is SUCCESS on the head reviewed; at the stack head yarn install, yarn test (62 pass), yarn typecheck, yarn spellcheck (0 issues) and yarn build also pass locally, and tests/typecheck/spellcheck pass at this PR's head too.
  • i18n: i18n.locales is ['en'] only and no i18n/ tree exists, so the only locale is the one built; nothing half-translated; DOCS-TRANS-001 not applicable.
  • versioning: instances.yaml is untouched by the stack (and validates during the build); no *_versions.json or *_versioned_docs file 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.

@gusfcarvalho

Copy link
Copy Markdown
Contributor

No need to include a ccf-skills PR.

@ccf-factory-reviewer ccf-factory-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ccf-review: APPROVE

2 Should-fix.

Stack (base-chain): #210 → #211 → #212

Non-blocking

  • [Should-fix] src/components/tutorials/Tabs.tsx:81 CORE-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 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 (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:15 A mistyped or makes its content disappear 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: <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 build succeeds 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.

@ccf-factory
ccf-factory Bot force-pushed the factory/stack/wi_2fa6b8bf808100304f9a/2 branch from 89e51d5 to 3830c83 Compare November 28, 2026 12:48

@ccf-factory-reviewer ccf-factory-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ccf-review: APPROVE

2 Should-fix.

Stack (base-chain): #210 → #211 → #212

Non-blocking

  • [Should-fix] src/components/tutorials/Tabs.tsx:81 CORE-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:15 A 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's build check is SUCCESS at this head; locally yarn test is 62 pass / 0 fail, yarn typecheck and yarn spellcheck are clean, and yarn build at the stack head succeeds with only the pre-existing vscode-languageserver-types warning.
  • versioning: nothing in this diff touches instances.yaml, *_versioned_docs/ or *_versions.json; prebuild's gen-sidebars.mjs revalidates the manifest on every build, and all three PRs leave released lines as released.
  • i18n: i18n.locales is ['en'] alone, no i18n/ directory, nothing half-translated.
  • style: no page text in this PR; the new CSS and comments follow the Infima-variable conventions of the surrounding custom.css.
  • accuracy: the components' own claims were re-checked against this repo's config and the bundled Docusaurus 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, internal hrefs go through @docusaurus/Link (cardLink.mjs keeps //host external), the Accordion is a native details, the arrow/Home/End contract is nextTab, and all of Tabs/Tab/Card/CardGroup/Steps/Step/Callout/Note/Tip/Info/Warning/Danger/Accordion/AccordionGroup are registered in src/theme/MDXComponents/index.tsx besides #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.

@ccf-factory-reviewer
ccf-factory-reviewer Bot changed the base branch from factory/stack/wi_2fa6b8bf808100304f9a/1 to main November 28, 2026 13:19
@ccf-factory-reviewer
ccf-factory-reviewer Bot force-pushed the factory/stack/wi_2fa6b8bf808100304f9a/2 branch from 3830c83 to 2782f55 Compare November 28, 2026 13:19

@ccf-factory-reviewer ccf-factory-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ccf-review: APPROVE

2 Should-fix.

Stack (base-chain): #211 → #212

Non-blocking

  • [Should-fix] src/components/tutorials/Steps.tsx:49 Step 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
        (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
      1. . (a1de03de2e11)
      2. [Should-fix] src/components/tutorials/Tabs.tsx:80 CORE-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)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Mintlify-style MDX components for tutorial pages

1 participant