Skip to content

fix(core): improve api custom elements schema#190

Open
coryrylan wants to merge 1 commit into
mainfrom
topic-grid-api-docs
Open

fix(core): improve api custom elements schema#190
coryrylan wants to merge 1 commit into
mainfrom
topic-grid-api-docs

Conversation

@coryrylan

@coryrylan coryrylan commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Update slot descriptions across multiple components for clarity and consistency. Enhanced documentation for slots in Accordion, Avatar, Badge, Card, Chat Message, Copy Button, Dialog, Drawer, Dropdown, Grid, Menu Item, Notification, Toast, and others to specify expected content types and usage.

Summary by CodeRabbit

  • Documentation
    • Clarified slot/JSDoc text across many components (including accessibility wording), with improved generated metadata descriptions.
  • Enhancements
    • Updated FormatNumber.useGrouping typing to support additional documented string values (plus booleans).
    • Refined nve-pagination documentation and bound stepSizes to the step-sizes attribute.
  • Tests
    • Added unit coverage for type/markdown normalization, member/attribute projection behavior, and public-only pruning.

@coryrylan coryrylan self-assigned this Jul 23, 2026
Copilot AI review requested due to automatic review settings July 23, 2026 18:15
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The pull request refines component JSDoc metadata, updates selected public attribute mappings and types, and revises CEM type normalization, inheritance, projection, public filtering, and Markdown generation with accompanying tests.

Changes

Component documentation and API metadata

