Skip to content

feat(docs): c15t MDX compatibility for callouts, sections, details#9

Merged
KayleeWilliams merged 4 commits into
mainfrom
KayleeWilliams/docs-widgets
Apr 27, 2026
Merged

feat(docs): c15t MDX compatibility for callouts, sections, details#9
KayleeWilliams merged 4 commits into
mainfrom
KayleeWilliams/docs-widgets

Conversation

@KayleeWilliams
Copy link
Copy Markdown
Collaborator

Summary

Makes @inth/docs a drop-in target for Fumadocs-style MDX (used by c15t) without forking. Adds three remark plugins (section unwrap, details flatten, JSX-comment strip), accepts <Callout type="warn"|"note"> aliases, gives PackageCommandTabs a mode prop, gives Tabs a groupId, and adds icon/variant props on Card. Extracts COMMANDS and resolvePackageCommand to internal/ so the React component and the remark plugin share one source of truth, and fixes a unist-util-visit splice-resume bug that previously skipped nested <section> wrappers and adjacent JSX comments.

Test plan

  • bun x tsc --noEmit clean
  • bun x ultracite check src clean (53 files)
  • bun x vitest run — 50/50 tests (14 new)
  • bun run build clean
  • apps/docs-smoke real-content test against c15t fixture: 200/200 .mdx → .md

Make @inth/docs a drop-in target for Fumadocs-style MDX (used by c15t)
without forking. Adds three remark plugins (section unwrap, details
flatten, JSX-comment strip), accepts <Callout type="warn"|"note">
aliases, gives PackageCommandTabs a `mode` prop, gives Tabs a `groupId`,
adds icon/variant props on Card. Extracts COMMANDS and resolveCommand to
internal/ so component and remark plugin share one source of truth, and
fixes a unist-util-visit splice-resume bug that previously skipped
nested <section> wrappers and adjacent JSX comments.

Tests: 14 new (logic + edge cases). Smoke pipeline against the c15t
fixture passes (200/200 .mdx → .md).
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d8deb474-55d3-4e5f-ba01-a43cb5685e96

📥 Commits

Reviewing files that changed from the base of the PR and between 7d35cf4 and c7d0e46.

📒 Files selected for processing (1)
  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Prefer unknown over any when the type is genuinely unknown
Use const assertions (as const) for immutable values and literal types
Leverage TypeScript's type narrowing instead of type assertions

Files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use meaningful variable names instead of magic numbers - extract constants with descriptive names
Use arrow functions for callbacks and short functions
Prefer for...of loops over .forEach() and indexed for loops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Use const by default, let only when reassignment is needed, never var
Always await promises in async functions - don't forget to use the return value
Use async/await syntax instead of promise chains for better readability
Handle errors appropriately in async code with try-catch blocks
Don't use async functions as Promise executors
Remove console.log, debugger, and alert statements from production code
Throw Error objects with descriptive messages, not strings or other values
Use try-catch blocks meaningfully - don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Don't use eval() or assign directly to document.cookie
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Use descriptive names for functions, variables, and types for meaningful naming
Add comments for complex logic, but prefer self-documenting code

Files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{jsx,tsx}: Use function components over class components in React
Call hooks at the top level only, never conditionally
Specify all dependencies in hook dependency arrays correctly
Use the key prop for elements in iterables (prefer unique IDs over array indices)
Nest children between opening and closing tags instead of passing as props
Don't define components inside other components
Avoid dangerouslySetInnerHTML unless absolutely necessary
Use proper image components (e.g., Next.js <Image>) over <img> tags
Use Next.js <Image> component for images
Use next/head or App Router metadata API for head elements in Next.js
Use Server Components for async data fetching instead of async Client Components in Next.js
Use ref as a prop instead of React.forwardRef in React 19+

Files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
**/*.{jsx,tsx,html}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{jsx,tsx,html}: Use semantic HTML and ARIA attributes for accessibility: provide meaningful alt text for images, use proper heading hierarchy, add labels for form inputs, include keyboard event handlers alongside mouse events, use semantic elements instead of divs with roles
Add rel="noopener" when using target="_blank" on links

Files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-01-31T11:24:55.220Z
Learning: Applies to apps/docs/**/*.mdx : Include code examples where appropriate in MDX documentation pages of the docs app
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Keep documentation organized by categories
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Use MDX for documentation pages
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-01-31T11:24:55.220Z
Learning: Applies to apps/docs/**/*.mdx : Use MDX for documentation pages in the docs app
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Include code examples where appropriate in documentation
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Ensure all ARIA properties (`aria-*`) are valid

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Make sure ARIA properties are valid for the element's supported roles

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/use*.{ts,tsx,js,jsx} : Create context using `createContext` and access it with custom hooks, throwing errors if context is missing

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Create dedicated hooks for context access with proper error boundaries and clear error messages for context misuse

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/use*.{ts,tsx,js,jsx} : Create dedicated hooks for context access in components

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/*.{tsx,jsx} : Use React Context for global state management in components

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/use*.{ts,tsx,js,jsx} : Provide clear error messages for misuse of context in hooks

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
🔍 Remote MCP Context7

Summary of additional concrete facts useful for reviewing the PR

  • unist-util-visit library resolved as /syntax-tree/unist-util-visit.
  • The visit API provides visitor(node, index, parent) and permits in-place mutation of parent.children (e.g., parent.children.splice(index, ...)). Returning the current index (or otherwise managing the index) is a valid pattern to ensure re-visiting the same position after replacement/removal. The package also documents traversal control constants CONTINUE, EXIT, and SKIP for finer control. These facts validate the splice-and-return-index approach used by remarkSectionToMarkdown and remarkRemoveJsxComments.
  • Attempted to fetch the unist-util-visit README for direct quoting, but the Context7 docs query hit a monthly quota limit (no README text returned). The resolved library ID is available and the API facts above were obtained via the Context7 resolution step and prior research.

Relevant links / provenance

  • Library resolution call: Context7 resolver returned /syntax-tree/unist-util-visit.
  • Docs fetch attempt (quota reached): Context7 query returned a rate-limit notice.

Notes for reviewers (concise)

  • The visitor/index/parent splice-and-return-index pattern in the new plugins matches supported usage of unist-util-visit and is therefore acceptable (but keep an eye on index/resume correctness in deeply nested or adjacent-removal cases).
  • Because Context7 doc fetch hit quota, if you want direct README excerpts or exact code examples from unist-util-visit, I can retry the Context7 query later or you can provide permission to use other sources.
🔇 Additional comments (4)
apps/docs-smoke/src/components/docs-mdx/tabs.tsx (4)

21-22: Good extraction of ID normalization patterns.

Pulling these regexes into named constants improves clarity and keeps normalization behavior easy to audit.


36-55: groupId resolution is now defensively implemented.

Runtime type narrowing plus normalized fallback handling here is solid and prevents invalid IDs from leaking into DOM/ARIA attributes.


73-79: Clear groupId contract documentation.

The uniqueness warning and SSR intent are clearly spelled out, which should reduce integration mistakes.


83-93: Clean integration of resolved groupId into Tabs.

This wiring keeps ID/ARIA derivation consistent across the component tree and preserves SSR-friendly behavior.


📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added "note" and "tip" callout variants; "warn" now an alias for "warning"
    • Card component supports variants and optional icons
    • Tabs accepts optional groupId for stable ID/aria generation
    • Markdown processing improved: JSX comments stripped,
      wrappers unwrapped, and
      Details converted into markdown headings/content

Walkthrough

This PR adds three remark transformers (remove JSX comments, unwrap sections, convert details to markdown), integrates them into the remark plugin pipeline with specific ordering, extends callout aliases, updates Callout/Card/Tabs component APIs, and expands remark output tests.

Changes

Cohort / File(s) Summary
Remark entrypoint
packages/docs/src/remark/index.ts
Added remarkRemoveJsxComments, remarkSectionToMarkdown, remarkDetailsToMarkdown to defaultRemarkPlugins with explicit ordering; removed several explicit re-exports, retaining remarkInclude and defaultRemarkPlugins.
New remark transformers
packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts, packages/docs/src/remark/plugins/section.remark.ts, packages/docs/src/remark/plugins/details.remark.ts
Introduces three exported transformers: strip MDX JSX comments (/*...*/), unwrap <section> elements by replacing them with their children, and convert <details> blocks into markdown (extract summary → h3, retain body).
Callout plugin & UI
packages/docs/src/remark/plugins/callout.remark.ts, apps/docs-smoke/src/components/docs-mdx/callout.tsx
Callout parsing now recognizes warnwarning and explicit note; UI Callout updated to accept note and tip, adds deprecated type alias and variant normalization.
Card & Tabs components
apps/docs-smoke/src/components/docs-mdx/card.tsx, apps/docs-smoke/src/components/docs-mdx/tabs.tsx
Card: new icon and variant props and data-variant output; Tabs: optional groupId prop used to normalize and derive stable trigger/panel ids.
Tests
packages/docs/src/remark/remark-output.test.ts
Added tests covering callout aliases, JSX comment removal (including adjacent comments), <section> unwrapping (incl. nested), and <details> → heading conversions (summary extraction and fallbacks).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

