Skip to content

fix(mcp): resolve component tag names and add light/dark guidance to component themes - #660

Merged
simeonoff merged 10 commits into
masterfrom
simeonoff/fix/mcp-642
Nov 9, 2026
Merged

simeonoff merged 10 commits into
masterfrom
simeonoff/fix/mcp-642

Conversation

@simeonoff

@simeonoff simeonoff commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Closes #642.

  • Component tools resolve a name when it exactly matches one component's key or selector, including Angular/Web Components tags, case-insensitively, plus React (Igr*) and Blazor (Igb*) component names, which are now listed in the metadata for each component those products ship. Phrases that exactly match a key or selector (e.g. linear progress) now return the component instead of suggestions.
  • create_component_theme explains how to cover both light and dark: a second call with dark-surface token values, scoped under a dark-mode selector on a root element.

@simeonoff
simeonoff marked this pull request as ready for review November 4, 2026 08:45
@simeonoff
simeonoff requested a balanced review from Copilot November 4, 2026 14:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Dark-scope generation corrupts valid selectors containing nested or quoted commas, and the tool description incorrectly directs agents to use two calls instead of the supported both option.

2 open issues
What changed in this PR

This PR addresses #642 by expanding component-name recognition in the MCP tools and adding support and guidance for generating light and dark component themes.

Changes:

  • Adds navigation drawer aliases and resolves platform-specific component names across handlers.
  • Adds variant: "both" to generate light and scoped dark themes in CSS and Sass.
  • Updates tool guidance and tests for name resolution and dual-variant output.
File Description
packages/​mcp/​src/​utils/​types.ts Defines the component theme variant type.
packages/​mcp/​src/​utils/​sass.ts Adds dark-scope and selector-scoping helpers.
packages/​mcp/​src/​tools/​schemas.ts Accepts the "both" variant.
packages/​mcp/​src/​tools/​handlers/​layout.ts Resolves component names for layout tools.
packages/​mcp/​src/​tools/​handlers/​component-tokens.ts Resolves names before token lookup.
packages/​mcp/​src/​tools/​handlers/​component-theme.ts Resolves names and adds light/dark guidance.
packages/​mcp/​src/​tools/​descriptions.ts Documents variant options and dark scoping.
packages/​mcp/​src/​knowledge/​index.ts Exports the component-name resolver.
packages/​mcp/​src/​knowledge/​component-themes.ts Maps platform component names to canonical keys.
packages/​mcp/​src/​knowledge/​component-metadata.ts Expands navigation drawer aliases.
packages/​mcp/​src/​generators/​sass.ts Generates light and scoped dark Sass themes.
packages/​mcp/​src/​generators/​css.ts Generates dual-variant CSS output.
packages/​mcp/​src/​__tests__/​tools/​handlers/​handlers.test.ts Tests variant guidance and dual-theme output.
packages/​mcp/​src/​__tests__/​tools/​handlers/​component-tokens.test.ts Tests navigation drawer name resolution.
packages/​mcp/​src/​__tests__/​knowledge/​component-themes.test.ts Tests resolver mappings and casing behavior.
packages/​mcp/​src/​__tests__/​contract/​tool-output.test.ts Adds dual variants to compilation cases.

Review effort: Balanced

Comment thread packages/mcp/src/utils/sass.ts Resolved
Comment thread packages/mcp/src/tools/descriptions.ts Resolved
Comment thread packages/mcp/src/tools/schemas.ts Resolved
Comment thread packages/mcp/src/generators/sass.ts Resolved
Comment thread packages/mcp/src/utils/sass.ts Resolved
Comment thread packages/mcp/src/tools/descriptions.ts Resolved
Copilot AI balanced review requested due to automatic review settings November 6, 2026 12:37
@adrianptrv

Copy link
Copy Markdown
Contributor

All React and Blazor names added in the component-metadata.ts file are verified against the real components: React against the published igniteui-react packages (including grids and dock manager), Blazor against igniteui-blazor and the igniteui-blazor-examples samples. All 56 React and 55 Blazor names match exactly. The difference is the file-input component, which has no Blazor version.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The selector parser counts quoted brackets and parentheses as nesting, leaving some selectors unscoped and allowing dark tokens to apply outside the dark scope.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment thread packages/mcp/src/utils/sass.ts Resolved
Copilot AI balanced review requested due to automatic review settings November 9, 2026 11:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Quoted delimiters incorrectly alter selector nesting depth, leaving subsequent selectors unscoped and allowing generated dark-theme overrides to affect light mode.

1 open issue

Review effort: Balanced

@simeonoff simeonoff changed the title chore(mcp): add more aliases for navdrawer fix(mcp): resolve component tag names and add light/dark guidance to component themes Nov 9, 2026
@simeonoff
simeonoff requested a balanced review from Copilot November 9, 2026 14:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the component-name resolution and light/dark theme guidance changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@simeonoff
simeonoff merged commit d29c6c0 into master Nov 9, 2026
6 checks passed
@simeonoff
simeonoff deleted the simeonoff/fix/mcp-642 branch November 9, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP component tools: nav-drawer not recognized, and no light/dark guidance in create_component_theme

3 participants