Layer / File(s) Summary
Component documentation and metadata
projects/core/src/**, projects/forms/src/mixins/button.types.ts
Slot, property, event, CSS variable, visibility, and lifecycle documentation is clarified across components. Pagination.stepSizes gains the step-sizes attribute mapping, and FormatNumber.useGrouping receives a constrained type union.

CEM type processing and projection

Layer / File(s) Summary
CEM type processing and projection
projects/internals/vite/src/plugins/cem.config.mjs
Shared helpers normalize documented type values, attribute-facing element-reference types, inherited members, mixin attribute projection, and type aliases. An attribute-types plugin is added.

CEM output filtering and validation

Layer / File(s) Summary
CEM output filtering and validation
projects/internals/vite/src/plugins/cem.config.mjs, projects/internals/vite/src/plugins/cem.test.js
Markdown generation now distinguishes property and attribute types and filters non-public members. Inherited-description handling and public-property filtering are revised, with tests covering the new behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested labels: type(fix), scope(code)

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.56% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main docs/schema-focused change across core custom elements.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch topic-grid-api-docs

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

projects/core/src/accordion/accordion.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

projects/core/src/avatar/avatar-group.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

projects/core/src/avatar/avatar.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

  • 37 others

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

Comment thread projects/internals/vite/src/plugins/cem.config.mjs Fixed
Comment thread projects/internals/vite/src/plugins/cem.config.mjs Fixed
Comment thread projects/internals/vite/src/plugins/cem.config.mjs Fixed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the generated Custom Elements Manifest (CEM) + Markdown output for Elements, and updates many component JSDoc slot descriptions to be clearer and more consistent—especially around expected slot content and ID-ref vs element-ref APIs.

Changes:

  • Expanded the CEM tooling to normalize attribute-facing types (e.g., element-ref properties -> string ID attributes), improve type rewriting/matching, and generate clearer Markdown (public-only members; distinct property vs attribute types).
  • Updated slot descriptions and several related JSDoc annotations across many core components for clearer API documentation.
  • Corrected/clarified a few public API surfaces and doc details (e.g., Pagination#stepSizes attribute name, richer value/property docs for Dropzone/PreferencesInput, type refinement for FormatNumber).

Reviewed changes

Copilot reviewed 42 out of 42 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
projects/internals/vite/src/plugins/cem.test.js Adds unit tests covering new CEM helper utilities (type matching/rewriting, attribute type normalization, public-member filtering, Markdown formatting).
projects/internals/vite/src/plugins/cem.config.mjs Implements new exported helpers and plugins to improve CEM output (attribute-facing types, public-only docs, type normalization, improved Markdown output).
projects/forms/src/mixins/button.types.ts Clarifies JSDoc for readOnly and form to better describe behavior and expected inputs.
projects/core/src/tree/tree-node.ts Converts inline “@Private” comments to JSDoc /** @private */ for better tooling/CEM privacy detection.
projects/core/src/tooltip/tooltip.ts Improves slot description and marks internal queried arrow element as private.
projects/core/src/toolbar/toolbar.ts Clarifies default slot documentation for expected toolbar content.
projects/core/src/toggletip/toggletip.ts Marks internal queried arrow element as private.
projects/core/src/toast/toast.ts Clarifies default slot documentation for toast message content.
projects/core/src/tag/tag.ts Clarifies default slot documentation for tag label/content.
projects/core/src/tabs/tabs.ts Clarifies default slot documentation for tab label content.
projects/core/src/steps/steps.ts Rewrites status property documentation to more explicitly describe each visual/status outcome.
projects/core/src/skeleton/skeleton.ts Clarifies default slot documentation and refines hidden property documentation to match accessibility behavior.
projects/core/src/progressive-filter-chip/progressive-filter-chip.ts Clarifies default slot documentation to describe typical control elements.
projects/core/src/preferences-input/preferences-input.ts Adds explicit JSDoc property/attribute typing for value (and disables a lint rule to preserve types for CEM).
projects/core/src/pagination/pagination.ts Adds explicit step-sizes attribute mapping and clarifies step-size docs/events/slots.
projects/core/src/page/page-panel/page-panel.ts Clarifies default slot documentation for expected panel-body children.
projects/core/src/page/page-panel/page-panel-header.ts Marks auto-slotting slot host attribute as private.
projects/core/src/page/page-panel/page-panel-footer.ts Marks auto-slotting slot host attribute as private.
projects/core/src/page-loader/page-loader.ts Clarifies default slot documentation for loading status text.
projects/core/src/notification/notification.ts Clarifies default slot documentation for notification message content.
projects/core/src/menu/menu-item.ts Clarifies default slot documentation and adds doc comment for status usage.
projects/core/src/logo/logo.ts Clarifies default slot documentation for logo/brand content.
projects/core/src/internal/types/index.ts Clarifies base interface docs for element-reference properties (anchor, trigger) and fixes minor wording.
projects/core/src/grid/placeholder/placeholder.ts Clarifies default slot documentation for loading/empty-state message content.
projects/core/src/grid/grid.ts Clarifies default slot documentation to list expected grid child elements.
projects/core/src/grid/footer/footer.ts Clarifies default slot documentation and marks auto-slotting slot host attribute as private.
projects/core/src/grid/column/column.ts Clarifies default slot documentation for column heading content.
projects/core/src/grid/cell/cell.ts Clarifies default slot documentation for cell content (data/controls).
projects/core/src/forms/control-message/control-message.ts Clarifies default slot documentation and marks auto-slotting slot host attribute as private.
projects/core/src/format-number/format-number.ts Narrows useGrouping to an explicit union (incl. boolean) for clearer API typing.
projects/core/src/dropzone/dropzone.ts Adds explicit JSDoc property typing for value, clarifies slots/docs, and documents key properties.
projects/core/src/dropdown/dropdown.ts Marks internal queried arrow element as private.
projects/core/src/dropdown-group/dropdown-group.ts Removes outdated CSS prop docs and adds a public method doc comment for close().
projects/core/src/drawer/drawer.ts Clarifies default slot documentation for drawer body content.
projects/core/src/dialog/dialog.ts Clarifies default slot documentation for dialog body content.
projects/core/src/copy-button/copy-button.ts Clarifies default slot documentation for the visible label content.
projects/core/src/chat-message/chat-message.ts Clarifies slot docs and adds docs for key style/layout properties.
projects/core/src/card/card.ts Clarifies slot docs and adds privacy/docs for auto-slotting behavior on subcomponents.
projects/core/src/badge/badge.ts Clarifies default slot documentation for badge text content.
projects/core/src/avatar/avatar.ts Clarifies default slot documentation for avatar identifying content.
projects/core/src/avatar/avatar-group.ts Clarifies default slot documentation for expected nve-avatar children.
projects/core/src/accordion/accordion.ts Clarifies slot docs for header/accordion and refines container property documentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread projects/core/src/card/card.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@projects/core/src/format-number/format-number.ts`:
- Around line 113-114: Update the JSDoc for the useGrouping property to document
its boolean form alongside the existing string values, keeping the public type
declaration and documentation consistent.

In `@projects/internals/vite/src/plugins/cem.config.mjs`:
- Around line 1155-1161: Extract a shared helper near the type-formatting logic
to escape backslashes before escaping pipe characters, then use it for both
propertyType and attributeType in the type construction. Replace the duplicated
inline replace calls while preserving the existing output and mismatch
formatting in the surrounding logic.
- Around line 1590-1602: Update the attribute loop in the manifest generation
logic to apply the same name/direction exclusion as the member loop before
copying descriptions from baseInterface. Prevent baseInterface descriptions from
overwriting component-specific descriptions for attributes named “name” or
“direction,” while preserving the existing shouldUseStandardDescription, docs,
and typesMatch checks for other attributes.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: fb366988-e8eb-42d9-8646-a23a9cbcef1a

📥 Commits

Reviewing files that changed from the base of the PR and between 287e6c3 and fb1d727.

📒 Files selected for processing (42)
  • projects/core/src/accordion/accordion.ts
  • projects/core/src/avatar/avatar-group.ts
  • projects/core/src/avatar/avatar.ts
  • projects/core/src/badge/badge.ts
  • projects/core/src/card/card.ts
  • projects/core/src/chat-message/chat-message.ts
  • projects/core/src/copy-button/copy-button.ts
  • projects/core/src/dialog/dialog.ts
  • projects/core/src/drawer/drawer.ts
  • projects/core/src/dropdown-group/dropdown-group.ts
  • projects/core/src/dropdown/dropdown.ts
  • projects/core/src/dropzone/dropzone.ts
  • projects/core/src/format-number/format-number.ts
  • projects/core/src/forms/control-message/control-message.ts
  • projects/core/src/grid/cell/cell.ts
  • projects/core/src/grid/column/column.ts
  • projects/core/src/grid/footer/footer.ts
  • projects/core/src/grid/grid.ts
  • projects/core/src/grid/placeholder/placeholder.ts
  • projects/core/src/internal/types/index.ts
  • projects/core/src/logo/logo.ts
  • projects/core/src/menu/menu-item.ts
  • projects/core/src/notification/notification.ts
  • projects/core/src/page-loader/page-loader.ts
  • projects/core/src/page/page-panel/page-panel-footer.ts
  • projects/core/src/page/page-panel/page-panel-header.ts
  • projects/core/src/page/page-panel/page-panel.ts
  • projects/core/src/pagination/pagination.ts
  • projects/core/src/preferences-input/preferences-input.ts
  • projects/core/src/progressive-filter-chip/progressive-filter-chip.ts
  • projects/core/src/skeleton/skeleton.ts
  • projects/core/src/steps/steps.ts
  • projects/core/src/tabs/tabs.ts
  • projects/core/src/tag/tag.ts
  • projects/core/src/toast/toast.ts
  • projects/core/src/toggletip/toggletip.ts
  • projects/core/src/toolbar/toolbar.ts
  • projects/core/src/tooltip/tooltip.ts
  • projects/core/src/tree/tree-node.ts
  • projects/forms/src/mixins/button.types.ts
  • projects/internals/vite/src/plugins/cem.config.mjs
  • projects/internals/vite/src/plugins/cem.test.js

Comment thread projects/core/src/format-number/format-number.ts
Comment thread projects/internals/vite/src/plugins/cem.config.mjs
Comment thread projects/internals/vite/src/plugins/cem.config.mjs
Copilot AI review requested due to automatic review settings July 23, 2026 19:42
@coryrylan
coryrylan force-pushed the topic-grid-api-docs branch from fb1d727 to e87d5d2 Compare July 23, 2026 19:42

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@projects/core/src/badge/badge.ts`:
- Line 28: Update the badge component’s default-slot documentation to state that
it accepts short status text or an optional unnamed nve-icon promoted to
prefix-icon; only remove this behavior if the icon fallback is not intended to
be public.