Hoppity-hop, I nibble code and cheer, 🐇
I peel off sections, hush comments disappear,
Summaries bloom as headings bright,
Callouts wag their variants right,
Icons, tabs, and cards — a joyful sight! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.85% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: adding MDX compatibility features (callouts with type aliases, section unwrapping, details flattening) for c15t Fumadocs-style content.
Description check ✅ Passed The description comprehensively explains the changes across all modified files, including remark plugins, component updates, internal refactoring, and bug fixes mentioned in the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/docs/src/components/tabs.tsx`:
- Around line 63-70: The providedGroupId may be an empty or whitespace-only
string and currently bypasses the fallback because of the nullish coalescing;
update the Tabs component to trim and validate providedGroupId before using it
so only a non-empty trimmed string overrides generatedGroupId. Specifically, in
the function where providedGroupId, generatedGroupId and groupId are defined
(symbols: providedGroupId, generatedGroupId, groupId in the Tabs component),
compute a safeGroupId by doing something like const safeProvided = typeof
providedGroupId === "string" ? providedGroupId.trim() : "" and then set groupId
= safeProvided !== "" ? safeProvided : generatedGroupId; ensure any places
relying on groupId (ARIA ids, aria-controls/aria-labelledby wiring) use this
validated groupId.

In `@packages/docs/src/remark/plugins/details.remark.ts`:
- Around line 23-40: The bug: extractSummary() recognizes a paragraph whose
first child is a <summary> but toDetailsContent() currently skips that entire
paragraph and drops any trailing nodes in it. Fix toDetailsContent(): when you
detect an extractedSummary for a child that is a paragraph (node.type ===
"paragraph" and hasName(firstChild, "summary")), do not skip the whole paragraph
— remove only the summary node and if the paragraph has remaining children, push
a new paragraph (or the remaining child nodes) into content so trailing
text/nodes are preserved; otherwise if no remaining children, continue skipping.
Use the existing helpers (extractSummary, hasName, extractNodeText) and modify
the handling inside the for loop in toDetailsContent to clone/emit the paragraph
with remaining children instead of dropping it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6fdb8dec-6c49-4cdf-bec6-ea968a4a9fea

📥 Commits

Reviewing files that changed from the base of the PR and between 92f7a0f and d289d82.

📒 Files selected for processing (16)
  • packages/docs/src/components/callout.tsx
  • packages/docs/src/components/card.tsx
  • packages/docs/src/components/index.ts
  • packages/docs/src/components/package-command-tabs.tsx
  • packages/docs/src/components/tabs.tsx
  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/internal/callout-variant.ts
  • packages/docs/src/internal/package-managers.test.ts
  • packages/docs/src/internal/package-managers.ts
  • packages/docs/src/remark/index.ts
  • packages/docs/src/remark/plugins/callout.remark.ts
  • packages/docs/src/remark/plugins/details.remark.ts
  • packages/docs/src/remark/plugins/package-command-tabs.remark.ts
  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
  • packages/docs/src/remark/plugins/section.remark.ts
  • packages/docs/src/remark/remark-output.test.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Prefer unknown over any when the type is genuinely unknown
Use const assertions (as const) for immutable values and literal types
Leverage TypeScript's type narrowing instead of type assertions

Files:

  • packages/docs/src/remark/plugins/callout.remark.ts
  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/remark/plugins/details.remark.ts
  • packages/docs/src/remark/plugins/section.remark.ts
  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
  • packages/docs/src/components/index.ts
  • packages/docs/src/internal/package-managers.test.ts
  • packages/docs/src/components/card.tsx
  • packages/docs/src/remark/plugins/package-command-tabs.remark.ts
  • packages/docs/src/components/tabs.tsx
  • packages/docs/src/components/package-command-tabs.tsx
  • packages/docs/src/internal/callout-variant.ts
  • packages/docs/src/internal/package-managers.ts
  • packages/docs/src/remark/index.ts
  • packages/docs/src/components/callout.tsx
  • packages/docs/src/remark/remark-output.test.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use meaningful variable names instead of magic numbers - extract constants with descriptive names
Use arrow functions for callbacks and short functions
Prefer for...of loops over .forEach() and indexed for loops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Use const by default, let only when reassignment is needed, never var
Always await promises in async functions - don't forget to use the return value
Use async/await syntax instead of promise chains for better readability
Handle errors appropriately in async code with try-catch blocks
Don't use async functions as Promise executors
Remove console.log, debugger, and alert statements from production code
Throw Error objects with descriptive messages, not strings or other values
Use try-catch blocks meaningfully - don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Don't use eval() or assign directly to document.cookie
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Use descriptive names for functions, variables, and types for meaningful naming
Add comments for complex logic, but prefer self-documenting code

Files:

  • packages/docs/src/remark/plugins/callout.remark.ts
  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/remark/plugins/details.remark.ts
  • packages/docs/src/remark/plugins/section.remark.ts
  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
  • packages/docs/src/components/index.ts
  • packages/docs/src/internal/package-managers.test.ts
  • packages/docs/src/components/card.tsx
  • packages/docs/src/remark/plugins/package-command-tabs.remark.ts
  • packages/docs/src/components/tabs.tsx
  • packages/docs/src/components/package-command-tabs.tsx
  • packages/docs/src/internal/callout-variant.ts
  • packages/docs/src/internal/package-managers.ts
  • packages/docs/src/remark/index.ts
  • packages/docs/src/components/callout.tsx
  • packages/docs/src/remark/remark-output.test.ts
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{test,spec}.{js,ts,jsx,tsx}: Write assertions inside it() or test() blocks
Avoid done callbacks in async tests - use async/await instead
Don't use .only or .skip in committed code
Keep test suites reasonably flat - avoid excessive describe nesting

Files:

  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/internal/package-managers.test.ts
  • packages/docs/src/remark/remark-output.test.ts
**/index.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Avoid barrel files (index files that re-export everything)

Files:

  • packages/docs/src/components/index.ts
  • packages/docs/src/remark/index.ts
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{jsx,tsx}: Use function components over class components in React
Call hooks at the top level only, never conditionally
Specify all dependencies in hook dependency arrays correctly
Use the key prop for elements in iterables (prefer unique IDs over array indices)
Nest children between opening and closing tags instead of passing as props
Don't define components inside other components
Avoid dangerouslySetInnerHTML unless absolutely necessary
Use proper image components (e.g., Next.js <Image>) over <img> tags
Use Next.js <Image> component for images
Use next/head or App Router metadata API for head elements in Next.js
Use Server Components for async data fetching instead of async Client Components in Next.js
Use ref as a prop instead of React.forwardRef in React 19+

Files:

  • packages/docs/src/components/card.tsx
  • packages/docs/src/components/tabs.tsx
  • packages/docs/src/components/package-command-tabs.tsx
  • packages/docs/src/components/callout.tsx
**/*.{jsx,tsx,html}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{jsx,tsx,html}: Use semantic HTML and ARIA attributes for accessibility: provide meaningful alt text for images, use proper heading hierarchy, add labels for form inputs, include keyboard event handlers alongside mouse events, use semantic elements instead of divs with roles
Add rel="noopener" when using target="_blank" on links

Files:

  • packages/docs/src/components/card.tsx
  • packages/docs/src/components/tabs.tsx
  • packages/docs/src/components/package-command-tabs.tsx
  • packages/docs/src/components/callout.tsx
🧠 Learnings (54)
📓 Common learnings
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-01-31T11:24:55.220Z
Learning: Applies to apps/docs/**/*.mdx : Include code examples where appropriate in MDX documentation pages of the docs app
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Use MDX for documentation pages
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-01-31T11:24:55.220Z
Learning: Applies to apps/docs/**/*.mdx : Use MDX for documentation pages in the docs app
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Include code examples where appropriate in documentation
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Keep documentation organized by categories
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{test,spec}.{ts,tsx} : Write unit tests for components in Elements package using Vitest

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/internal/package-managers.test.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{test,spec}.{ts,tsx} : Test accessibility features in Elements package component tests

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/internal/package-managers.test.ts
  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.test.{ts,tsx} : Use Vitest for testing framework

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/internal/package-managers.test.ts
📚 Learning: 2026-03-19T22:58:00.031Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-03-19T22:58:00.031Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Write comprehensive unit tests with clear test case names describing what is being tested

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/internal/package-managers.test.ts
  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.test.{ts,tsx} : Test accessibility features

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/internal/package-managers.test.ts
  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx} : Include unit tests for components, integration tests for component combinations, accessibility tests, and error boundary tests

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{test,spec}.{ts,tsx} : Test error boundaries in Elements package component tests

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{test,spec}.{ts,tsx} : Use Vitest as the testing framework for Elements package

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/internal/package-managers.test.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.test.{ts,tsx} : Test error boundaries

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx} : Include integration tests for component combinations

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/*.{test,spec}.{js,jsx,ts,tsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/*.{test,spec}.{js,ts,jsx,tsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-02-20T14:21:40.180Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T14:21:40.180Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Make sure the assertion function, like expect, is placed inside an it() function call

Applied to files:

  • packages/docs/src/internal/callout-variant.test.ts
  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Use `remarks` for long-form context in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/remark/plugins/details.remark.ts
  • packages/docs/src/remark/plugins/section.remark.ts
  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
  • packages/docs/src/remark/index.ts
  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Write clear summary sentences in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/remark/plugins/details.remark.ts
  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Don't insert comments as text nodes

Applied to files:

  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Use `privateRemarks` for maintainer-only notes in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
  • packages/docs/src/remark/index.ts
  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Add comments for complex logic, but prefer self-documenting code

Applied to files:

  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Add comments for complex logic, but prefer self-documenting code

Applied to files:

  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Make sure JSDoc comment lines start with a single asterisk, except for the first one

Applied to files:

  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Include TSDoc comments for components in Elements package

Applied to files:

  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{js,jsx} : Document generator output with `yields` in JSDoc comments

Applied to files:

  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Include TSDoc comments for components

Applied to files:

  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Don't use unnecessary fragments

Applied to files:

  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Remove redundant terms from logical expressions

Applied to files:

  • packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/index.{ts,tsx} : Export type definitions for public API in Elements package

Applied to files:

  • packages/docs/src/components/index.ts
  • packages/docs/src/components/package-command-tabs.tsx
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Export type definitions for public API

Applied to files:

  • packages/docs/src/components/index.ts
  • packages/docs/src/components/package-command-tabs.tsx
  • packages/docs/src/components/callout.tsx
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Document all props and types in Elements package TypeScript code

Applied to files:

  • packages/docs/src/components/index.ts
  • packages/docs/src/components/card.tsx
  • packages/docs/src/components/package-command-tabs.tsx
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/*.{ts,tsx} : Export type definitions for public API in TypeScript libraries

Applied to files:

  • packages/docs/src/components/index.ts
  • packages/docs/src/remark/index.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Document all props and types

Applied to files:

  • packages/docs/src/components/index.ts
  • packages/docs/src/components/card.tsx
  • packages/docs/src/components/package-command-tabs.tsx
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/index.{ts,tsx} : Use `packageDocumentation` for entrypoint docs in TSDoc comments

Applied to files:

  • packages/docs/src/components/index.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Document props and usage examples

Applied to files:

  • packages/docs/src/components/index.ts
  • packages/docs/src/components/card.tsx
  • packages/docs/src/components/tabs.tsx
  • packages/docs/src/components/package-command-tabs.tsx
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{ts,tsx,md} : Include TypeScript examples in Elements package documentation

Applied to files:

  • packages/docs/src/components/index.ts
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{ts,tsx} : Export type definitions for public API and avoid TypeScript enums; use const objects or 'as const' assertions instead due to runtime overhead and tree-shaking limitations

Applied to files:

  • packages/docs/src/components/index.ts
  • packages/docs/src/components/package-command-tabs.tsx
  • packages/docs/src/internal/callout-variant.ts
  • packages/docs/src/components/callout.tsx
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Use compound components pattern in Elements package (e.g., `Component.Root`, `Component.Child`)

Applied to files:

  • packages/docs/src/components/index.ts
  • packages/docs/src/components/package-command-tabs.tsx
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{tsx,jsx} : Follow the Radix UI primitives pattern

Applied to files:

  • packages/docs/src/components/index.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `export type` for types

Applied to files:

  • packages/docs/src/components/index.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{tsx,jsx} : Use compound components pattern (e.g., `Component.Root`, `Component.Child`)

Applied to files:

  • packages/docs/src/components/index.ts
  • packages/docs/src/components/package-command-tabs.tsx
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.test.{ts,tsx} : Write unit tests for components

Applied to files:

  • packages/docs/src/internal/package-managers.test.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{test,spec}.{ts,tsx} : Include integration tests for Elements package components

Applied to files:

  • packages/docs/src/internal/package-managers.test.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.test.{ts,tsx} : Include integration tests

Applied to files:

  • packages/docs/src/internal/package-managers.test.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`

