Skip to content

Enhance Ignite UI documentation tools - #1778

Open
dkalinovInfra wants to merge 2 commits into
masterfrom
dkalinov/list_components_optimization
Open

Enhance Ignite UI documentation tools#1778
dkalinovInfra wants to merge 2 commits into
masterfrom
dkalinov/list_components_optimization

Conversation

@dkalinovInfra

Copy link
Copy Markdown
Contributor

Description

list_components returned every doc as a flat list with a full summary each — 17–24k tokens per unfiltered call, 77% of it the summary column, spent before any documentation is read.

This groups docs by the published documentation TOC that Infragistics already maintains (toc.yml for Angular, toc.json for the xplat platforms) and pays for one group summary instead of hundreds of per-doc ones.

Framework Before After Saving
angular ~23,968 tok ~3,961 −83%
react ~17,973 ~2,940 −84%
blazor ~16,645 ~2,814 −83%
webcomponents ~18,611 ~3,017 −84%

Coverage is 100% — every doc is reachable from the TOC in all four frameworks, so there is no "Other" bucket and no hand-curated family map. 118 groups total.

New arguments: group returns one group's docs with summaries in documentation order (an unknown value returns the valid headings, not an error); filter also matches group names; detail: "docs" reproduces the old flat list byte-for-byte. Every heading the index prints is a legal group value.

Data model: two additive tables, doc_toc and doc_groups, derived from a new dist/toc-index/<fw>.json sidecar written by the exporters. docs and docs_fts are unchanged — no reindex, no content churn.

build-db.ts is also hardened: a full rebuild now preflights all four frameworks, one transaction spans the schema changes, deletes, inserts, FTS rebuild and gates, and it builds into a temp file and renames dist/ → backend → db/ last, so any failure leaves the committed DB byte-for-byte intact. npm run release:db adds the whole-DB gates.

Related Issue

Closes #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring / code cleanup
  • Build / CI configuration change

What breaks: the default list_components shape (recoverable with detail: "docs"), and the docs-backend GET /api/docs body — the MCP renderer is now canonical and ported to C#, so local and remote return identical text. Not breaking: updating the server without the database. Verified against the published 15.5.1 DB — it renders flat everywhere, group/detail ignored.

Affected Packages

  • igniteui-cli (packages/cli)
  • @igniteui/cli-core (packages/core)
  • @igniteui/angular-templates (packages/igx-templates)
  • @igniteui/angular-schematics (packages/ng-schematics)
  • @igniteui/mcp-server (packages/igniteui-mcp)

Includes packages/igniteui-mcp/docs-backend and the shared fixtures between them.

Checklist

  • I have tested my changes locally (npm run test)
  • I have built the project successfully (npm run build)
  • I have run the linter (npm run lint)
  • I have added/updated tests as needed
  • My changes do not introduce new warnings or errors

vitest 276 passed · dotnet test 26 passed · npm run jasmine 570 specs, 11 failed — all pre-existing ig-migrate schematic failures · release:dbbuildvalidate:package all green · report:toc-coverage 0 uncovered.

Two caveats: a full npm run lint reports 12,058 errors, all from checked-out doc submodules that are in no tsconfig project — 0 in repo-owned files, pre-existing. And two jasmine failures were introduced by the wider listComponents signature (spec/unit/mcp-runtime-spec.ts called it positionally); both are fixed here.

Tests added cover the walker (the six worked examples as exact tuples, including the grid/grid.md vs accordion.md pair any depth-based implementation fails), the sidecar and collision resolver, the renderer, per-framework fallback against legacy/migrated/mixed DBs, flat-mode byte-fidelity, and build-db's destructive path (preflight, rollback, staged-validation abort, artifact preservation). Five shared fixtures are rendered by both the vitest suite and dotnet test and compared to the same expected.txt with ordinal equality — that is what stops the two renderers drifting.

Additional Context

⚠️ The database carries 125 unrelated component changes

Rebuilding surfaced that the local dist/docs_final disagrees with the shipped DB on the component column for 125 docs — e.g. excel-library-working-with-charts: WorksheetChartIgxColumnComponent. Several look like regressions from an earlier derive-components run. Unrelated to grouping, but it rides along in the committed DB. The delta is confined to that one column: row count unchanged at 1,232, no change to content, toc_name, summary, keywords or premium. Worth settling with a pipeline rerun before merge.