In `@projects/core/src/dropzone/dropzone.ts`:
- Line 29: Update the change event JSDoc near the Dropzone event documentation
to state that selected files are available through event.target.value, replacing
the inaccurate claim that they are directly located in event.target. Use clear,
descriptive wording consistent with the API contract.

In `@projects/internals/vite/src/plugins/cem.config.mjs`:
- Around line 45-81: Update rewriteTypesText so Extract<> normalization assigns
the unwrapped text to the local value used by the subsequent alias-expansion
loop, rather than continuing with the stale original text. Strip the closing
Extract delimiter whether or not the expression is followed by an outer union,
while preserving the existing union and alias ordering behavior.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 5c9e0a99-a0df-44d7-af24-4af425f64b48

📥 Commits

Reviewing files that changed from the base of the PR and between fb1d727 and e87d5d2.

📒 Files selected for processing (42)
  • projects/core/src/accordion/accordion.ts
  • projects/core/src/avatar/avatar-group.ts
  • projects/core/src/avatar/avatar.ts
  • projects/core/src/badge/badge.ts
  • projects/core/src/card/card.ts
  • projects/core/src/chat-message/chat-message.ts
  • projects/core/src/copy-button/copy-button.ts
  • projects/core/src/dialog/dialog.ts
  • projects/core/src/drawer/drawer.ts
  • projects/core/src/dropdown-group/dropdown-group.ts
  • projects/core/src/dropdown/dropdown.ts
  • projects/core/src/dropzone/dropzone.ts
  • projects/core/src/format-number/format-number.ts
  • projects/core/src/forms/control-message/control-message.ts
  • projects/core/src/grid/cell/cell.ts
  • projects/core/src/grid/column/column.ts
  • projects/core/src/grid/footer/footer.ts
  • projects/core/src/grid/grid.ts
  • projects/core/src/grid/placeholder/placeholder.ts
  • projects/core/src/internal/types/index.ts
  • projects/core/src/logo/logo.ts
  • projects/core/src/menu/menu-item.ts
  • projects/core/src/notification/notification.ts
  • projects/core/src/page-loader/page-loader.ts
  • projects/core/src/page/page-panel/page-panel-footer.ts
  • projects/core/src/page/page-panel/page-panel-header.ts
  • projects/core/src/page/page-panel/page-panel.ts
  • projects/core/src/pagination/pagination.ts
  • projects/core/src/preferences-input/preferences-input.ts
  • projects/core/src/progressive-filter-chip/progressive-filter-chip.ts
  • projects/core/src/skeleton/skeleton.ts
  • projects/core/src/steps/steps.ts
  • projects/core/src/tabs/tabs.ts
  • projects/core/src/tag/tag.ts
  • projects/core/src/toast/toast.ts
  • projects/core/src/toggletip/toggletip.ts
  • projects/core/src/toolbar/toolbar.ts
  • projects/core/src/tooltip/tooltip.ts
  • projects/core/src/tree/tree-node.ts
  • projects/forms/src/mixins/button.types.ts
  • projects/internals/vite/src/plugins/cem.config.mjs
  • projects/internals/vite/src/plugins/cem.test.js