Applied to files:

  • packages/docs/src/components/tabs.tsx
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Document components with purpose and use case, required and optional props, context requirements, example usage, and common pitfalls

Applied to files:

  • packages/docs/src/components/tabs.tsx
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Document props and usage examples in Elements package components

Applied to files:

  • packages/docs/src/components/tabs.tsx
  • packages/docs/src/components/package-command-tabs.tsx
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{tsx,jsx} : Handle focus management

Applied to files:

  • packages/docs/src/components/package-command-tabs.tsx
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Handle focus management in Elements package components

Applied to files:

  • packages/docs/src/components/package-command-tabs.tsx
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{tsx,jsx} : Implement React Context for state management

Applied to files:

  • packages/docs/src/components/package-command-tabs.tsx
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement compound components pattern with components namespaced under a single parent (e.g., FormWizard.Root, FormWizard.Step), using React Context for state management

Applied to files:

  • packages/docs/src/components/package-command-tabs.tsx
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Document defaults with `defaultValue` in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2026-01-31T11:24:55.220Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-01-31T11:24:55.220Z
Learning: Applies to apps/docs/**/*.mdx : Include code examples where appropriate in MDX documentation pages of the docs app

Applied to files:

  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-03-19T22:57:19.913Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Include code examples where appropriate in documentation

Applied to files:

  • packages/docs/src/remark/remark-output.test.ts
🔍 Remote MCP

I've encountered rate limits with Context7. Let me search the web for information about the key patterns and libraries used in this PR.Based on my research, I've found valuable context about the key patterns and technologies used in this PR. Let me compile the findings for review:

Summary of Additional Context Found

unist-util-visit Splice-Resume Pattern

When mutating a tree during unist-util-visit traversal and modifying children via splice, returning the current index allows the visitor to resume at that position to handle adjacent removable nodes. This PR's mention of "fixing a unist-util-visit splice-resume bug" aligns with a documented pattern: returning the current index after deletion ensures adjacent removable comment nodes are properly processed during subsequent iterations.

The PR's implementation in remarkRemoveJsxComments and remarkSectionToMarkdown plugins correctly uses this pattern—returning the index after splice operations to ensure nested wrappers and adjacent comments are handled in a single pass rather than skipped.

Remark Plugin Architecture Best Practices

The PR follows established remark plugin conventions:

  1. Plugin Structure: A remark plugin's top-level export must be an attacher function that can accept configuration options, returning a transformer function which will receive and mutate the Markdown AST (adding/removing nodes, changing node types).

  2. AST Transformations: AST transformations work recursively—if new nodes are added, the transformer will find and transform them too, which is important to be aware of to avoid accidental infinitely deep loops.

  3. Index Preservation: To prevent infinite loops when creating/visiting nodes, use Object.assign to overwrite nodes instead of creating new ones, preserving the original index so the transformer understands it's already seen the node.

React Component Prop Deprecation Strategy

The PR's approach to deprecating the type prop in Callout while adding variant aligns with component versioning best practices:

When adding new props, render them conditionally only if they exist, ensuring older code without the new prop doesn't break. The PR uses normalizeCalloutVariant(variant, type) to explicitly handle both old and new props with clear precedence.

Backward compatibility techniques include using compatibility layers and deprecation warnings while maintaining support for older implementations—the @deprecated JSDoc marker and explicit prop resolution achieve this.

Shared Logic Extraction Pattern

The PR extracts COMMANDS and resolvePackageCommand from the plugin into packages/docs/src/internal/package-managers to enable code reuse between the React component and remark plugin. This follows the principle that remark plugins inspect and change trees via AST manipulations, and by separating core logic from presentation, you allow programs (both React components and plugins) to reuse the same utilities.


[::web_search::], [::web_search::], [::web_search::]

🔇 Additional comments (17)
packages/docs/src/components/card.tsx (1)

15-23: Solid backward-compatible Card extension.

The CardVariant typing + optional icon/variant rendering is clean and non-breaking, and the data-variant omission behavior is correctly handled.

Also applies to: 42-49

packages/docs/src/internal/callout-variant.ts (1)

21-34: Normalization utility looks correct and well-scoped.

Precedence, alias handling, and default behavior are implemented clearly and match the intended compatibility behavior.

Also applies to: 36-42

packages/docs/src/remark/plugins/callout.remark.ts (1)

38-42: Callout alias handling is correctly extended.

warn and note are mapped explicitly with expected variant/label/emoji output.

packages/docs/src/remark/plugins/package-command-tabs.remark.ts (1)

5-10: Good shared-source-of-truth refactor.

Switching to internal package-managers types/constants removes duplication and keeps plugin/component behavior aligned.

Also applies to: 22-22, 27-30

packages/docs/src/remark/plugins/remove-jsx-comments.remark.ts (1)

15-30: Splice-resume traversal fix is implemented correctly.

The guarded splice + return index pattern correctly handles adjacent JSX comment expressions in one pass.

packages/docs/src/internal/callout-variant.test.ts (1)

4-40: Great targeted unit coverage for the new callout utility.

The suite validates precedence, alias behavior, fallback defaults, and title-casing edge cases with clear cases.

packages/docs/src/remark/plugins/section.remark.ts (1)

12-26: Section unwrap transformer is correctly implemented.

The guarded splice + same-index revisit handles nested wrappers as intended, and the attribute-drop behavior is explicitly documented.

packages/docs/src/internal/package-managers.test.ts (2)

5-44: Strong resolver behavior coverage.

These tests exercise precedence, mode switching, legacy {pm} handling, and suppression behavior well.


47-55: Good invariant test for command-template completeness.

The manager/mode sweep helps prevent silent template regressions.

packages/docs/src/components/index.ts (1)

6-15: Public type exports are wired correctly.

The new aliases/mode types are surfaced from the package entrypoint in a consistent way.

Also applies to: 22-26

packages/docs/src/remark/remark-output.test.ts (2)

105-120: Alias compatibility test is well targeted.

Good coverage for type="warn" / type="note" MDX compatibility and expected markdown output.


197-316: Excellent regression coverage for tree-mutation edge cases.

These cases meaningfully protect against comment/section/details traversal regressions, including adjacent-node and nested-wrapper scenarios.

packages/docs/src/components/package-command-tabs.tsx (1)

4-14: Nice consolidation onto shared package-manager logic.

Using the internal resolver plus the new mode prop keeps UI behavior aligned with remark/plugin behavior and avoids divergence.

Also applies to: 22-22, 30-30, 34-34

packages/docs/src/components/callout.tsx (1)

2-12: Backward-compatible variant normalization is implemented cleanly.

Supporting deprecated type while normalizing to a single resolvedVariant keeps behavior consistent and easy to reason about.

Also applies to: 16-17, 29-29, 39-39

packages/docs/src/remark/index.ts (1)

6-6: Plugin wiring is coherent and complete.

The new plugins are consistently exported, imported, and included in defaultRemarkPlugins, which keeps the transformation pipeline explicit.

Also applies to: 13-14, 29-29, 34-35, 45-53

packages/docs/src/internal/package-managers.ts (1)

5-53: Good single-source-of-truth extraction for package-manager commands.

The typed command tables plus clear precedence in resolvePackageCommand make behavior deterministic across component and remark consumers.

packages/docs/src/components/tabs.tsx (1)

50-57: Clear groupId contract docs — good addition.

The new prop documentation sets expectations well (uniqueness and non-shared state), which helps prevent misuse.

Comment thread apps/docs-smoke/src/components/docs-mdx/tabs.tsx
Comment on lines +23 to +40
const [firstChild] = child.children;
if (!(firstChild && hasName(firstChild, "summary"))) {
return null;
}

const extracted = extractNodeText(firstChild.children).trim();
return extracted.length > 0 ? extracted : null;
}

function toDetailsContent(node: MdxNode): RootContent[] {
const content: RootContent[] = [];
let summaryText: string | null = null;

for (const child of node.children ?? []) {
const extractedSummary = extractSummary(child as RootContent);
if (extractedSummary) {
summaryText = extractedSummary;
continue;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Potential content loss when <summary> paragraph has extra children.

extractSummary() treats any paragraph whose first child is <summary> as a pure wrapper. Then toDetailsContent() skips the full paragraph, so trailing text/nodes in that same paragraph are dropped.

💡 Proposed safe fix
-  const [firstChild] = child.children;
-  if (!(firstChild && hasName(firstChild, "summary"))) {
+  const [firstChild] = child.children;
+  if (
+    !(
+      firstChild &&
+      child.children.length === 1 &&
+      hasName(firstChild, "summary")
+    )
+  ) {
     return null;
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const [firstChild] = child.children;
if (!(firstChild && hasName(firstChild, "summary"))) {
return null;
}
const extracted = extractNodeText(firstChild.children).trim();
return extracted.length > 0 ? extracted : null;
}
function toDetailsContent(node: MdxNode): RootContent[] {
const content: RootContent[] = [];
let summaryText: string | null = null;
for (const child of node.children ?? []) {
const extractedSummary = extractSummary(child as RootContent);
if (extractedSummary) {
summaryText = extractedSummary;
continue;
const [firstChild] = child.children;
if (
!(
firstChild &&
child.children.length === 1 &&
hasName(firstChild, "summary")
)
) {
return null;
}
const extracted = extractNodeText(firstChild.children).trim();
return extracted.length > 0 ? extracted : null;
}
function toDetailsContent(node: MdxNode): RootContent[] {
const content: RootContent[] = [];
let summaryText: string | null = null;
for (const child of node.children ?? []) {
const extractedSummary = extractSummary(child as RootContent);
if (extractedSummary) {
summaryText = extractedSummary;
continue;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/docs/src/remark/plugins/details.remark.ts` around lines 23 - 40, The
bug: extractSummary() recognizes a paragraph whose first child is a <summary>
but toDetailsContent() currently skips that entire paragraph and drops any
trailing nodes in it. Fix toDetailsContent(): when you detect an
extractedSummary for a child that is a paragraph (node.type === "paragraph" and
hasName(firstChild, "summary")), do not skip the whole paragraph — remove only
the summary node and if the paragraph has remaining children, push a new
paragraph (or the remaining child nodes) into content so trailing text/nodes are
preserved; otherwise if no remaining children, continue skipping. Use the
existing helpers (extractSummary, hasName, extractNodeText) and modify the
handling inside the for loop in toDetailsContent to clone/emit the paragraph
with remaining children instead of dropping it.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d289d829d8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +59 to +60
return createJsxComponentProcessor("details", (node) =>
toDetailsContent(node)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Revisit inserted nodes when flattening details

This transformer delegates to createJsxComponentProcessor, which replaces the current node and returns SKIP; that traversal pattern does not reprocess newly inserted siblings at the same index. With nested <details> blocks, the outer block is flattened but inner <details> nodes can remain unconverted, leaking raw MDX into generated markdown/LLM output. Use the same splice-resume pattern used in the new section/comment plugins (or recurse explicitly) so nested details are also flattened.

Useful? React with 👍 / 👎.

Comment on lines +38 to +40
if (extractedSummary) {
summaryText = extractedSummary;
continue;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve non-summary text in wrapped summary paragraphs

When a paragraph starts with <summary>, the plugin records the summary and then continues, dropping the entire paragraph. If authors write additional inline text in that same paragraph (for example <summary>Title</summary> extra), that trailing content is silently discarded from the markdown output. Keep non-summary siblings instead of discarding the whole paragraph after extracting the summary text.

Useful? React with 👍 / 👎.

Integrates main's component-ownership refactor (PR #8) and AI search
work (#5/#7). Adapts the c15t-compat changes from d289d82 onto the new
component locations under apps/docs-smoke/src/components/docs-mdx/:

  - Callout: keeps `type` alias and `warn`/`note` mapping. Inlined
    normalizeVariant/titleCase since the component now lives in the app
    (no shared internal/ helpers needed).
  - Card: keeps `icon`, `variant`, `CardVariant` type.
  - Tabs: keeps `groupId` prop with JSDoc.
  - CommandTabs: takes main's design wholesale (`mode: run|install|create`,
    discriminated union). Drops the duplicate PackageCommandTabs.

Drops `packages/docs/src/internal/{callout-variant,package-managers}.{ts,test.ts}`
since main's design has the component app-owned (with its own table)
and main's command-tabs.remark.ts is self-contained.

Keeps the new remark plugins (section, details, remove-jsx-comments) and
the warn/note alias in callout.remark.ts. Updates remark-output tests to
use the renamed convertMdxToMarkdown.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
apps/docs-smoke/src/components/docs-mdx/tabs.tsx (1)

63-70: ⚠️ Potential issue | 🟠 Major

Validate/sanitize providedGroupId before using it for ARIA/DOM ids (Line 69).

providedGroupId ?? generatedGroupId accepts empty and whitespace-only values, which can produce broken id wiring for aria-controls/aria-labelledby and fail focus handoff via document.getElementById(...).

🔧 Proposed fix
   const generatedGroupId = useId();
-  const groupId = providedGroupId ?? generatedGroupId;
+  const normalizedProvidedGroupId =
+    typeof providedGroupId === "string"
+      ? providedGroupId.trim().replace(/\s+/g, "-")
+      : "";
+  const groupId =
+    normalizedProvidedGroupId.length > 0
+      ? normalizedProvidedGroupId
+      : generatedGroupId;

As per coding guidelines, “Use semantic HTML and ARIA attributes for accessibility”.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs-smoke/src/components/docs-mdx/tabs.tsx` around lines 63 - 70, The
providedGroupId may be empty or whitespace-only and is being used directly to
build ARIA/DOM ids; update the Tabs component to validate and sanitize
providedGroupId before assigning groupId by trimming it and falling back to
generatedGroupId when the trimmed value is empty, and also normalize it to a
safe id token (e.g., replace whitespace and strip invalid characters) so the
final groupId used by the groupId variable (computed from providedGroupId and
generatedGroupId) is always a valid DOM id for aria-controls/aria-labelledby and
document.getElementById to work reliably.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/docs-smoke/src/components/docs-mdx/index.ts`:
- Around line 11-20: This barrel file is growing and should not be expanded;
remove the new re-exports from apps/docs-smoke/src/components/docs-mdx/index.ts
and have callers import the specific symbols directly from their modules (e.g.,
import CalloutTypeAlias/CalloutVariant from "./callout" and
Card/CardProps/Cards/CardsProps/CardVariant from "./card") so that import
boundaries remain explicit and the index.ts barrel does not grow.

In `@packages/docs/src/remark/index.ts`:
- Around line 8-16: This file expands the barrel surface by re-exporting many
plugin symbols (remarkDetailsToMarkdown, remarkResolveDocPlaceholders,
remarkExampleToMarkdown, remarkInclude, remarkLinkIcon, remarkMermaidToMarkdown,
remarkRemoveImports, remarkRemoveJsxComments, remarkSectionToMarkdown); remove
these broad re-exports from index.ts and either (a) export only a narrow,
deliberate public API set or (b) delete the barrel entirely so callers import
directly from each concrete module (e.g. ./plugins/details.remark,
./plugins/example.remark, etc.); update any consumer imports to reference the
concrete plugin modules or the new explicit public entrypoint.

---

Duplicate comments:
In `@apps/docs-smoke/src/components/docs-mdx/tabs.tsx`:
- Around line 63-70: The providedGroupId may be empty or whitespace-only and is
being used directly to build ARIA/DOM ids; update the Tabs component to validate
and sanitize providedGroupId before assigning groupId by trimming it and falling
back to generatedGroupId when the trimmed value is empty, and also normalize it
to a safe id token (e.g., replace whitespace and strip invalid characters) so
the final groupId used by the groupId variable (computed from providedGroupId
and generatedGroupId) is always a valid DOM id for aria-controls/aria-labelledby
and document.getElementById to work reliably.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2e04d867-1f09-4202-86b7-a2f1764fef6f

📥 Commits

Reviewing files that changed from the base of the PR and between d289d82 and 2822f55.

📒 Files selected for processing (6)
  • apps/docs-smoke/src/components/docs-mdx/callout.tsx
  • apps/docs-smoke/src/components/docs-mdx/card.tsx
  • apps/docs-smoke/src/components/docs-mdx/index.ts
  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
  • packages/docs/src/remark/index.ts
  • packages/docs/src/remark/remark-output.test.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Prefer unknown over any when the type is genuinely unknown
Use const assertions (as const) for immutable values and literal types
Leverage TypeScript's type narrowing instead of type assertions

Files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
  • apps/docs-smoke/src/components/docs-mdx/index.ts
  • apps/docs-smoke/src/components/docs-mdx/card.tsx
  • packages/docs/src/remark/index.ts
  • apps/docs-smoke/src/components/docs-mdx/callout.tsx
  • packages/docs/src/remark/remark-output.test.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use meaningful variable names instead of magic numbers - extract constants with descriptive names
Use arrow functions for callbacks and short functions
Prefer for...of loops over .forEach() and indexed for loops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Use const by default, let only when reassignment is needed, never var
Always await promises in async functions - don't forget to use the return value
Use async/await syntax instead of promise chains for better readability
Handle errors appropriately in async code with try-catch blocks
Don't use async functions as Promise executors
Remove console.log, debugger, and alert statements from production code
Throw Error objects with descriptive messages, not strings or other values
Use try-catch blocks meaningfully - don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Don't use eval() or assign directly to document.cookie
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Use descriptive names for functions, variables, and types for meaningful naming
Add comments for complex logic, but prefer self-documenting code

Files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
  • apps/docs-smoke/src/components/docs-mdx/index.ts
  • apps/docs-smoke/src/components/docs-mdx/card.tsx
  • packages/docs/src/remark/index.ts
  • apps/docs-smoke/src/components/docs-mdx/callout.tsx
  • packages/docs/src/remark/remark-output.test.ts
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{jsx,tsx}: Use function components over class components in React
Call hooks at the top level only, never conditionally
Specify all dependencies in hook dependency arrays correctly
Use the key prop for elements in iterables (prefer unique IDs over array indices)
Nest children between opening and closing tags instead of passing as props
Don't define components inside other components
Avoid dangerouslySetInnerHTML unless absolutely necessary
Use proper image components (e.g., Next.js <Image>) over <img> tags
Use Next.js <Image> component for images
Use next/head or App Router metadata API for head elements in Next.js
Use Server Components for async data fetching instead of async Client Components in Next.js
Use ref as a prop instead of React.forwardRef in React 19+

Files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
  • apps/docs-smoke/src/components/docs-mdx/card.tsx
  • apps/docs-smoke/src/components/docs-mdx/callout.tsx
**/*.{jsx,tsx,html}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{jsx,tsx,html}: Use semantic HTML and ARIA attributes for accessibility: provide meaningful alt text for images, use proper heading hierarchy, add labels for form inputs, include keyboard event handlers alongside mouse events, use semantic elements instead of divs with roles
Add rel="noopener" when using target="_blank" on links

Files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
  • apps/docs-smoke/src/components/docs-mdx/card.tsx
  • apps/docs-smoke/src/components/docs-mdx/callout.tsx
**/index.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Avoid barrel files (index files that re-export everything)

Files:

  • apps/docs-smoke/src/components/docs-mdx/index.ts
  • packages/docs/src/remark/index.ts
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{test,spec}.{js,ts,jsx,tsx}: Write assertions inside it() or test() blocks
Avoid done callbacks in async tests - use async/await instead
Don't use .only or .skip in committed code
Keep test suites reasonably flat - avoid excessive describe nesting

Files:

  • packages/docs/src/remark/remark-output.test.ts
🧠 Learnings (33)
📓 Common learnings
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-01-31T11:24:55.220Z
Learning: Applies to apps/docs/**/*.mdx : Include code examples where appropriate in MDX documentation pages of the docs app
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Use MDX for documentation pages
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-01-31T11:24:55.220Z
Learning: Applies to apps/docs/**/*.mdx : Use MDX for documentation pages in the docs app
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Include code examples where appropriate in documentation
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Keep documentation organized by categories
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Use `remarks` for long-form context in TSDoc and JSDoc comments
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Don't use positive integers for `tabIndex` property

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Ensure all ARIA properties (`aria-*`) are valid

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Make sure ARIA properties are valid for the element's supported roles

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use valid, non-abstract ARIA roles for elements with ARIA roles

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use valid ARIA state and property values

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/index.{ts,tsx} : Export type definitions for public API in Elements package

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/index.ts
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/*.{ts,tsx} : Export type definitions for public API in TypeScript libraries

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/index.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Export type definitions for public API

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/index.ts
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{ts,tsx} : Export type definitions for public API and avoid TypeScript enums; use const objects or 'as const' assertions instead due to runtime overhead and tree-shaking limitations

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/index.ts
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/index.{ts,tsx,js,jsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/index.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/index.{js,ts,jsx,tsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/index.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Document all props and types in Elements package TypeScript code

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/index.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/index.{js,jsx,ts,tsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/index.ts
📚 Learning: 2026-02-20T14:21:40.180Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T14:21:40.180Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/index.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `export type` for types

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/index.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Use `remarks` for long-form context in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/remark/index.ts
  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Use `privateRemarks` for maintainer-only notes in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Document defaults with `defaultValue` in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Document components with purpose and use case, required and optional props, context requirements, example usage, and common pitfalls

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/callout.tsx
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{test,spec}.{ts,tsx} : Write unit tests for components in Elements package using Vitest

Applied to files:

  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.test.{ts,tsx} : Use Vitest for testing framework

Applied to files:

  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-02-20T14:21:40.180Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T14:21:40.180Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/*.{test,spec}.{js,jsx,ts,tsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/*.{test,spec}.{js,ts,jsx,tsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-03-19T22:58:00.031Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-03-19T22:58:00.031Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Write comprehensive unit tests with clear test case names describing what is being tested

Applied to files:

  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx} : Include unit tests for components, integration tests for component combinations, accessibility tests, and error boundary tests

Applied to files:

  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{test,spec}.{ts,tsx} : Test accessibility features in Elements package component tests

Applied to files:

  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-01-31T11:24:55.220Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-01-31T11:24:55.220Z
Learning: Applies to apps/docs/**/*.mdx : Include code examples where appropriate in MDX documentation pages of the docs app

Applied to files:

  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Make sure the assertion function, like expect, is placed inside an it() function call

Applied to files:

  • packages/docs/src/remark/remark-output.test.ts
📚 Learning: 2026-03-19T22:57:19.913Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Include code examples where appropriate in documentation

Applied to files:

  • packages/docs/src/remark/remark-output.test.ts
🔍 Remote MCP Context7

Relevant facts for reviewing the PR

  • Library chosen: Unist Util Visit — Context7 library ID: /syntax-tree/unist-util-visit. Reason: provides the traversal API used by the new remark plugins (visit(node, index, parent) signature, visitor receives index and parent),.

  • API surface observed:

    • visit(tree, type, visitor) where visitor is called with (node, index, parent). Example usage shown using mdast trees (fromMarkdown → visit).
    • The package exports traversal control constants (CONTINUE, EXIT, SKIP) and is intended for mutating/inspecting unist-compatible trees; examples and installation instructions are in the README.

Notes for reviewers (grounded in the observed docs):

  • The visitor receives the node index and parent (both available to plugin code) which enables in-place mutations like parent.children.splice(index, ...) — this is the API surface the PR plugins rely on.

Sources

  • Unist Util Visit README & examples (Context7 query results): /syntax-tree/unist-util-visit,
🔇 Additional comments (5)
apps/docs-smoke/src/components/docs-mdx/tabs.tsx (1)

50-57: Good API contract documentation for groupId.

The added prop docs clearly set uniqueness expectations and avoid implying cross-instance state sync.

apps/docs-smoke/src/components/docs-mdx/card.tsx (1)

20-23: Variant and icon support is implemented cleanly.

The prop typing is forward-compatible, and the attribute/rendering logic is safely conditional without changing existing card behavior.

Also applies to: 42-48

packages/docs/src/remark/index.ts (1)

51-59: New plugin ordering looks correct for the transform pipeline.

Placing JSX-comment removal before section/details flattening is a good sequencing choice and matches the regression intent.

packages/docs/src/remark/remark-output.test.ts (1)

105-120: Excellent regression coverage for c15t-compatibility edge cases.

The new cases validate alias normalization and protect against traversal-mutation regressions (adjacent JSX comments + nested sections) in a focused way.

Also applies to: 370-489

apps/docs-smoke/src/components/docs-mdx/callout.tsx (1)

14-41: Alias compatibility and variant normalization are solid.

The deprecated type path is handled cleanly (warnwarning), and using resolvedVariant everywhere keeps rendering behavior consistent.

Also applies to: 58-69

Comment thread apps/docs-smoke/src/components/docs-mdx/index.ts Outdated
Comment thread packages/docs/src/remark/index.ts Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/docs-smoke/src/components/docs-mdx/tabs.tsx`:
- Around line 43-49: resolveGroupId currently checks only for providedGroupId
!== undefined but will throw if providedGroupId is null because normalizeIdToken
calls .trim(); update the guard to ensure providedGroupId is a non-null string
(e.g., use typeof providedGroupId === "string" or providedGroupId != null &&
typeof providedGroupId === "string") before calling normalizeIdToken, and
otherwise fall back to returning generatedGroupId; reference the resolveGroupId
function and normalizeIdToken when making this defensive check.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 58915e6b-db56-4fac-865c-282302cf5dcc

📥 Commits

Reviewing files that changed from the base of the PR and between 2822f55 and 7d35cf4.

📒 Files selected for processing (2)
  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
  • packages/docs/src/remark/index.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Prefer unknown over any when the type is genuinely unknown
Use const assertions (as const) for immutable values and literal types
Leverage TypeScript's type narrowing instead of type assertions

Files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
  • packages/docs/src/remark/index.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use meaningful variable names instead of magic numbers - extract constants with descriptive names
Use arrow functions for callbacks and short functions
Prefer for...of loops over .forEach() and indexed for loops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Use const by default, let only when reassignment is needed, never var
Always await promises in async functions - don't forget to use the return value
Use async/await syntax instead of promise chains for better readability
Handle errors appropriately in async code with try-catch blocks
Don't use async functions as Promise executors
Remove console.log, debugger, and alert statements from production code
Throw Error objects with descriptive messages, not strings or other values
Use try-catch blocks meaningfully - don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Don't use eval() or assign directly to document.cookie
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Use descriptive names for functions, variables, and types for meaningful naming
Add comments for complex logic, but prefer self-documenting code

Files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
  • packages/docs/src/remark/index.ts
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{jsx,tsx}: Use function components over class components in React
Call hooks at the top level only, never conditionally
Specify all dependencies in hook dependency arrays correctly
Use the key prop for elements in iterables (prefer unique IDs over array indices)
Nest children between opening and closing tags instead of passing as props
Don't define components inside other components
Avoid dangerouslySetInnerHTML unless absolutely necessary
Use proper image components (e.g., Next.js <Image>) over <img> tags
Use Next.js <Image> component for images
Use next/head or App Router metadata API for head elements in Next.js
Use Server Components for async data fetching instead of async Client Components in Next.js
Use ref as a prop instead of React.forwardRef in React 19+

Files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
**/*.{jsx,tsx,html}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{jsx,tsx,html}: Use semantic HTML and ARIA attributes for accessibility: provide meaningful alt text for images, use proper heading hierarchy, add labels for form inputs, include keyboard event handlers alongside mouse events, use semantic elements instead of divs with roles
Add rel="noopener" when using target="_blank" on links

Files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
**/index.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Avoid barrel files (index files that re-export everything)

Files:

  • packages/docs/src/remark/index.ts
🧠 Learnings (25)
📓 Common learnings
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-01-31T11:24:55.220Z
Learning: Applies to apps/docs/**/*.mdx : Include code examples where appropriate in MDX documentation pages of the docs app
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Use MDX for documentation pages
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-01-31T11:24:55.220Z
Learning: Applies to apps/docs/**/*.mdx : Use MDX for documentation pages in the docs app
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Include code examples where appropriate in documentation
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Keep documentation organized by categories
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Use `remarks` for long-form context in TSDoc and JSDoc comments
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Ensure all ARIA properties (`aria-*`) are valid

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Make sure ARIA properties are valid for the element's supported roles

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use valid, non-abstract ARIA roles for elements with ARIA roles

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use valid ARIA state and property values

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/use*.{ts,tsx,js,jsx} : Create context using `createContext` and access it with custom hooks, throwing errors if context is missing

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Create dedicated hooks for context access with proper error boundaries and clear error messages for context misuse

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/use*.{ts,tsx,js,jsx} : Create dedicated hooks for context access in components

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/*.{tsx,jsx} : Use React Context for global state management in components

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/use*.{ts,tsx,js,jsx} : Provide clear error messages for misuse of context in hooks

Applied to files:

  • apps/docs-smoke/src/components/docs-mdx/tabs.tsx
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Use `remarks` for long-form context in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Use `privateRemarks` for maintainer-only notes in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Don't rename imports, exports, and destructured assignments to the same name

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/index.{js,ts,jsx,tsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/index.{ts,tsx,js,jsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/index.{js,jsx,ts,tsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2026-02-20T14:21:40.180Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T14:21:40.180Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{ts,tsx} : Export type definitions for public API and avoid TypeScript enums; use const objects or 'as const' assertions instead due to runtime overhead and tree-shaking limitations

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Keep functions focused and under reasonable cognitive complexity limits

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Don't use unnecessary fragments

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/index.{ts,tsx} : Use `packageDocumentation` for entrypoint docs in TSDoc comments

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Prefer `{link ...}` for symbol references in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/*.{ts,tsx} : Export type definitions for public API in TypeScript libraries

Applied to files:

  • packages/docs/src/remark/index.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Document defaults with `defaultValue` in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/remark/index.ts
🔍 Remote MCP Context7

Summary of additional facts relevant to reviewing the remark plugin changes

  • Library resolved: Unist Util Visit — Context7 library ID is /syntax-tree/unist-util-visit.
  • API confirms visitor signature and mutation semantics used by the PR plugins:
    • visit(tree, type, visitor) calls visitor(node, index, parent); visitor receives index and parent allowing in-place mutations such as parent.children.splice(index, ...). Example usage shown in the README.
    • The package exports traversal control constants CONTINUE, EXIT, SKIP (useful for controlling traversal when mutating).
    • README includes basic mdast examples and install/import instructions (npm install, Deno/browser import examples).

Implications for this PR

  • The unist-util-visit API supports the splice-and-return-index pattern implemented in remarkSectionToMarkdown and remarkRemoveJsxComments (visitor sees index+parent and README examples show this usage).
  • Use of CONTINUE/EXIT/SKIP is available if the plugins need finer traversal control.

Sources

  • Context7: Resolve library ID for "unist-util-visit".
  • Context7: unist-util-visit README (API signature, examples, CONTINUE/EXIT/SKIP, install/import).
🔇 Additional comments (4)
packages/docs/src/remark/index.ts (2)

13-19: Solid import additions for MDX compatibility plugins.

These imports are cohesive with the new transformer pipeline and are used directly in defaultRemarkPlugins.


30-37: Plugin ordering update is well-structured.

The new sequence (comment-strip + section unwrap early, details flatten in-flow) is consistent with the intended MDX→Markdown normalization behavior.

apps/docs-smoke/src/components/docs-mdx/tabs.tsx (2)

21-22: Good ID token sanitization primitives.

Extracting reusable regex constants and centralizing token normalization makes the ID pipeline clearer and less error-prone.

Also applies to: 36-41


73-79: groupId API contract and resolution flow are well documented.

The prop docs clearly call out uniqueness constraints, and resolving a final groupId before wiring IDs improves predictability for SSR-compatible markup.

Also applies to: 83-93

Comment thread apps/docs-smoke/src/components/docs-mdx/tabs.tsx
@KayleeWilliams KayleeWilliams merged commit 692b4a2 into main Apr 27, 2026
2 checks passed
@KayleeWilliams KayleeWilliams deleted the KayleeWilliams/docs-widgets branch May 9, 2026 02:30
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.

1 participant