Other notes

  • Group summaries: 118 generated once, cached in the tracked data/group-summaries/<fw>.json. The hash covers the member list, prompt version and model, so a prompt revision cannot silently pin old output. A second run regenerated 0. Tracked, so they are reviewable and hand-editable here.
  • Angular has ~1% margin on the ≤4,000 token target (3,961). Twelve summaries overran the 160-char budget; tightening them buys back ~300 tokens.
  • CI: summary generation added to the composite action (which inlines the pipeline and never calls pipeline:*), the two new per-framework files uploaded/downloaded/flattened, assemble switched to release:db, data/group-summaries/ carried into the PR, and restore-docs-final.ts --toc-stubs round-trips a non-rebuilt framework's sidecar from the committed DB. The preflight, the release gate and the migrated DB must land together — preflight alone would break every subset rebuild.
  • Rollback: drop the two tables; the per-framework guard renders flat everywhere, identical to today.

- Updated the `list_components` constant to provide clearer descriptions and usage instructions.
- Added a new `render-components.ts` file for improved component rendering functionality.
- Created new test fixtures for filtering, flat listing, grouped indexing, single group retrieval, and handling unknown groups in the documentation.
- Included expected output files for various scenarios to ensure accurate documentation generation.
Copilot AI lite review requested due to automatic review settings August 26, 2026 10:38

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.

Pull request overview

This PR updates the Ignite UI documentation MCP tooling (and the docs-backend it can proxy to) so list_components is TOC-grouped by default, drastically reducing response size while adding targeted narrowing via group, filter, and detail: "docs" for the legacy flat output. It also introduces TOC sidecar ingestion + group summaries into the DB build pipeline, and adds shared fixtures to keep the TypeScript and C# renderers byte-identical.

Changes:

  • Add TOC-driven grouping (new doc_toc / doc_groups) and renderer modes for list_components (grouped index, single-group, legacy flat).
  • Add exporter-side TOC walker + sidecar generation, plus cached group summary generation and release/validation gates.
  • Add comprehensive cross-runtime tests (Vitest + .NET) pinned to shared fixtures, and CI wiring to ship sidecar/summaries.

Reviewed changes

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

Show a summary per file
File Description
packages/igniteui-mcp/shared-fixtures/list-components/unknown-group/input.json Shared fixture input for unknown-group behavior.
packages/igniteui-mcp/shared-fixtures/list-components/unknown-group/expected.txt Expected unknown-group rendering text.
packages/igniteui-mcp/shared-fixtures/list-components/single-group/input.json Shared fixture input for single-group mode.
packages/igniteui-mcp/shared-fixtures/list-components/single-group/expected.txt Expected single-group rendering text.
packages/igniteui-mcp/shared-fixtures/list-components/grouped-index/input.json Shared fixture input for grouped index mode.
packages/igniteui-mcp/shared-fixtures/list-components/grouped-index/expected.txt Expected grouped index rendering text.
packages/igniteui-mcp/shared-fixtures/list-components/flat/input.json Shared fixture input for legacy flat mode (detail: "docs").
packages/igniteui-mcp/shared-fixtures/list-components/flat/expected.txt Expected legacy flat rendering text.
packages/igniteui-mcp/shared-fixtures/list-components/filtered/input.json Shared fixture input for grouped filtering behavior.
packages/igniteui-mcp/shared-fixtures/list-components/filtered/expected.txt Expected grouped filtering rendering text.
packages/igniteui-mcp/igniteui-doc-mcp/src/tools/constants.ts Update tool help text to describe new grouped behaviors/args.
packages/igniteui-mcp/igniteui-doc-mcp/src/providers/RemoteDocsProvider.ts Forward filter/group/detail to remote backend /api/docs.
packages/igniteui-mcp/igniteui-doc-mcp/src/providers/LocalDocsProvider.ts Implement grouped/flat modes locally with TOC-table presence guards.
packages/igniteui-mcp/igniteui-doc-mcp/src/providers/DocsProvider.ts Introduce ListComponentsOptions and update provider interface.
packages/igniteui-mcp/igniteui-doc-mcp/src/index.ts Expose new list_components arguments via MCP tool schema/handler.
packages/igniteui-mcp/igniteui-doc-mcp/src/tests/tools/render-components.test.ts Unit tests for grouped renderer behavior and thresholds.
packages/igniteui-mcp/igniteui-doc-mcp/src/tests/shared/list-fixtures.ts Helper to render shared fixtures through LocalDocsProvider.
packages/igniteui-mcp/igniteui-doc-mcp/src/tests/shared/list-fixtures.test.ts Shared fixture golden tests (ordinal compare).
packages/igniteui-mcp/igniteui-doc-mcp/src/tests/scripts/toc-sidecar.test.ts Tests for sidecar writing and collision handling.
packages/igniteui-mcp/igniteui-doc-mcp/src/tests/scripts/toc-index.test.ts Tests for TOC walking/grouping rules (yaml/json, exclusions).
packages/igniteui-mcp/igniteui-doc-mcp/src/tests/scripts/build-db.test.ts Destructive-path tests for build-db staging, rollback, gates.
packages/igniteui-mcp/igniteui-doc-mcp/src/tests/providers/RemoteDocsProvider.test.ts Tests for remote query param forwarding.
packages/igniteui-mcp/igniteui-doc-mcp/src/tests/providers/LocalDocsProvider.list.test.ts Tests for local grouped modes + flat-mode byte fidelity.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/validate-package.ts Add validation that shipped DB is fully grouped + summaries present.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/restore-docs-final.ts Add --toc-stubs support to restore TOC sidecar from committed DB.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/report-toc-coverage.ts Add reporting tool for per-framework TOC coverage and summary gaps.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/lib/toc-sidecar.ts Add sidecar writer + safer filename collision resolution.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/lib/toc-index.ts Add shared TOC walker implementing grouping derivation rules.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/lib/list-fixtures.ts Loader utilities for shared list-components fixtures.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/lib/frontmatter.ts Shared frontmatter parser used by build-group-summaries/build-db.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/export-wc-docs.ts Export WC docs via TOC walker + write sidecar records.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/export-react-docs.ts Export React docs via TOC walker + write sidecar records.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/export-blazor-docs.ts Export Blazor docs via TOC walker + write sidecar records.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/export-angular-docs.ts Export Angular docs via TOC walker + write sidecar records.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/build-group-summaries.ts Generate/cached one-line summaries per TOC group.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/build-db.ts Ingest TOC sidecar + summaries; harden build with staging + gates.
packages/igniteui-mcp/igniteui-doc-mcp/package.json Add scripts for release DB build, toc coverage, and summaries.
packages/igniteui-mcp/igniteui-doc-mcp/docs/knowledgebase.md Document the TOC-grouping rules and build-db invariants.
packages/igniteui-mcp/igniteui-doc-mcp/data/group-summaries/webcomponents.json Cached group summaries (WC).
packages/igniteui-mcp/igniteui-doc-mcp/data/group-summaries/react.json Cached group summaries (React).
packages/igniteui-mcp/igniteui-doc-mcp/data/group-summaries/blazor.json Cached group summaries (Blazor).
packages/igniteui-mcp/igniteui-doc-mcp/data/group-summaries/angular.json Cached group summaries (Angular).
packages/igniteui-mcp/igniteui-doc-mcp/CLAUDE.md Update internal repo guidance to include grouping + new scripts.
packages/igniteui-mcp/igniteui-doc-mcp/CHANGELOG.md Document the breaking/default output change and new build gates.
packages/igniteui-mcp/docs-backend/tests-docs-backend/tests-docs-backend.csproj Include shared fixtures in test output for backend comparisons.
packages/igniteui-mcp/docs-backend/tests-docs-backend/ListFixtureTests.cs Add shared fixture golden tests for backend renderer.
packages/igniteui-mcp/docs-backend/tests-docs-backend/DocsControllerTests.cs Update controller tests for new flat output strings/behavior.
packages/igniteui-mcp/docs-backend/docs-backend/Controllers/DocsController.cs Implement grouped list endpoint (filter/group/detail) with fallback.
packages/igniteui-mcp/docs-backend/docs-backend/ComponentRenderer.cs Add C# renderer port intended to match TS output exactly.
packages/igniteui-mcp/.gitattributes Pin LF line endings for shared fixture files.
eslint.config.mjs Exclude doc-mcp test tree from typed linting (no project).
.github/workflows/build-docs-db.yml Download toc-index/summaries artifacts; build via release:db; publish summaries.
.github/actions/build-framework-docs/action.yml Generate summaries and upload toc-index + summaries artifacts per framework.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/igniteui-mcp/docs-backend/docs-backend/ComponentRenderer.cs Outdated
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 87.816%. remained the same — dkalinov/list_components_optimization into master

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.

3 participants