Comment thread projects/core/src/badge/badge.ts
Comment thread projects/core/src/dropzone/dropzone.ts
Comment thread projects/internals/vite/src/plugins/cem.config.mjs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 42 out of 42 changed files in this pull request and generated 2 comments.

Comment thread projects/internals/vite/src/plugins/cem.config.mjs Outdated
Comment thread projects/internals/vite/src/plugins/cem.config.mjs Outdated
Copilot AI review requested due to automatic review settings July 23, 2026 21:42
@coryrylan
coryrylan force-pushed the topic-grid-api-docs branch from e87d5d2 to 4b56e54 Compare July 23, 2026 21:42

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (1)
projects/core/src/format-number/format-number.ts (1)

113-114: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep useGrouping documentation aligned with its public type.

The type now accepts boolean, but the JSDoc still documents only string values. Document the boolean form, or clarify that booleans are supported through JavaScript property assignment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/core/src/format-number/format-number.ts` around lines 113 - 114,
Update the JSDoc for the useGrouping property to document its boolean support
alongside the existing string values, or explicitly state that booleans are
supported through JavaScript property assignment. Keep the public type
declaration and runtime behavior unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@projects/core/src/accordion/accordion.ts`:
- Line 106: Update the JSDoc description for the `icon-button` slot in the
accordion component to identify it as an icon button control, matching the
`<nve-icon-button>` fallback rather than describing it as generic icon elements.

