Skip to content

docs(ui-kit/react): reconcile contradictory plugin precedence (ENG-37996) - #463

Open
raj-dubey1 wants to merge 1 commit into
mainfrom
docs/react-ui-kit-plugin-precedence
Open

docs(ui-kit/react): reconcile contradictory plugin precedence (ENG-37996)#463
raj-dubey1 wants to merge 1 commit into
mainfrom
docs/react-ui-kit-plugin-precedence

Conversation

@raj-dubey1

Copy link
Copy Markdown
Contributor

What & why

Fixes ENG-37996 — the React UI Kit v7 plugin docs contradicted each other on whether a custom plugin overrides a built-in one:

File Claimed
ui-kit/react/plugins/overview.mdx custom plugins "appended after the defaults", "default plugins keep priority" ❌
ui-kit/react/plugins/custom-plugin.mdx "appended after the default plugins… default plugins handle their types first" ❌
ui-kit/react/plugins/text-formatters.mdx "prepended before the defaults… takes precedence (first match wins)" ✅

Two pages said defaults win; one said the custom plugin wins. Since resolution is explicitly "first match wins", they can't all be true.

Ground truth (verified against the shipped package)

Confirmed against @cometchat/chat-uikit-react v7.1.0 (npm tarball), not inference:

  • CometChatProvider builds the registry as [...plugins, ...defaultPlugins]user-supplied plugins come first, defaults after (dist/index.js:6099).
  • CometChatPluginRegistry resolves a message with .find(...)first match wins, scanning from index 0 (dist/index.js:350).

So custom plugins are prepended and do take precedence. text-formatters.mdx was the correct page; overview.mdx and custom-plugin.mdx were wrong.

Changes

  • overview.mdx — "Adding Plugins" now says custom plugins are prepended and take priority (enabling override of a built-in by declaring the same messageTypes/messageCategories); added a resolution note that precedence is by plugin order + messageTypes/messageCategories, not id.
  • custom-plugin.mdx — Step 2 explanation corrected to "prepended before the defaults", with a note on how to override a built-in type.
  • text-formatters.mdx — already correct; added a missing trailing period only.

Scope / notes

  • Docs-only; no other pages made the stale claim (grepped the repo).
  • The one open item from the ticket handled here is the contradiction + id clarification. The remaining ticket recommendations (index the v7 source into the KB, boost v7 doc ranking, update the validation critic's ground-truth) are AI-knowledge-base tasks, not docs edits, and are out of scope for this PR.

🤖 Generated with Claude Code

…996)

The v7 plugin docs contradicted each other on whether custom plugins
override built-in ones. overview.mdx and custom-plugin.mdx claimed custom
plugins are "appended after the defaults" so "default plugins keep
priority", while text-formatters.mdx claimed they are "prepended before
the defaults" and take precedence.

Verified against the shipped @cometchat/chat-uikit-react v7.1.0 source:
- CometChatProvider builds `[...plugins, ...defaultPlugins]` (user plugins first)
- CometChatPluginRegistry resolves with `.find()` (first match wins)

So custom plugins ARE prepended and DO take precedence — text-formatters.mdx
was correct. Fix overview.mdx and custom-plugin.mdx to match, and add a note
that precedence is by plugin order + messageTypes/messageCategories, not `id`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mintlify

mintlify Bot commented Aug 7, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
cometchat 🟢 Ready View Preview Aug 7, 2026, 3:26 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants