feat(docs): c15t MDX compatibility for callouts, sections, details#9
Conversation
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).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (4)**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{js,ts,jsx,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{jsx,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{jsx,tsx,html}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (9)📓 Common learnings📚 Learning: 2025-12-17T14:48:41.563ZApplied to files:
📚 Learning: 2025-12-17T14:48:41.563ZApplied to files:
📚 Learning: 2025-12-17T14:48:41.563ZApplied to files:
📚 Learning: 2025-07-23T12:51:43.299ZApplied to files:
📚 Learning: 2026-03-19T22:57:45.114ZApplied to files:
📚 Learning: 2025-07-23T12:51:43.299ZApplied to files:
📚 Learning: 2025-07-23T12:51:43.299ZApplied to files:
📚 Learning: 2025-07-23T12:51:43.299ZApplied to files:
🔍 Remote MCP Context7Summary of additional concrete facts useful for reviewing the PR
Relevant links / provenance
Notes for reviewers (concise)
🔇 Additional comments (4)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (16)
packages/docs/src/components/callout.tsxpackages/docs/src/components/card.tsxpackages/docs/src/components/index.tspackages/docs/src/components/package-command-tabs.tsxpackages/docs/src/components/tabs.tsxpackages/docs/src/internal/callout-variant.test.tspackages/docs/src/internal/callout-variant.tspackages/docs/src/internal/package-managers.test.tspackages/docs/src/internal/package-managers.tspackages/docs/src/remark/index.tspackages/docs/src/remark/plugins/callout.remark.tspackages/docs/src/remark/plugins/details.remark.tspackages/docs/src/remark/plugins/package-command-tabs.remark.tspackages/docs/src/remark/plugins/remove-jsx-comments.remark.tspackages/docs/src/remark/plugins/section.remark.tspackages/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
Preferunknownoveranywhen 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.tspackages/docs/src/internal/callout-variant.test.tspackages/docs/src/remark/plugins/details.remark.tspackages/docs/src/remark/plugins/section.remark.tspackages/docs/src/remark/plugins/remove-jsx-comments.remark.tspackages/docs/src/components/index.tspackages/docs/src/internal/package-managers.test.tspackages/docs/src/components/card.tsxpackages/docs/src/remark/plugins/package-command-tabs.remark.tspackages/docs/src/components/tabs.tsxpackages/docs/src/components/package-command-tabs.tsxpackages/docs/src/internal/callout-variant.tspackages/docs/src/internal/package-managers.tspackages/docs/src/remark/index.tspackages/docs/src/components/callout.tsxpackages/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
Preferfor...ofloops over.forEach()and indexedforloops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Useconstby default,letonly when reassignment is needed, nevervar
Alwaysawaitpromises in async functions - don't forget to use the return value
Useasync/awaitsyntax 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
Removeconsole.log,debugger, andalertstatements from production code
ThrowErrorobjects with descriptive messages, not strings or other values
Usetry-catchblocks 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 useeval()or assign directly todocument.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.tspackages/docs/src/internal/callout-variant.test.tspackages/docs/src/remark/plugins/details.remark.tspackages/docs/src/remark/plugins/section.remark.tspackages/docs/src/remark/plugins/remove-jsx-comments.remark.tspackages/docs/src/components/index.tspackages/docs/src/internal/package-managers.test.tspackages/docs/src/components/card.tsxpackages/docs/src/remark/plugins/package-command-tabs.remark.tspackages/docs/src/components/tabs.tsxpackages/docs/src/components/package-command-tabs.tsxpackages/docs/src/internal/callout-variant.tspackages/docs/src/internal/package-managers.tspackages/docs/src/remark/index.tspackages/docs/src/components/callout.tsxpackages/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 insideit()ortest()blocks
Avoid done callbacks in async tests - use async/await instead
Don't use.onlyor.skipin committed code
Keep test suites reasonably flat - avoid excessivedescribenesting
Files:
packages/docs/src/internal/callout-variant.test.tspackages/docs/src/internal/package-managers.test.tspackages/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.tspackages/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 thekeyprop 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
AvoiddangerouslySetInnerHTMLunless absolutely necessary
Use proper image components (e.g., Next.js<Image>) over<img>tags
Use Next.js<Image>component for images
Usenext/heador 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 ofReact.forwardRefin React 19+
Files:
packages/docs/src/components/card.tsxpackages/docs/src/components/tabs.tsxpackages/docs/src/components/package-command-tabs.tsxpackages/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
Addrel="noopener"when usingtarget="_blank"on links
Files:
packages/docs/src/components/card.tsxpackages/docs/src/components/tabs.tsxpackages/docs/src/components/package-command-tabs.tsxpackages/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.tspackages/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.tspackages/docs/src/internal/package-managers.test.tspackages/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.tspackages/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.tspackages/docs/src/internal/package-managers.test.tspackages/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.tspackages/docs/src/internal/package-managers.test.tspackages/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.tspackages/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.tspackages/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.tspackages/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.tspackages/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.tspackages/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.tspackages/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.tspackages/docs/src/remark/plugins/section.remark.tspackages/docs/src/remark/plugins/remove-jsx-comments.remark.tspackages/docs/src/remark/index.tspackages/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.tspackages/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.tspackages/docs/src/remark/index.tspackages/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.tspackages/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.tspackages/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.tspackages/docs/src/components/package-command-tabs.tsxpackages/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.tspackages/docs/src/components/card.tsxpackages/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.tspackages/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.tspackages/docs/src/components/card.tsxpackages/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.tspackages/docs/src/components/card.tsxpackages/docs/src/components/tabs.tsxpackages/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.tspackages/docs/src/components/package-command-tabs.tsxpackages/docs/src/internal/callout-variant.tspackages/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.tspackages/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.tspackages/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.tsxpackages/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:
-
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).
-
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.
-
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
CardVarianttyping + optionalicon/variantrendering is clean and non-breaking, and thedata-variantomission 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.
warnandnoteare 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-managerstypes/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 indexpattern 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
modeprop 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
typewhile normalizing to a singleresolvedVariantkeeps 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
resolvePackageCommandmake behavior deterministic across component and remark consumers.packages/docs/src/components/tabs.tsx (1)
50-57: CleargroupIdcontract docs — good addition.The new prop documentation sets expectations well (uniqueness and non-shared state), which helps prevent misuse.
| 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; |
There was a problem hiding this comment.
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.
| 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.
There was a problem hiding this comment.
💡 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".
| return createJsxComponentProcessor("details", (node) => | ||
| toDetailsContent(node) |
There was a problem hiding this comment.
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 👍 / 👎.
| if (extractedSummary) { | ||
| summaryText = extractedSummary; | ||
| continue; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
apps/docs-smoke/src/components/docs-mdx/tabs.tsx (1)
63-70:⚠️ Potential issue | 🟠 MajorValidate/sanitize
providedGroupIdbefore using it for ARIA/DOM ids (Line 69).
providedGroupId ?? generatedGroupIdaccepts empty and whitespace-only values, which can produce broken id wiring foraria-controls/aria-labelledbyand fail focus handoff viadocument.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
📒 Files selected for processing (6)
apps/docs-smoke/src/components/docs-mdx/callout.tsxapps/docs-smoke/src/components/docs-mdx/card.tsxapps/docs-smoke/src/components/docs-mdx/index.tsapps/docs-smoke/src/components/docs-mdx/tabs.tsxpackages/docs/src/remark/index.tspackages/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
Preferunknownoveranywhen 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.tsxapps/docs-smoke/src/components/docs-mdx/index.tsapps/docs-smoke/src/components/docs-mdx/card.tsxpackages/docs/src/remark/index.tsapps/docs-smoke/src/components/docs-mdx/callout.tsxpackages/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
Preferfor...ofloops over.forEach()and indexedforloops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Useconstby default,letonly when reassignment is needed, nevervar
Alwaysawaitpromises in async functions - don't forget to use the return value
Useasync/awaitsyntax 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
Removeconsole.log,debugger, andalertstatements from production code
ThrowErrorobjects with descriptive messages, not strings or other values
Usetry-catchblocks 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 useeval()or assign directly todocument.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.tsxapps/docs-smoke/src/components/docs-mdx/index.tsapps/docs-smoke/src/components/docs-mdx/card.tsxpackages/docs/src/remark/index.tsapps/docs-smoke/src/components/docs-mdx/callout.tsxpackages/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 thekeyprop 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
AvoiddangerouslySetInnerHTMLunless absolutely necessary
Use proper image components (e.g., Next.js<Image>) over<img>tags
Use Next.js<Image>component for images
Usenext/heador 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 ofReact.forwardRefin React 19+
Files:
apps/docs-smoke/src/components/docs-mdx/tabs.tsxapps/docs-smoke/src/components/docs-mdx/card.tsxapps/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
Addrel="noopener"when usingtarget="_blank"on links
Files:
apps/docs-smoke/src/components/docs-mdx/tabs.tsxapps/docs-smoke/src/components/docs-mdx/card.tsxapps/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.tspackages/docs/src/remark/index.ts
**/*.{test,spec}.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{test,spec}.{js,ts,jsx,tsx}: Write assertions insideit()ortest()blocks
Avoid done callbacks in async tests - use async/await instead
Don't use.onlyor.skipin committed code
Keep test suites reasonably flat - avoid excessivedescribenesting
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.tspackages/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 forgroupId.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
typepath is handled cleanly (warn→warning), and usingresolvedVarianteverywhere keeps rendering behavior consistent.Also applies to: 58-69
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
apps/docs-smoke/src/components/docs-mdx/tabs.tsxpackages/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
Preferunknownoveranywhen 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.tsxpackages/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
Preferfor...ofloops over.forEach()and indexedforloops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Useconstby default,letonly when reassignment is needed, nevervar
Alwaysawaitpromises in async functions - don't forget to use the return value
Useasync/awaitsyntax 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
Removeconsole.log,debugger, andalertstatements from production code
ThrowErrorobjects with descriptive messages, not strings or other values
Usetry-catchblocks 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 useeval()or assign directly todocument.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.tsxpackages/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 thekeyprop 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
AvoiddangerouslySetInnerHTMLunless absolutely necessary
Use proper image components (e.g., Next.js<Image>) over<img>tags
Use Next.js<Image>component for images
Usenext/heador 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 ofReact.forwardRefin 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
Addrel="noopener"when usingtarget="_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:groupIdAPI contract and resolution flow are well documented.The prop docs clearly call out uniqueness constraints, and resolving a final
groupIdbefore wiring IDs improves predictability for SSR-compatible markup.Also applies to: 83-93
Summary
Makes
@inth/docsa drop-in target for Fumadocs-style MDX (used by c15t) without forking. Adds three remark plugins (sectionunwrap,detailsflatten, JSX-comment strip), accepts<Callout type="warn"|"note">aliases, givesPackageCommandTabsamodeprop, givesTabsagroupId, and addsicon/variantprops onCard. ExtractsCOMMANDSandresolvePackageCommandtointernal/so the React component and the remark plugin share one source of truth, and fixes aunist-util-visitsplice-resume bug that previously skipped nested<section>wrappers and adjacent JSX comments.Test plan
bun x tsc --noEmitcleanbun x ultracite check srcclean (53 files)bun x vitest run— 50/50 tests (14 new)bun run buildcleanapps/docs-smokereal-content test against c15t fixture: 200/200 .mdx → .md