In `@projects/core/src/pagination/pagination.ts`:
- Around line 57-59: Update the JSDoc immediately above the stepSizes property
to document the step-sizes attribute as a JSON array, including an example such
as step-sizes="[10, 20, 50]". Keep the existing property declaration and
behavior unchanged.

In `@projects/internals/vite/src/plugins/cem.config.mjs`:
- Around line 51-56: Update the parsing branch around the text transformation to
match only the exact Extract< prefix, not aliases such as ExtractedType. Replace
the naive split(',')[1] logic with bracket-aware parsing that finds the
top-level comma inside Extract<…>, preserving nested generic operands; add
regressions covering both alias input and nested generic input.

---

Duplicate comments:
In `@projects/core/src/format-number/format-number.ts`:
- Around line 113-114: Update the JSDoc for the useGrouping property to document
its boolean support alongside the existing string values, or explicitly state
that booleans are supported through JavaScript property assignment. Keep the
public type declaration and runtime behavior unchanged.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 01c43ce5-2f80-4dec-90b6-c4aae9adc351

📥 Commits

Reviewing files that changed from the base of the PR and between e87d5d2 and 4b56e54.

📒 Files selected for processing (42)
  • projects/core/src/accordion/accordion.ts
  • projects/core/src/avatar/avatar-group.ts
  • projects/core/src/avatar/avatar.ts
  • projects/core/src/badge/badge.ts
  • projects/core/src/card/card.ts
  • projects/core/src/chat-message/chat-message.ts
  • projects/core/src/copy-button/copy-button.ts
  • projects/core/src/dialog/dialog.ts
  • projects/core/src/drawer/drawer.ts
  • projects/core/src/dropdown-group/dropdown-group.ts
  • projects/core/src/dropdown/dropdown.ts
  • projects/core/src/dropzone/dropzone.ts
  • projects/core/src/format-number/format-number.ts
  • projects/core/src/forms/control-message/control-message.ts
  • projects/core/src/grid/cell/cell.ts
  • projects/core/src/grid/column/column.ts
  • projects/core/src/grid/footer/footer.ts
  • projects/core/src/grid/grid.ts
  • projects/core/src/grid/placeholder/placeholder.ts
  • projects/core/src/internal/types/index.ts
  • projects/core/src/logo/logo.ts
  • projects/core/src/menu/menu-item.ts
  • projects/core/src/notification/notification.ts
  • projects/core/src/page-loader/page-loader.ts
  • projects/core/src/page/page-panel/page-panel-footer.ts
  • projects/core/src/page/page-panel/page-panel-header.ts
  • projects/core/src/page/page-panel/page-panel.ts
  • projects/core/src/pagination/pagination.ts
  • projects/core/src/preferences-input/preferences-input.ts
  • projects/core/src/progressive-filter-chip/progressive-filter-chip.ts
  • projects/core/src/skeleton/skeleton.ts
  • projects/core/src/steps/steps.ts
  • projects/core/src/tabs/tabs.ts
  • projects/core/src/tag/tag.ts
  • projects/core/src/toast/toast.ts
  • projects/core/src/toggletip/toggletip.ts
  • projects/core/src/toolbar/toolbar.ts
  • projects/core/src/tooltip/tooltip.ts
  • projects/core/src/tree/tree-node.ts
  • projects/forms/src/mixins/button.types.ts
  • projects/internals/vite/src/plugins/cem.config.mjs
  • projects/internals/vite/src/plugins/cem.test.js

Comment thread projects/core/src/accordion/accordion.ts
Comment thread projects/core/src/pagination/pagination.ts
Comment thread projects/internals/vite/src/plugins/cem.config.mjs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 42 out of 42 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 24, 2026 04:13
@coryrylan
coryrylan force-pushed the topic-grid-api-docs branch from 4b56e54 to 9a1cba1 Compare July 24, 2026 04:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 42 out of 42 changed files in this pull request and generated 1 comment.

static styles = useStyles([styles]);

/** Applies danger styling to destructive or high-risk menu actions. */
@property({ type: String, reflect: true }) status: 'danger';
Update slot descriptions across multiple components for clarity and consistency. Enhanced documentation for slots in Accordion, Avatar, Badge, Card, Chat Message, Copy Button, Dialog, Drawer, Dropdown, Grid, Menu Item, Notification, Toast, and others to specify expected content types and usage.

Signed-off-by: Cory Rylan <crylan@nvidia.com>
@coryrylan
coryrylan force-pushed the topic-grid-api-docs branch from 9a1cba1 to 0597367 Compare July 24, 2026 18:32
Copilot AI review requested due to automatic review settings July 24, 2026 18:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 42 out of 42 changed files in this pull request and generated 1 comment.

Comment on lines +1684 to +1688
const nonPublicMemberNames = new Set(
declaration.members
?.filter(member => member.privacy != null && member.privacy !== 'public')
.map(member => member.name)
);

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
projects/internals/vite/src/plugins/cem.config.mjs (2)

1650-1662: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Attribute descriptions still missing the name/direction exclusion applied to members.

The member loop above (lines 1637-1646) excludes member.name === 'name'/'direction' before letting baseInterface overwrite the description, but this attribute loop has no matching guard. If baseInterface['name']/baseInterface['direction'] exist and typesMatch passes, the attribute description is silently overwritten with the generic base description while the corresponding member's description stays component-specific — producing inconsistent property vs. attribute docs, which runs counter to this PR's goal of consistent descriptions. This mirrors a prior review comment on this same range that was not marked as addressed.

🐛 Proposed fix
               for (const attribute of declaration.attributes ?? []) {
                 rewriteTypesText(attribute, stringLiteralsByTypeAlias);

                 if (
+                  attribute.fieldName !== 'name' &&
+                  attribute.fieldName !== 'direction' &&
                   shouldUseStandardDescription(declaration, attribute) &&
                   baseInterface[attribute.name] &&
                   baseInterface[attribute.name].docs.length &&
                   typesMatch(attribute, baseInterface[attribute.name])
                 ) {
                   attribute.description = baseInterface[attribute.name].docs[0]?.description;
                 }
                 addValueDescriptions(attribute);
               }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/internals/vite/src/plugins/cem.config.mjs` around lines 1650 - 1662,
Add the same name/direction exclusion used in the member loop to the attribute
loop before the baseInterface description overwrite in the declaration attribute
processing. Ensure attributes named "name" or "direction" retain their
component-specific descriptions, while other attributes continue using the
existing shouldUseStandardDescription, baseInterface, docs, and typesMatch
checks.

45-58: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Extract<> handling still crashes on alias false-positives and mis-splits nested generics.

Two defects from a prior unresolved review remain:

  1. text.startsWith('Extract') matches any alias merely prefixed with "Extract" (e.g. a hypothetical ExtractedType). For such text, .split(',')[1] is undefined and .trim() throws, crashing the whole packageLinkPhase.
  2. For nested-generic first operands like Extract<Record<string, Foo>, Size>, the non-global >-removal regex leaves the inner Foo> intact, and .split(',')[1] then returns the wrong fragment ("Foo>" instead of "Size"), corrupting the generated type text.
🐛 Proposed fix using bracket-aware parsing
-  if (text.startsWith('Extract')) {
-    text = text
-      .replace('Extract<', '')
-      .replace(/>(?=\s*(?:\||$))/, '')
-      .split(',')[1]
-      .trim();
-    entry.type.text = text;
-  }
+  if (/^Extract</.test(text)) {
+    const inner = text.slice(text.indexOf('<') + 1, text.lastIndexOf('>'));
+    let depth = 0;
+    let splitIndex = -1;
+    for (let i = 0; i < inner.length; i++) {
+      if (inner[i] === '<') depth++;
+      else if (inner[i] === '>') depth--;
+      else if (inner[i] === ',' && depth === 0) {
+        splitIndex = i;
+        break;
+      }
+    }
+    if (splitIndex !== -1) {
+      text = inner.slice(splitIndex + 1).trim();
+      entry.type.text = text;
+    }
+  }

Please also add regression tests covering an alias-like name (e.g. ExtractedType) and a nested-generic first operand, as previously suggested.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/internals/vite/src/plugins/cem.config.mjs` around lines 45 - 58, The
rewriteTypesText function must only process the exact Extract<> utility and
safely leave alias-like names such as ExtractedType unchanged. Replace the
string replacement and comma split with bracket-aware parsing that identifies
the top-level separator, correctly extracting the second operand from nested
generics such as Extract<Record<string, Foo>, Size> without throwing or
corrupting text. Add regression tests covering both alias-like input and
nested-generic operands.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@projects/internals/vite/src/plugins/cem.config.mjs`:
- Around line 1650-1662: Add the same name/direction exclusion used in the
member loop to the attribute loop before the baseInterface description overwrite
in the declaration attribute processing. Ensure attributes named "name" or
"direction" retain their component-specific descriptions, while other attributes
continue using the existing shouldUseStandardDescription, baseInterface, docs,
and typesMatch checks.
- Around line 45-58: The rewriteTypesText function must only process the exact
Extract<> utility and safely leave alias-like names such as ExtractedType
unchanged. Replace the string replacement and comma split with bracket-aware
parsing that identifies the top-level separator, correctly extracting the second
operand from nested generics such as Extract<Record<string, Foo>, Size> without
throwing or corrupting text. Add regression tests covering both alias-like input
and nested-generic operands.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 7893fb95-5ae4-422b-923b-367dfe4e43b1

📥 Commits

Reviewing files that changed from the base of the PR and between 9a1cba1 and 0597367.

📒 Files selected for processing (42)
  • projects/core/src/accordion/accordion.ts
  • projects/core/src/avatar/avatar-group.ts
  • projects/core/src/avatar/avatar.ts
  • projects/core/src/badge/badge.ts
  • projects/core/src/card/card.ts
  • projects/core/src/chat-message/chat-message.ts
  • projects/core/src/copy-button/copy-button.ts
  • projects/core/src/dialog/dialog.ts
  • projects/core/src/drawer/drawer.ts
  • projects/core/src/dropdown-group/dropdown-group.ts
  • projects/core/src/dropdown/dropdown.ts
  • projects/core/src/dropzone/dropzone.ts
  • projects/core/src/format-number/format-number.ts
  • projects/core/src/forms/control-message/control-message.ts
  • projects/core/src/grid/cell/cell.ts
  • projects/core/src/grid/column/column.ts
  • projects/core/src/grid/footer/footer.ts
  • projects/core/src/grid/grid.ts
  • projects/core/src/grid/placeholder/placeholder.ts
  • projects/core/src/internal/types/index.ts
  • projects/core/src/logo/logo.ts
  • projects/core/src/menu/menu-item.ts
  • projects/core/src/notification/notification.ts
  • projects/core/src/page-loader/page-loader.ts
  • projects/core/src/page/page-panel/page-panel-footer.ts
  • projects/core/src/page/page-panel/page-panel-header.ts
  • projects/core/src/page/page-panel/page-panel.ts
  • projects/core/src/pagination/pagination.ts
  • projects/core/src/preferences-input/preferences-input.ts
  • projects/core/src/progressive-filter-chip/progressive-filter-chip.ts
  • projects/core/src/skeleton/skeleton.ts
  • projects/core/src/steps/steps.ts
  • projects/core/src/tabs/tabs.ts
  • projects/core/src/tag/tag.ts
  • projects/core/src/toast/toast.ts
  • projects/core/src/toggletip/toggletip.ts
  • projects/core/src/toolbar/toolbar.ts
  • projects/core/src/tooltip/tooltip.ts
  • projects/core/src/tree/tree-node.ts
  • projects/forms/src/mixins/button.types.ts
  • projects/internals/vite/src/plugins/cem.config.mjs
  • projects/internals/vite/src/plugins/cem.test.js

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants