@cometchat/skills 4.4.2 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +55 -0
- package/.claude-plugin/plugin.json +14 -0
- package/CHANGELOG.md +36 -0
- package/LICENSE +21 -0
- package/README.md +41 -163
- package/RULES.md +114 -0
- package/bin/cometchat-skills.mjs +1180 -0
- package/bin/legacy-skills.json +95 -0
- package/catalogs/android-v6.json +1646 -0
- package/catalogs/flutter-v6.json +651 -0
- package/catalogs/ios-v5.json +1383 -0
- package/catalogs/rn-calls-v5.json +134 -0
- package/catalogs/rn-calls-v5.symbols.txt +58 -0
- package/catalogs/rn-sdk-v4.json +672 -0
- package/catalogs/rn-v5.json +449 -0
- package/catalogs/rn-v5.symbols.txt +216 -0
- package/catalogs/sdk-android-v5.json +514 -0
- package/contracts.android-calls-v5.json +122 -0
- package/contracts.android-v6.json +135 -0
- package/contracts.angular-v5.json +694 -0
- package/contracts.flutter-calls-v5.json +77 -0
- package/contracts.flutter-v6.json +126 -0
- package/contracts.ios-calls-v5.json +67 -0
- package/contracts.ios-v5.json +436 -0
- package/contracts.json +82 -0
- package/contracts.rn-calls-v5.json +77 -0
- package/contracts.rn-v5.json +727 -0
- package/contracts.sdk-android-v5.json +15 -0
- package/contracts.web-calls-v5.json +45 -0
- package/features.android-calls-v5.json +246 -0
- package/features.android-v6.json +65 -0
- package/features.angular-v5.json +521 -0
- package/features.flutter-calls-v5.json +286 -0
- package/features.flutter-v6.json +484 -0
- package/features.ios-calls-v5.json +236 -0
- package/features.ios-v5.json +573 -0
- package/features.json +61 -0
- package/features.rn-calls-v5.json +187 -0
- package/features.rn-v5.json +614 -0
- package/features.sdk-android-v5.json +40 -0
- package/features.sdk-jsv4.json +24 -0
- package/features.web-calls-v5.json +108 -0
- package/package.json +151 -74
- package/peers.yaml +312 -0
- package/registry/README.md +31 -0
- package/registry/android-calls-v5.json +54 -0
- package/registry/android-v6.json +137 -0
- package/registry/angular-v5.json +114 -0
- package/registry/flutter-calls-v5.json +54 -0
- package/registry/flutter-v6.json +119 -0
- package/registry/ios-calls-v5.json +59 -0
- package/registry/ios-v5.json +97 -0
- package/registry/rn-calls-v5.json +59 -0
- package/registry/rn-v5.json +129 -0
- package/registry/sdk-android-v5.json +53 -0
- package/registry/sdk-jsv4.json +53 -0
- package/registry/web-calls-v5.json +54 -0
- package/registry/web-v7.json +99 -0
- package/skills/cometchat/SKILL.md +42 -2096
- package/skills/cometchat-android-v5-calls-sdk/SKILL.md +206 -0
- package/skills/cometchat-android-v5-calls-sdk/references/build-truth.md +63 -0
- package/skills/cometchat-android-v5-calls-sdk/references/docs-map.md +119 -0
- package/skills/cometchat-android-v5-calls-sdk/references/method-map.md +53 -0
- package/skills/cometchat-android-v5-calls-sdk/references/pitfalls.md +72 -0
- package/skills/cometchat-android-v5-calls-sdk/references/ringing.md +92 -0
- package/skills/cometchat-android-v5-calls-sdk/references/user-switch.md +90 -0
- package/skills/cometchat-android-v5-sdk/SKILL.md +127 -0
- package/skills/cometchat-android-v5-sdk/references/app-surface.md +88 -0
- package/skills/cometchat-android-v5-sdk/references/docs-map.md +91 -0
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +51 -137
- package/skills/cometchat-android-v6-calls/SKILL.md +128 -413
- package/skills/cometchat-android-v6-compose-components/SKILL.md +84 -194
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +66 -411
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +154 -237
- package/skills/cometchat-android-v6-core/SKILL.md +236 -672
- package/skills/cometchat-android-v6-core/references/anti-patterns.md +31 -0
- package/skills/cometchat-android-v6-core/references/component-props.md +168 -0
- package/skills/cometchat-android-v6-core/references/docs-map.md +153 -0
- package/skills/cometchat-android-v6-core/references/layout.md +112 -0
- package/skills/cometchat-android-v6-core/references/lifecycle.md +75 -0
- package/skills/cometchat-android-v6-core/references/setup-credentials.md +105 -0
- package/skills/cometchat-android-v6-core/references/troubleshooting.md +36 -0
- package/skills/cometchat-android-v6-events/SKILL.md +46 -184
- package/skills/cometchat-android-v6-extensions/SKILL.md +39 -179
- package/skills/cometchat-android-v6-features/SKILL.md +74 -143
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +75 -193
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +67 -419
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +77 -223
- package/skills/cometchat-android-v6-migration/SKILL.md +67 -378
- package/skills/cometchat-android-v6-production/SKILL.md +40 -179
- package/skills/cometchat-android-v6-push/SKILL.md +39 -289
- package/skills/cometchat-android-v6-testing/SKILL.md +50 -265
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +70 -254
- package/skills/cometchat-angular-v5-calls/SKILL.md +193 -0
- package/skills/cometchat-angular-v5-components/SKILL.md +131 -0
- package/skills/cometchat-angular-v5-components/references/catalog.md +111 -0
- package/skills/cometchat-angular-v5-components/references/host-composed.md +46 -0
- package/skills/cometchat-angular-v5-core/SKILL.md +300 -0
- package/skills/cometchat-angular-v5-core/references/anti-patterns.md +49 -0
- package/skills/cometchat-angular-v5-core/references/component-props.md +55 -0
- package/skills/cometchat-angular-v5-core/references/dependencies.md +66 -0
- package/skills/cometchat-angular-v5-core/references/docs-map.md +132 -0
- package/skills/cometchat-angular-v5-core/references/layout.md +64 -0
- package/skills/cometchat-angular-v5-core/references/lifecycle.md +202 -0
- package/skills/cometchat-angular-v5-core/references/setup-credentials.md +137 -0
- package/skills/cometchat-angular-v5-core/references/theming.md +70 -0
- package/skills/cometchat-angular-v5-core/references/troubleshooting.md +27 -0
- package/skills/cometchat-angular-v5-customization/SKILL.md +94 -0
- package/skills/cometchat-angular-v5-features/SKILL.md +107 -0
- package/skills/cometchat-angular-v5-features/references/custom-messages.md +133 -0
- package/skills/cometchat-angular-v5-features/references/formatters.md +28 -0
- package/skills/cometchat-angular-v5-features/references/host-composed-extensions.md +85 -0
- package/skills/cometchat-angular-v5-migration/SKILL.md +40 -0
- package/skills/cometchat-angular-v5-migration/references/migration-guide.md +165 -0
- package/skills/cometchat-angular-v5-patterns/SKILL.md +107 -0
- package/skills/cometchat-angular-v5-placement/SKILL.md +133 -0
- package/skills/cometchat-angular-v5-placement/references/combined-app.md +174 -0
- package/skills/cometchat-angular-v5-placement/references/core-surface.md +199 -0
- package/skills/cometchat-angular-v5-production/SKILL.md +101 -0
- package/skills/cometchat-angular-v5-push/SKILL.md +61 -0
- package/skills/cometchat-angular-v5-testing/SKILL.md +112 -0
- package/skills/cometchat-angular-v5-troubleshooting/SKILL.md +96 -0
- package/skills/cometchat-flutter-v5-sdk/SKILL.md +188 -0
- package/skills/cometchat-flutter-v5-sdk/references/doc-corrections.md +55 -0
- package/skills/cometchat-flutter-v5-sdk/references/docs-map.md +211 -0
- package/skills/cometchat-flutter-v5-sdk/references/platform-notes.md +48 -0
- package/skills/cometchat-flutter-v5-sdk/references/transcription.md +87 -0
- package/skills/cometchat-flutter-v6-calls/SKILL.md +75 -389
- package/skills/cometchat-flutter-v6-components/SKILL.md +88 -361
- package/skills/cometchat-flutter-v6-core/SKILL.md +154 -593
- package/skills/cometchat-flutter-v6-core/references/anti-patterns.md +55 -0
- package/skills/cometchat-flutter-v6-core/references/docs-map.md +143 -0
- package/skills/cometchat-flutter-v6-core/references/layout.md +45 -0
- package/skills/cometchat-flutter-v6-core/references/lifecycle.md +87 -0
- package/skills/cometchat-flutter-v6-core/references/setup-credentials.md +84 -0
- package/skills/cometchat-flutter-v6-core/references/troubleshooting.md +26 -0
- package/skills/cometchat-flutter-v6-customization/SKILL.md +70 -712
- package/skills/cometchat-flutter-v6-events/SKILL.md +79 -174
- package/skills/cometchat-flutter-v6-features/SKILL.md +55 -394
- package/skills/cometchat-flutter-v6-migration/SKILL.md +68 -367
- package/skills/cometchat-flutter-v6-migration/references/migration-guide.md +131 -0
- package/skills/cometchat-flutter-v6-patterns/SKILL.md +61 -0
- package/skills/cometchat-flutter-v6-placement/SKILL.md +94 -381
- package/skills/cometchat-flutter-v6-production/SKILL.md +58 -615
- package/skills/cometchat-flutter-v6-push/SKILL.md +46 -455
- package/skills/cometchat-flutter-v6-testing/SKILL.md +68 -299
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +54 -878
- package/skills/cometchat-ios-calls/SKILL.md +112 -563
- package/skills/cometchat-ios-components/SKILL.md +44 -834
- package/skills/cometchat-ios-core/SKILL.md +181 -1068
- package/skills/cometchat-ios-core/references/anti-patterns.md +80 -0
- package/skills/cometchat-ios-core/references/docs-map.md +123 -0
- package/skills/cometchat-ios-core/references/install.md +23 -0
- package/skills/cometchat-ios-core/references/layout.md +186 -0
- package/skills/cometchat-ios-core/references/setup-credentials.md +197 -0
- package/skills/cometchat-ios-core/references/swiftui.md +91 -0
- package/skills/cometchat-ios-core/references/troubleshooting.md +100 -0
- package/skills/cometchat-ios-customization/SKILL.md +33 -968
- package/skills/cometchat-ios-features/SKILL.md +29 -738
- package/skills/cometchat-ios-migration/SKILL.md +39 -0
- package/skills/cometchat-ios-placement/SKILL.md +51 -729
- package/skills/cometchat-ios-push/SKILL.md +24 -602
- package/skills/cometchat-ios-v5-sdk/SKILL.md +161 -0
- package/skills/cometchat-ios-v5-sdk/references/docs-map.md +326 -0
- package/skills/cometchat-js-v5-sdk/SKILL.md +95 -0
- package/skills/cometchat-js-v5-sdk/references/docs-map.md +114 -0
- package/skills/cometchat-onboarding/SKILL.md +89 -0
- package/skills/cometchat-onboarding/references/archetypes.md +51 -0
- package/skills/cometchat-onboarding/references/calling-first.md +77 -0
- package/skills/cometchat-onboarding/references/not-in-this-pack.md +8 -0
- package/skills/cometchat-onboarding/references/plan-artifact.md +133 -0
- package/skills/cometchat-onboarding/references/platforms.md +90 -0
- package/skills/cometchat-react-native-bare-patterns/SKILL.md +120 -0
- package/skills/cometchat-react-native-calls/SKILL.md +200 -0
- package/skills/cometchat-react-native-components/SKILL.md +142 -0
- package/skills/cometchat-react-native-core/SKILL.md +313 -0
- package/skills/cometchat-react-native-core/references/anti-patterns.md +79 -0
- package/skills/cometchat-react-native-core/references/component-props.md +105 -0
- package/skills/cometchat-react-native-core/references/dependencies.md +62 -0
- package/skills/cometchat-react-native-core/references/docs-map.md +126 -0
- package/skills/cometchat-react-native-core/references/layout.md +61 -0
- package/skills/cometchat-react-native-core/references/lifecycle.md +64 -0
- package/skills/cometchat-react-native-core/references/setup-credentials.md +39 -0
- package/skills/cometchat-react-native-customization/SKILL.md +198 -0
- package/skills/cometchat-react-native-expo-patterns/SKILL.md +116 -0
- package/skills/cometchat-react-native-features/SKILL.md +122 -0
- package/skills/cometchat-react-native-migration/SKILL.md +103 -0
- package/skills/cometchat-react-native-placement/SKILL.md +158 -0
- package/skills/cometchat-react-native-production/SKILL.md +78 -0
- package/skills/cometchat-react-native-push/SKILL.md +88 -0
- package/skills/cometchat-react-native-sdk/SKILL.md +126 -0
- package/skills/cometchat-react-native-sdk/references/method-map.md +239 -0
- package/skills/cometchat-react-native-sdk/references/page-map.md +96 -0
- package/skills/cometchat-react-native-testing/SKILL.md +94 -0
- package/skills/cometchat-react-native-troubleshooting/SKILL.md +116 -0
- package/skills/cometchat-react-native-v5-sdk/SKILL.md +150 -0
- package/skills/cometchat-react-native-v5-sdk/references/docs-map.md +127 -0
- package/skills/cometchat-react-native-v5-sdk/references/ringing-voip.md +369 -0
- package/skills/cometchat-react-v7-calls/SKILL.md +75 -0
- package/skills/cometchat-react-v7-components/SKILL.md +72 -0
- package/skills/cometchat-react-v7-core/SKILL.md +101 -0
- package/skills/cometchat-react-v7-core/references/anti-patterns.md +19 -0
- package/skills/cometchat-react-v7-core/references/component-props.md +82 -0
- package/skills/cometchat-react-v7-core/references/dependencies.md +23 -0
- package/skills/cometchat-react-v7-core/references/docs-map.md +117 -0
- package/skills/cometchat-react-v7-core/references/i18n-rtl-a11y.md +22 -0
- package/skills/cometchat-react-v7-core/references/layout.md +158 -0
- package/skills/cometchat-react-v7-core/references/lifecycle.md +74 -0
- package/skills/cometchat-react-v7-core/references/setup-credentials.md +58 -0
- package/skills/cometchat-react-v7-core/references/ssr.md +11 -0
- package/skills/cometchat-react-v7-core/references/theming.md +52 -0
- package/skills/cometchat-react-v7-core/references/troubleshooting.md +28 -0
- package/skills/cometchat-react-v7-customization/SKILL.md +84 -0
- package/skills/cometchat-react-v7-features/SKILL.md +92 -0
- package/skills/cometchat-react-v7-migration/SKILL.md +39 -0
- package/skills/cometchat-react-v7-migration/references/migration-guide.md +119 -0
- package/skills/cometchat-react-v7-patterns/SKILL.md +43 -0
- package/skills/cometchat-react-v7-placement/SKILL.md +106 -0
- package/skills/cometchat-react-v7-placement/references/recipes.md +354 -0
- package/skills/cometchat-react-v7-push/SKILL.md +53 -0
- package/test-suite/README.md +70 -0
- package/test-suite/catalogs/android-calls-v5.json +830 -0
- package/test-suite/catalogs/android-calls-v5.symbols.txt +499 -0
- package/test-suite/catalogs/android-v6.json +1646 -0
- package/test-suite/catalogs/android-v6.symbols.txt +298 -0
- package/test-suite/catalogs/angular-v5.json +7587 -0
- package/test-suite/catalogs/flutter-calls-v5.json +196 -0
- package/test-suite/catalogs/flutter-calls-v5.symbols.txt +59 -0
- package/test-suite/catalogs/flutter-v6.json +651 -0
- package/test-suite/catalogs/ios-calls-v5.json +158 -0
- package/test-suite/catalogs/ios-calls-v5.symbols.txt +70 -0
- package/test-suite/catalogs/ios-v5.json +1383 -0
- package/test-suite/catalogs/ios-v5.symbols.txt +699 -0
- package/test-suite/catalogs/rn-calls-v5.json +134 -0
- package/test-suite/catalogs/rn-sdk-v4.json +672 -0
- package/test-suite/catalogs/rn-v5.json +449 -0
- package/test-suite/catalogs/sdk-android-v5.json +514 -0
- package/test-suite/catalogs/sdk-android-v5.symbols.txt +254 -0
- package/test-suite/catalogs/sdk-jsv4.json +800 -0
- package/test-suite/catalogs/web-calls-v5.json +195 -0
- package/test-suite/catalogs/web-v7.json +1243 -0
- package/test-suite/scripts/build-registry.mjs +113 -0
- package/test-suite/scripts/catalog-refresh-dart.mjs +151 -0
- package/test-suite/scripts/catalog-refresh.mjs +100 -0
- package/test-suite/scripts/lint-skills.mjs +909 -0
- package/test-suite/scripts/measure-tokens.mjs +169 -0
- package/test-suite/scripts/typecheck-fences-dart.mjs +437 -0
- package/test-suite/scripts/typecheck-fences-kotlin.mjs +269 -0
- package/test-suite/scripts/typecheck-fences.mjs +206 -0
- package/test-suite/scripts/verify-catalog.mjs +242 -0
- package/test-suite/scripts/verify-contract-fences.mjs +94 -0
- package/test-suite/scripts/verify-detection.mjs +178 -0
- package/test-suite/scripts/verify-docs-base.mjs +91 -0
- package/test-suite/scripts/verify-family-agnostic.mjs +130 -0
- package/test-suite/scripts/verify-golden-path.mjs +138 -0
- package/test-suite/scripts/verify-oracle-components.mjs +133 -0
- package/test-suite/scripts/verify-template-bindings.mjs +148 -0
- package/test-suite/typecheck/angular-v5/package.json +21 -0
- package/test-suite/typecheck/angular-v5/tsconfig.json +21 -0
- package/test-suite/typecheck/flutter-v6/analysis_options.yaml +25 -0
- package/test-suite/typecheck/flutter-v6/pubspec.yaml +21 -0
- package/test-suite/typecheck/web-v7/package.json +18 -0
- package/test-suite/typecheck/web-v7/tsconfig.json +19 -0
- package/bin/install.js +0 -1003
- package/skills/.claude-plugin/marketplace.json +0 -86
- package/skills/cometchat/references/asking-questions.md +0 -48
- package/skills/cometchat-a11y/SKILL.md +0 -477
- package/skills/cometchat-android-v5/SKILL.md +0 -121
- package/skills/cometchat-android-v5-calls/SKILL.md +0 -429
- package/skills/cometchat-android-v5-calls/references/README.md +0 -53
- package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +0 -197
- package/skills/cometchat-android-v5-calls/references/audio-controls.md +0 -91
- package/skills/cometchat-android-v5-calls/references/background-handling.md +0 -168
- package/skills/cometchat-android-v5-calls/references/call-layouts.md +0 -131
- package/skills/cometchat-android-v5-calls/references/call-logs.md +0 -113
- package/skills/cometchat-android-v5-calls/references/call-session.md +0 -274
- package/skills/cometchat-android-v5-calls/references/custom-ui.md +0 -150
- package/skills/cometchat-android-v5-calls/references/event-listeners.md +0 -123
- package/skills/cometchat-android-v5-calls/references/group-calls.md +0 -205
- package/skills/cometchat-android-v5-calls/references/idle-timeout.md +0 -117
- package/skills/cometchat-android-v5-calls/references/in-call-chat.md +0 -134
- package/skills/cometchat-android-v5-calls/references/join-session.md +0 -120
- package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +0 -222
- package/skills/cometchat-android-v5-calls/references/participant-management.md +0 -110
- package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +0 -106
- package/skills/cometchat-android-v5-calls/references/raise-hand.md +0 -248
- package/skills/cometchat-android-v5-calls/references/recording.md +0 -101
- package/skills/cometchat-android-v5-calls/references/ringing-integration.md +0 -152
- package/skills/cometchat-android-v5-calls/references/screen-sharing.md +0 -78
- package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +0 -215
- package/skills/cometchat-android-v5-calls/references/session-settings.md +0 -121
- package/skills/cometchat-android-v5-calls/references/setup.md +0 -137
- package/skills/cometchat-android-v5-calls/references/share-invite.md +0 -156
- package/skills/cometchat-android-v5-calls/references/video-controls.md +0 -87
- package/skills/cometchat-android-v5-calls/references/voip-calling.md +0 -526
- package/skills/cometchat-android-v5-components/SKILL.md +0 -431
- package/skills/cometchat-android-v5-core/SKILL.md +0 -486
- package/skills/cometchat-android-v5-customization/SKILL.md +0 -469
- package/skills/cometchat-android-v5-extensions/SKILL.md +0 -127
- package/skills/cometchat-android-v5-features/SKILL.md +0 -131
- package/skills/cometchat-android-v5-placement/SKILL.md +0 -277
- package/skills/cometchat-android-v5-production/SKILL.md +0 -95
- package/skills/cometchat-android-v5-push/SKILL.md +0 -619
- package/skills/cometchat-android-v5-testing/SKILL.md +0 -188
- package/skills/cometchat-android-v5-theming/SKILL.md +0 -167
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +0 -74
- package/skills/cometchat-android-v6/SKILL.md +0 -108
- package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +0 -97
- package/skills/cometchat-android-v6-calls/references/advanced-features.md +0 -87
- package/skills/cometchat-android-v6-calls/references/call-layouts.md +0 -100
- package/skills/cometchat-android-v6-calls/references/call-session.md +0 -163
- package/skills/cometchat-android-v6-calls/references/device-management.md +0 -172
- package/skills/cometchat-android-v6-calls/references/group-calls.md +0 -191
- package/skills/cometchat-android-v6-calls/references/idle-timeout.md +0 -110
- package/skills/cometchat-android-v6-calls/references/in-call-chat.md +0 -141
- package/skills/cometchat-android-v6-calls/references/raise-hand.md +0 -188
- package/skills/cometchat-android-v6-calls/references/ringing-integration.md +0 -176
- package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +0 -127
- package/skills/cometchat-android-v6-calls/references/share-invite.md +0 -105
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +0 -250
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +0 -233
- package/skills/cometchat-angular-calls/SKILL.md +0 -380
- package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +0 -96
- package/skills/cometchat-angular-calls/references/call-layouts.md +0 -123
- package/skills/cometchat-angular-calls/references/call-session.md +0 -167
- package/skills/cometchat-angular-calls/references/custom-ui.md +0 -239
- package/skills/cometchat-angular-calls/references/device-management.md +0 -154
- package/skills/cometchat-angular-calls/references/group-calls.md +0 -433
- package/skills/cometchat-angular-calls/references/idle-timeout.md +0 -161
- package/skills/cometchat-angular-calls/references/in-call-chat.md +0 -148
- package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +0 -205
- package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +0 -53
- package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +0 -184
- package/skills/cometchat-angular-calls/references/picture-in-picture.md +0 -285
- package/skills/cometchat-angular-calls/references/raise-hand.md +0 -172
- package/skills/cometchat-angular-calls/references/recording-screen-share.md +0 -260
- package/skills/cometchat-angular-calls/references/ringing-integration.md +0 -133
- package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +0 -100
- package/skills/cometchat-angular-calls/references/share-invite.md +0 -122
- package/skills/cometchat-angular-calls/references/virtual-background.md +0 -29
- package/skills/cometchat-angular-components/SKILL.md +0 -235
- package/skills/cometchat-angular-core/SKILL.md +0 -386
- package/skills/cometchat-angular-customization/SKILL.md +0 -616
- package/skills/cometchat-angular-features/SKILL.md +0 -329
- package/skills/cometchat-angular-patterns/SKILL.md +0 -256
- package/skills/cometchat-angular-placement/SKILL.md +0 -314
- package/skills/cometchat-angular-production/SKILL.md +0 -564
- package/skills/cometchat-angular-push/SKILL.md +0 -389
- package/skills/cometchat-angular-testing/SKILL.md +0 -605
- package/skills/cometchat-angular-theming/SKILL.md +0 -290
- package/skills/cometchat-angular-troubleshooting/SKILL.md +0 -364
- package/skills/cometchat-astro-patterns/SKILL.md +0 -708
- package/skills/cometchat-calls/SKILL.md +0 -364
- package/skills/cometchat-calls/references/use-case-broadcast.md +0 -199
- package/skills/cometchat-calls/references/use-case-marketplace.md +0 -157
- package/skills/cometchat-calls/references/use-case-support.md +0 -189
- package/skills/cometchat-calls/references/use-case-team.md +0 -180
- package/skills/cometchat-calls/references/use-case-telehealth.md +0 -153
- package/skills/cometchat-components/SKILL.md +0 -1142
- package/skills/cometchat-core/SKILL.md +0 -1048
- package/skills/cometchat-customization/SKILL.md +0 -580
- package/skills/cometchat-customization/references/component-catalog.md +0 -236
- package/skills/cometchat-features/SKILL.md +0 -861
- package/skills/cometchat-flutter-v5/SKILL.md +0 -173
- package/skills/cometchat-flutter-v5-calls/SKILL.md +0 -455
- package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +0 -193
- package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +0 -103
- package/skills/cometchat-flutter-v5-calls/references/call-session.md +0 -285
- package/skills/cometchat-flutter-v5-calls/references/device-management.md +0 -124
- package/skills/cometchat-flutter-v5-calls/references/group-calls.md +0 -181
- package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +0 -99
- package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +0 -135
- package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +0 -210
- package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +0 -255
- package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +0 -196
- package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +0 -101
- package/skills/cometchat-flutter-v5-calls/references/share-invite.md +0 -148
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +0 -118
- package/skills/cometchat-flutter-v5-core/SKILL.md +0 -239
- package/skills/cometchat-flutter-v5-customization/SKILL.md +0 -358
- package/skills/cometchat-flutter-v5-events/SKILL.md +0 -156
- package/skills/cometchat-flutter-v5-messages/SKILL.md +0 -259
- package/skills/cometchat-flutter-v5-production/SKILL.md +0 -216
- package/skills/cometchat-flutter-v5-push/SKILL.md +0 -285
- package/skills/cometchat-flutter-v5-testing/SKILL.md +0 -401
- package/skills/cometchat-flutter-v5-theming/SKILL.md +0 -161
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +0 -130
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +0 -152
- package/skills/cometchat-flutter-v6/SKILL.md +0 -446
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +0 -136
- package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +0 -89
- package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +0 -105
- package/skills/cometchat-flutter-v6-calls/references/call-session.md +0 -229
- package/skills/cometchat-flutter-v6-calls/references/device-management.md +0 -105
- package/skills/cometchat-flutter-v6-calls/references/group-calls.md +0 -190
- package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +0 -88
- package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +0 -125
- package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +0 -275
- package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +0 -171
- package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +0 -93
- package/skills/cometchat-flutter-v6-calls/references/share-invite.md +0 -102
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +0 -238
- package/skills/cometchat-flutter-v6-messages/SKILL.md +0 -384
- package/skills/cometchat-flutter-v6-theming/SKILL.md +0 -293
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +0 -224
- package/skills/cometchat-i18n/SKILL.md +0 -419
- package/skills/cometchat-ios/SKILL.md +0 -325
- package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +0 -181
- package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +0 -45
- package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +0 -188
- package/skills/cometchat-ios-calls/references/call-layouts.md +0 -76
- package/skills/cometchat-ios-calls/references/call-session.md +0 -218
- package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +0 -357
- package/skills/cometchat-ios-calls/references/custom-ui.md +0 -322
- package/skills/cometchat-ios-calls/references/device-management.md +0 -171
- package/skills/cometchat-ios-calls/references/group-calls.md +0 -359
- package/skills/cometchat-ios-calls/references/idle-timeout.md +0 -184
- package/skills/cometchat-ios-calls/references/in-call-chat.md +0 -179
- package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +0 -196
- package/skills/cometchat-ios-calls/references/picture-in-picture.md +0 -246
- package/skills/cometchat-ios-calls/references/raise-hand.md +0 -26
- package/skills/cometchat-ios-calls/references/recording-screen-share.md +0 -252
- package/skills/cometchat-ios-calls/references/ringing-integration.md +0 -143
- package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +0 -267
- package/skills/cometchat-ios-calls/references/share-invite.md +0 -148
- package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +0 -246
- package/skills/cometchat-ios-calls/references/voip-cert-setup.md +0 -166
- package/skills/cometchat-ios-production/SKILL.md +0 -738
- package/skills/cometchat-ios-testing/SKILL.md +0 -376
- package/skills/cometchat-ios-theming/SKILL.md +0 -667
- package/skills/cometchat-ios-troubleshooting/SKILL.md +0 -1003
- package/skills/cometchat-native-bare-patterns/SKILL.md +0 -550
- package/skills/cometchat-native-calls/SKILL.md +0 -671
- package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +0 -203
- package/skills/cometchat-native-calls/references/call-layouts.md +0 -125
- package/skills/cometchat-native-calls/references/call-session.md +0 -182
- package/skills/cometchat-native-calls/references/custom-ui.md +0 -254
- package/skills/cometchat-native-calls/references/device-management.md +0 -158
- package/skills/cometchat-native-calls/references/expo-vs-bare.md +0 -179
- package/skills/cometchat-native-calls/references/group-calls.md +0 -296
- package/skills/cometchat-native-calls/references/idle-timeout.md +0 -128
- package/skills/cometchat-native-calls/references/in-call-chat.md +0 -145
- package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +0 -72
- package/skills/cometchat-native-calls/references/picture-in-picture.md +0 -276
- package/skills/cometchat-native-calls/references/raise-hand.md +0 -205
- package/skills/cometchat-native-calls/references/recording-screen-share.md +0 -169
- package/skills/cometchat-native-calls/references/ringing-integration.md +0 -118
- package/skills/cometchat-native-calls/references/server-push-bridge.md +0 -135
- package/skills/cometchat-native-calls/references/server-push-payloads.md +0 -193
- package/skills/cometchat-native-calls/references/share-invite.md +0 -146
- package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +0 -319
- package/skills/cometchat-native-components/SKILL.md +0 -628
- package/skills/cometchat-native-core/SKILL.md +0 -679
- package/skills/cometchat-native-customization/SKILL.md +0 -716
- package/skills/cometchat-native-expo-patterns/SKILL.md +0 -552
- package/skills/cometchat-native-features/SKILL.md +0 -638
- package/skills/cometchat-native-placement/SKILL.md +0 -509
- package/skills/cometchat-native-production/SKILL.md +0 -700
- package/skills/cometchat-native-push/SKILL.md +0 -594
- package/skills/cometchat-native-testing/SKILL.md +0 -582
- package/skills/cometchat-native-theming/SKILL.md +0 -681
- package/skills/cometchat-native-troubleshooting/SKILL.md +0 -501
- package/skills/cometchat-nextjs-patterns/SKILL.md +0 -899
- package/skills/cometchat-placement/SKILL.md +0 -1360
- package/skills/cometchat-production/SKILL.md +0 -1027
- package/skills/cometchat-react-calls/SKILL.md +0 -752
- package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +0 -146
- package/skills/cometchat-react-calls/references/call-layouts.md +0 -160
- package/skills/cometchat-react-calls/references/call-session.md +0 -235
- package/skills/cometchat-react-calls/references/custom-ui.md +0 -247
- package/skills/cometchat-react-calls/references/device-management.md +0 -210
- package/skills/cometchat-react-calls/references/group-calls.md +0 -257
- package/skills/cometchat-react-calls/references/idle-timeout.md +0 -188
- package/skills/cometchat-react-calls/references/in-call-chat.md +0 -212
- package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +0 -170
- package/skills/cometchat-react-calls/references/picture-in-picture.md +0 -245
- package/skills/cometchat-react-calls/references/raise-hand.md +0 -238
- package/skills/cometchat-react-calls/references/recording-screen-share.md +0 -144
- package/skills/cometchat-react-calls/references/ringing-integration.md +0 -255
- package/skills/cometchat-react-calls/references/server-web-push-vapid.md +0 -241
- package/skills/cometchat-react-calls/references/share-invite.md +0 -175
- package/skills/cometchat-react-calls/references/testing-calls-on-web.md +0 -216
- package/skills/cometchat-react-calls/references/virtual-background.md +0 -32
- package/skills/cometchat-react-calls/references/voip-and-web-push.md +0 -165
- package/skills/cometchat-react-patterns/SKILL.md +0 -628
- package/skills/cometchat-react-push/SKILL.md +0 -634
- package/skills/cometchat-react-router-patterns/SKILL.md +0 -758
- package/skills/cometchat-react-testing/SKILL.md +0 -413
- package/skills/cometchat-theming/SKILL.md +0 -498
- package/skills/cometchat-troubleshooting/SKILL.md +0 -294
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cometchat-react-v7-core
|
|
3
|
+
description: "Add CometChat chat to a React app end-to-end — detect the project, get & verify dashboard credentials, init→login→render with CometChatProvider, and the drop-in conversation UI. The core knowledge every other React v7 skill builds on. Triggers: 'add chat to my react app', 'integrate cometchat react', 'set up cometchat credentials', 'show conversations and messages'."
|
|
4
|
+
license: "MIT"
|
|
5
|
+
compatibility: "Node.js >=18; React >=18; Vite >=4 / CRA / Next.js; @cometchat/chat-uikit-react ^7 (7.1.x, verified 7.1.0); @cometchat/chat-sdk-javascript ^4.1.9"
|
|
6
|
+
metadata:
|
|
7
|
+
author: "CometChat"
|
|
8
|
+
version: "1.3.0"
|
|
9
|
+
tags: "cometchat react core chat integration uikit v7 setup credentials"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
> **Ground truth:** `@cometchat/chat-uikit-react@7` + `@cometchat/chat-sdk-javascript@^4.1.9`. Symbols sourced from live v7 docs. This file is the THIN map loaded every run; deep detail is in `references/*` loaded ONLY when the task needs it. Anything marked **[v7-verify]** is a v6 carry-over to confirm against v7 docs/catalog before shipping.
|
|
13
|
+
|
|
14
|
+
<!-- core is the companion the other react v7 skills read; it has no Companion block of its own. -->
|
|
15
|
+
|
|
16
|
+
## Use this skill when
|
|
17
|
+
"add chat to my React app", "set up CometChat credentials", "integrate CometChat in React", "show a conversations + messages UI", "build a full chat app". An unscoped "add chat" means a **production-ready core chat surface** (a `CometChatConversations` list ↔ a message pane, wrapped in `CometChatErrorBoundary`, sized, affordances wired-or-hidden, mobile collapse) — NOT a bare two-pane demo, and NOT the whole combined app. See the golden path below. It **grows on request** (users/groups/calls tabs, a details/thread/search side panel, calls) to the full combined app — that recipe lives in `cometchat-react-v7-placement`.
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
`npm i @cometchat/chat-uikit-react@7 @cometchat/chat-sdk-javascript@4 dompurify` (keep the `@7`/`@4` major pins — a bare install resolves to `latest` and can pull the wrong major). `dompurify` is required by the kit — the docs install includes it. Voice/video calling also needs `@cometchat/calls-sdk-javascript` (see `cometchat-react-v7-features`).
|
|
21
|
+
|
|
22
|
+
## Setup & credentials (essentials — full detail: `references/setup-credentials.md`)
|
|
23
|
+
1. **Detect** React + bundler (Vite→`VITE_`, CRA→`REACT_APP_`, Next→`NEXT_PUBLIC_`/`.env.local`). Reuse existing `.cometchat`/env if present (skip re-setup).
|
|
24
|
+
2. **version_conflict — STOP** if a non-v7 UI Kit is installed; reconcile first (never mix majors — `RULES.md`).
|
|
25
|
+
3. **Credentials — OFFER the dashboard fetch FIRST, default to it** (never silently "paste it yourself", never defer to a "to finish, add them yourself" TODO — AUDIT-039). Reuse existing `.cometchat`/env if present (skip). Else offer both, defaulting to fetch: **(a) dashboard fetch (recommended)** — load the CLI on demand: `npx @cometchat/skills-cli@3 auth login`, **pick an EXISTING app** (`provision list --json`; **never auto-create**), `provision use --app-id <id> --json` returns the creds + writes a neutral `.cometchat/config.json` (NOT an env file); **(b) manual paste** — Dashboard → Credentials (dev-only Auth Key). **Then the SKILL writes the framework env (§4)** — the CLI stops at the fetch; framework detection, env-writing, and codegen are the SKILL's job, never the CLI's (AUDIT-059). Ask & wait if the user must choose or the CLI can't run. Full flow: `references/setup-credentials.md`.
|
|
26
|
+
4. **Write env** (correct prefix), gitignore it, never echo the Auth Key. Prod → server-side auth token, not the Auth Key.
|
|
27
|
+
5. **Authorize** = `init()` + `login()` resolve; auth error usually means wrong Region.
|
|
28
|
+
|
|
29
|
+
## Integration ordering (BAKED — invariant; docs: "init() must resolve before login()")
|
|
30
|
+
`init()` once at startup → `login(UID)` after init resolves (guard with the sync `CometChatUIKit.getLoggedInUser()`) → render inside `CometChatProvider`.
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { CometChatUIKit } from "@cometchat/chat-uikit-react";
|
|
34
|
+
// initFromSettings (NOT the classic UIKitSettingsBuilder init) sets integrationSource="ai-agent"
|
|
35
|
+
// for telemetry attribution — and routes the Calls SDK through initFromSettings too (AUDIT-084).
|
|
36
|
+
await CometChatUIKit.initFromSettings({
|
|
37
|
+
appId: import.meta.env.VITE_COMETCHAT_APP_ID,
|
|
38
|
+
region: import.meta.env.VITE_COMETCHAT_REGION,
|
|
39
|
+
credentials: { authKey: import.meta.env.VITE_COMETCHAT_AUTH_KEY }, // dev only; prod → server-minted auth token
|
|
40
|
+
chatSDK: { presenceSubscription: { type: "ALL_USERS" } }, // = the classic subscribePresenceForAllUsers()
|
|
41
|
+
}); // must resolve first
|
|
42
|
+
if (!CometChatUIKit.getLoggedInUser()) await CometChatUIKit.login(UID); // sync getter — capital "In"
|
|
43
|
+
```
|
|
44
|
+
> Init once + StrictMode double-init, concurrent-login guard, and the reusable provider: `references/lifecycle.md`.
|
|
45
|
+
> **Which UID?** `login()` needs a user that ALREADY EXISTS — never invent/hardcode a guessed one. ASK, or take one from Dashboard → **Users** (fresh apps seed `cometchat-uid-1…`). **Never suggest `superhero1..5` or any remembered "classic sample" UID (not seeded in modern apps); don't fabricate UIDs from memory — the only tentative suggestion is `cometchat-uid-1`, labelled "if this is a fresh app."** Prod → per-user auth token + `loginWithAuthToken`. Detail: `references/setup-credentials.md` §6.
|
|
46
|
+
|
|
47
|
+
## Component / API map (BAKED closed list)
|
|
48
|
+
Init/provider: `CometChatUIKit`, `UIKitSettingsBuilder`, `CometChatProvider`, `CometChatErrorBoundary` (wraps the surface — production must-have). Core-surface drop-ins: `CometChatConversations`, `CometChatMessageHeader`, `CometChatMessageList`, `CometChatMessageComposer`; wired affordances `CometChatThreadHeader`, `CometChatSearch`. Grow set (added on request): `CometChatUsers`, `CometChatGroups`, `CometChatCallLogs`, `CometChatGroupMembers`, `CometChatIncomingCall`.
|
|
49
|
+
|
|
50
|
+
## Hot-path props (BAKED — the golden path needs NO fetch)
|
|
51
|
+
The ~12 props you actually wire for "add chat". Do NOT fetch docs for these; do NOT read `.d.ts`.
|
|
52
|
+
- `CometChatConversations`: `onItemClick(conversation)` (select → drives the message pane) · `activeConversation` · `showSearchBar` (default `true`; wire `onSearchBarClicked`→`CometChatSearch` or set `false`) · `selectionMode` (default `"none"`) · `conversationsRequestBuilder` — **scope the list to the REQUEST**: a 1:1/DM-only ask → `new CometChat.ConversationsRequestBuilder().setConversationType("user")` so the app's seeded groups don't show (`"group"` for groups-only); pass the builder INSTANCE, not `.build()`. See the data-scope note below.
|
|
53
|
+
- `CometChatMessageHeader`: `onItemClick` (open profile) · `showSearchOption` (default `true`) + `onSearchOptionClicked` → **open a SCOPED `CometChatSearch` (`uid`/`guid` of the current chat) in the side panel (in-chat message search, default-on; opt-out via `showSearchOption={false}`)** · `hideBackButton` (default `false`) + `onBack` (mobile → pop to list).
|
|
54
|
+
- `CometChatMessageList`: `onThreadRepliesClick(message)` → **open the thread panel (DEFAULT — threaded replies ship with a first-time "add chat")**; `hideReplyInThreadOption` ONLY if the user explicitly opts out of threads.
|
|
55
|
+
- `CometChatMessageComposer`: `placeholder` (default `"Type a message..."`); a plain send needs no props.
|
|
56
|
+
- `CometChatProvider`: `theme` (`"light"` default — no OS-follow; sync to `prefers-color-scheme`, see `references/theming.md`).
|
|
57
|
+
> **Stable props + view slots for the 4 drop-ins are BAKED in `references/component-props.md`** — use them: custom UI goes IN the component's slot (search → Conversations `headerView` / MessageHeader `trailingView`), NEVER as a sibling on top. Exhaustive/rare props or any OTHER component → fetch its `.md` twin via `references/docs-map.md`; NEVER read `node_modules/.d.ts`. Full catalog: `cometchat-react-v7-components`.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## Golden path — the production-ready CORE surface (default for an unscoped "add chat"; grows on request)
|
|
61
|
+
Setup → guarded init/login → wrap the app in `CometChatProvider` **inside `CometChatErrorBoundary`** → build the core surface: a `CometChatConversations` LIST ↔ a MESSAGE pane (`CometChatMessageHeader` + `CometChatMessageList` + `CometChatMessageComposer`) for the selected conversation, a small host state object coordinating {selected conversation, side view: thread | in-chat-search | none}, collapsing to one pane on mobile. Complete and wired but LEAN — NOT a bare two-pane demo, NOT the whole combined app. Reuse existing routing/layout/auth; add files + wiring only, never rewrite. Least-code = reach for the drop-ins/slots (HOW). **The compile-verified TSX + the required column CSS live in `references/layout.md` (sizing) and `cometchat-react-v7-placement/references/recipes.md` (the Core-surface recipe) — build from those; this entry stays the thin map.**
|
|
62
|
+
|
|
63
|
+
Wire every default-on affordance so nothing dead-ends, and keep these INVARIANTS:
|
|
64
|
+
- **Threads are DEFAULT** (ship with a first-time "add chat"). Wire `CometChatMessageList onThreadRepliesClick(m)` → a thread panel (`CometChatThreadHeader` + a thread `CometChatMessageList` + `CometChatMessageComposer`) with a close/back round-trip. **The thread list AND composer take BOTH the current target (`user` OR `group`, same as the main pane) AND `parentMessageId`; passing `parentMessageId` ALONE silently NEVER SENDS (AUDIT-060).** Set `hideReplyInThreadOption` only on explicit opt-out. **Differentiate the thread MESSAGE LIST** (not just the wrapper): scope `--cometchat-message-list-bg: var(--cometchat-background-color-01)` on the thread wrapper — the list paints its own opaque bg so a wrapper bg can't reach it (verified vs 7.1.0; recipe in `cometchat-react-v7-customization`).
|
|
65
|
+
- **Two searches, both default-on, both need the FULL round-trip (AUDIT-017).** GLOBAL conversation search over the LIST column (`CometChatConversations onSearchBarClicked` → `CometChatSearch`, no uid/guid — or `showSearchBar={false}`); IN-CHAT scoped search in the SIDE PANEL (`CometChatMessageHeader showSearchOption` default `true` → `onSearchOptionClicked` → `CometChatSearch` with the current `uid`/`guid`, mutually exclusive with the thread). Each renders a back button (`onBack`) you MUST wire to close + return, PLUS `onConversationClicked`/`onMessageClicked` to select the hit — a companion you open, you must also close. (Real server-side search may also need a Dashboard toggle — VERIFY.)
|
|
66
|
+
- **SIZE per the ONE standard — `references/layout.md`.** The kit fills its parent and ships its own `loadingView`/`emptyView`, so a broken-looking surface is a HOST container-sizing defect (a content-driven box), not a kit bug — two modes: static collapse (~0px sliver) and load-transition reflow (grows into place as content loads). Satisfy the 5 invariants: prepare/RESET the ancestor chain (`html,body,#root{height:100%;margin:0}` + undo the Vite/CRA/Next scaffold center+cap+pad, AUDIT-019/035) · pin the surface to a content-INDEPENDENT `100dvh` (never `min-height`/`auto`) · size COLUMNS with `min-height:0`/`overflow:hidden` (scroll, don't grow the parent) · let the kit loading state fill the pinned box · no `transform`/`filter` ancestors. The 2-column CSS is in `layout.md`; the 3-column/embedded/popup/sidebar recipes in `cometchat-react-v7-placement`. Keep `CometChatProvider` WRAPPING `.cc-app`, not inside it (the `.cometchat` wrapper breaks the row — AUDIT-036).
|
|
67
|
+
- **Match data scope to the REQUEST (AUDIT-038).** A 1:1/DM-only ask must NOT show the app's seeded groups — scope with the built-in `conversationsRequestBuilder` prop (pass the `CometChat.ConversationsRequestBuilder` INSTANCE, `.setConversationType("user")`; `"group"` for groups-only; **reuse the prop, don't hand-roll a client-side filter**), and scope the selector to match (no Groups tab on a 1:1-only app). A generic unscoped "add chat" keeps BOTH. Example in `references/component-props.md`.
|
|
68
|
+
- **Theme:** the kit defaults to `light` and does NOT follow the OS (no `theme="system"`) — sync `CometChatProvider theme=` to `prefers-color-scheme` by default (`references/theming.md`, AUDIT-004).
|
|
69
|
+
- **Reuse built-in triggers — don't hand-roll buttons (AUDIT-006).** Wire the props components already expose; custom UI goes IN the component's view slot (search icon → Conversations `headerView` / MessageHeader `trailingView`), NEVER a sibling on top (slot map: `references/component-props.md`). Unclear prop → fetch its `.md` twin (`references/docs-map.md`), never the `.d.ts`.
|
|
70
|
+
- **`CometChatErrorBoundary` wraps the surface** (children required; optional `onError`/`fallbackView`/`componentName`) — a render error then shows a localized fallback + retry, not a blank white screen. It is NOT the initializer (init/login still happen first). Leave header call buttons + composer attach/emoji/voice as built-in defaults; do NOT turn on gated extensions/AI/plugins; do NOT add selector tabs / a details or scoped-search side panel / call logs / incoming call (those are the GROWTHS) unless asked — **but the thread panel IS part of the default.** **Prod auth: `loginWithAuthToken` with a per-user server-minted token; the Auth Key is dev-only** (`references/lifecycle.md`).
|
|
71
|
+
|
|
72
|
+
**Grows on request → the full combined app** (users/groups/calls **tabs**, a details/thread/scoped-search **side panel**, `CometChatIncomingCall` at root, **calls**, individual **features**) — the UNION of these growths. The compile-verified combined-app recipe (with the required column CSS + `CometChatErrorBoundary`) is baked in **`cometchat-react-v7-placement`**; build the grown app from it. A user who scopes DOWN (embed/popup/sidebar) → the matching `cometchat-react-v7-placement` variant.
|
|
73
|
+
|
|
74
|
+
## Deep references (load ONLY when the task needs them — keeps this file light on run)
|
|
75
|
+
- `references/setup-credentials.md` — detect, config reuse, version_conflict, dashboard creds, env, authorize.
|
|
76
|
+
- `references/lifecycle.md` — init-once + StrictMode, concurrent-login guard (`ensureLoggedIn`), get-current-UID (sync vs async), prod auth-token, logout, the full `CometChatProvider`.
|
|
77
|
+
- `references/layout.md` — **the ONE reflow-free-surface sizing standard** (the 5 invariants: prepared ancestor chain · pinned content-independent height · `min-height:0` columns · kit loading state inside the pinned box = NO load-transition reflow · no `transform`/`filter` ancestors). `placement` + `calls` reference it too — change sizing rules HERE.
|
|
78
|
+
- `references/ssr.md` — Next.js / Astro / React Router SSR safety (`"use client"`, `ssr:false`, `client:only`).
|
|
79
|
+
- `references/theming.md` — CSS import-once + `--cometchat-*` variables (depth: `cometchat-react-v7-customization`).
|
|
80
|
+
- `references/i18n-rtl-a11y.md` — localization, RTL, accessibility rules when customizing.
|
|
81
|
+
- `references/anti-patterns.md` — the 15 real-bug anti-patterns (incl. `transform`/Tailwind overlay bug, container dimensions, **scaffold-boilerplate** = centered/capped/gutter-boxed chat (#15), **global-CSS-leak** = centered names / expanding header, **raw-i18n-key** rendering).
|
|
82
|
+
- `references/dependencies.md` — packages, major pins, `CometChat.*` SDK types, bundle-size cost transparency.
|
|
83
|
+
- `references/component-props.md` — **BAKED stable props + view slots** for the 4 drop-ins (where custom UI goes IN each component — search → Conversations `headerView`, MessageHeader `trailingView`, etc.).
|
|
84
|
+
- `references/docs-map.md` — intent → the exact docs `.md` twin to fetch (replaces reading `.d.ts`); **for a whole feature/task, its "Task guides (recipes)" section says to BUILD FROM the official guide + COMPARE your implementation against it (docs-maximal), then apply the hardening deltas.**
|
|
85
|
+
- `references/troubleshooting.md` — **symptom → cause → fix** table (blank screen, `window is not defined`, ~0px collapse, raw i18n keys, centered names / expanding header, `version_conflict`, login/UID failures, hidden call buttons). The first stop when an integration renders wrong.
|
|
86
|
+
|
|
87
|
+
> **Visual Builder (VCB) is out of scope.** If asked to integrate a VCB export, point to the CometChat Visual Builder docs (via `references/docs-map.md`); don't hand-roll a builder-export flow.
|
|
88
|
+
|
|
89
|
+
## Common pitfalls (top 4 — full list in `references/anti-patterns.md`)
|
|
90
|
+
version_conflict (v6 installed) · wrong Region or env prefix · Auth Key shipped to prod client · rendering/login before init resolves.
|
|
91
|
+
|
|
92
|
+
## Verify it works
|
|
93
|
+
Start the app → confirm `init()` then `login()` resolve → the `CometChatConversations` list renders inside `CometChatProvider` (itself inside `CometChatErrorBoundary`) at full size (not a collapsed sliver); open a conversation → the message pane loads and messages send/receive; **clicking "reply in thread" opens the thread panel (default) and its back/close returns to the list** (hidden only if the user opted out), and the thread's MESSAGE LIST reads as a distinct surface matching its own header/composer (not the same shade as the main list — the `--cometchat-message-list-bg` override is scoped on the thread wrapper); **clicking the message-header search icon opens an in-chat search in the side panel scoped to THAT conversation (default), with back to close**; the conversations search bar is wired-or-hidden (no dead-ends); on a narrow viewport it collapses to one pane at a time (list → message → thread/search → back). Blank white screen ⇒ something rendered before `init()` resolved, the Region / env prefix is wrong, or an unbounded render error escaped (add `CometChatErrorBoundary`). A list + message pane with no sizing / no error boundary / dead-ending affordances ⇒ under-delivery (see the golden path). Growing to the full app (tabs + side panel + incoming call) ⇒ verify per `cometchat-react-v7-placement`.
|
|
94
|
+
|
|
95
|
+
## Explain what you built (REQUIRED close)
|
|
96
|
+
After it builds + verifies, don't dump silently — tell the user briefly: **(1) what I wired** (3–5 bullets, NAME the files); **(2) decisions & why**, flagging dev-only AS dev-only (dev **Auth Key** → server auth token for prod; the `<uid>`; OS-follow theme); **(3) what I did NOT touch** (additive — routing/auth/styles intact). Then **(4) offer these THREE options as a SELECTABLE choice and WAIT for the user's pick — do NOT auto-continue:**
|
|
97
|
+
- **① Add another feature** → **first check what's ALREADY there, then suggest only the GAP (AUDIT-043).** Read what's wired (the emitted code you built) and ASK which dashboard-gated extensions are already enabled (you can't reliably read per-app dashboard state — don't assume OFF). SUGGEST 3–4 grow-set items that are NEITHER wired NOR already enabled (voice/video **calls** · **search** · **threads** if off · **push** · **AI/smart-replies** · **moderation** · polls/stickers/translation) — **never re-suggest something already on (e.g. translation already enabled in the dashboard)**. **Do NOT suggest `reactions` or `mentions` — they are ON BY DEFAULT in v7 (core messaging; their dashboard extensions are "(Legacy)", already in core — AUDIT-077); if the user asks, say they're already on and offer to customize them.** Then build the chosen one (→ `cometchat-react-v7-features` / `cometchat-react-v7-calls`).
|
|
98
|
+
- **② Customize theming** → ask whether they already have a **preset / brand theme** (a brand color, light/dark, or match an existing design system) or want to talk through the options, then wire it (→ `cometchat-react-v7-customization`).
|
|
99
|
+
- **③ Test it manually** → do NOTHING further — hand it back so the user runs and checks it themselves.
|
|
100
|
+
|
|
101
|
+
A PARKED capability (push · migration · SDK-only) → isn't in this pack yet: say so honestly + link CometChat's docs. **This 3-option close runs after EVERY implementation (`RULES.md` §19 / AUDIT-040).**
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# anti-patterns — real bugs, do NOT do these (React v7)
|
|
2
|
+
|
|
3
|
+
1. **No `init()` during render** — async + side effects → infinite re-render. Use `useEffect` or pre-`createRoot`.
|
|
4
|
+
2. **Import the UI Kit CSS once** — duplicate imports = specificity conflicts + doubled variables.
|
|
5
|
+
3. **No render before init completes** — components assume the SDK is initialized ("CometChat is not initialized"). Gate with the provider/ready-state.
|
|
6
|
+
4. **Never hardcode `AUTH_KEY`** — env var in dev; auth token in prod.
|
|
7
|
+
5. **Guard concurrent `login()`** — safe sequentially only; overlap throws "Please wait until the previous login request ends." Cache a module-level in-flight promise (`ensureLoggedIn`, see `lifecycle.md`).
|
|
8
|
+
6. **No server-side render** of components — `"use client"` (Next), `client:only="react"` (Astro). See `ssr.md`.
|
|
9
|
+
7. **Don't target internal CSS classes** — use `--cometchat-*` variables.
|
|
10
|
+
8. **Container needs a content-INDEPENDENT height** — components fill 100% of the container, so a content-driven box both collapses to ~0px (static collapse) AND grows-into-place as content loads (load-transition reflow). Pin it (`100dvh` / a fixed height / a sized grid-flex cell — never `min-height`/`auto`) with a prepared ancestor chain, and size the columns `min-height:0`. The ONE sizing standard: `layout.md`.
|
|
11
|
+
9. **Don't re-init on route change** — init once at app level; re-init flickers + drops WebSockets.
|
|
12
|
+
10. **Don't invent component names** — check `cometchat-react-v7-components` (and `web-v7.json`). A wrong name (e.g. `<CometChatMessenger>`) is a build error.
|
|
13
|
+
11. **No `transform` on a container wrapping chat** — a non-`none` `transform` creates a containing block for `position: fixed` descendants; the UI Kit renders overlays (options menu, emoji picker, file preview, reactions, thread panel) as `position: fixed` and expects them anchored to the viewport. **This includes Tailwind `translate-x-*`/`-translate-y-*`/`scale-*`/`rotate-*`/`transition-transform`** — all compile to `transform` and clip/offset the overlays. Also `filter`, `perspective`, `backdrop-filter`, `will-change: transform`. **Fix:** animate `right`/`left` offset (or `margin-right`) instead of transform — in Tailwind toggle `right-0` ↔ `right-[-420px]` with `transition-[right]`. See `cometchat-react-v7-placement` drawer/widget patterns.
|
|
14
|
+
12. **Don't let host global CSS leak into the `.cometchat` subtree.** The kit's layout is self-contained and correct by default (verified vs 7.1.0): `.cometchat-conversations__header` is `flex-shrink:0` / `min-height:64px` (fixed — **NOT `flex:1`**), `.cometchat-conversations__list` is `flex:1`, and list-item titles are **left-aligned**. So if the **conversations header expands to fill height**, or **list-item names render centered**, the cause is a global style bleeding onto kit elements — a `text-align:center` / `align-items:center` / `flex:1` / CSS reset / Tailwind base on an ancestor — or an override of an internal class, NOT the kit. **Fix:** scope global CSS away from the `.cometchat` subtree (no `text-align`/flex-centering/`flex` on the kit's ancestors), never override the internal BEM classes (`.cometchat-*__header`/`__item-*`/`__list` — customize via `--cometchat-*` vars + view slots, #7), and give the mount container an explicit height so `.cometchat-conversations__root { height:100% }` resolves (#8).
|
|
15
|
+
13. **Never render a raw localization key as a label** — the kit localizes via `CometChatProvider`; a snake_case token in the UI (`group_info`, `add_members`) is a missing/wrong key or a literal-key render. Use the kit component or `useLocale().getLocalizedString(key)`. See `i18n-rtl-a11y.md`.
|
|
16
|
+
14. **Don't `import { CometChat }` just for types** — the SDK namespace is an **ambient global**, so `CometChat.User`/`CometChat.Group`/`CometChat.BaseMessage` resolve as types with NO import. A value import used only in type positions fails the Vite React-TS template's strict config (`noUnusedLocals` + `verbatimModuleSyntax`) with `TS6133: 'CometChat' is declared but its value is never read` — and `import type { CometChat }` does **not** fix it (the type comes from the global, not the import). **Rule:** import `CometChat` **only** when you use it as a value (`msg instanceof CometChat.User`, `CometChat.CometChatHelper.getConversationFromMessage(...)`, `new CometChat.GroupMembersRequestBuilder(...)`); for type-only usage, drop the import and use the ambient global. (AUDIT-007.)
|
|
17
|
+
15. **Full-page chat: clear the scaffold boilerplate CSS (the #2 "UI looks broken" defect).** A fresh Vite/CRA/Next app ships template CSS that **centers, width-caps, and pads the root** — Vite's `#root { max-width:1280px; margin:0 auto; padding:2rem; text-align:center }` + `body { display:flex; place-items:center }` (CRA `App.css`, Next `globals.css` have analogues). Drop a `100dvh` chat surface into that and it renders as a **centered ~1280px padded box with big side gutters, message bubbles/overlays clipping off the edge** ("exceeding the viewport / broken"). **Fix:** before the chat CSS, reset it — `html, body, #root { height:100%; margin:0; padding:0 }` + `#root { max-width:none; text-align:left; display:block }` + remove `body{place-items:center}`; give `.cc-app` `overflow:hidden` and the message column `min-width:0; min-height:0; overflow:hidden`. (Verified reproduction: a capped/centered `#root` shoves chat into a ~729px gutter-boxed island; the reset makes it full-bleed. AUDIT-019.) This is invariant (a) of the reflow-free-surface standard — full rule + the load-transition-reflow mode: `layout.md`.
|
|
18
|
+
16. **Don't expect an OPAQUE kit sub-surface to inherit a wrapper's background — override the sub-surface's OWN CSS variable.** `.cometchat-message-list` paints an opaque `background: var(--cometchat-message-list-bg)` (default `--cometchat-background-color-03`), so a background set on a wrapping `div` is COVERED by the list and never shows — the list stays the same shade regardless of the wrapper. Canonical case: the **thread panel** — its header/composer paint their own opaque `--cometchat-background-color-01`, so the thread message list looks like the MAIN list (both `-03`) and different from its own header/composer, even after you give the thread wrapper a background. **Fix:** scope the surface's OWN token on the wrapper — `.cc-thread-panel { --cometchat-message-list-bg: var(--cometchat-background-color-01); }` (cascades into the list; matches the thread header/composer, differs from the main list's `-03`; verified vs 7.1.0). Generalizes to any opaque sub-surface: differentiate it by overriding ITS background variable, not the wrapper's, and never the internal `.cometchat-*` class (#7/#12). (AUDIT-020/024; depth: `cometchat-react-v7-customization`.)
|
|
19
|
+
17. **Don't write a per-theme override as `[data-theme="dark"] .cometchat { … }` — it matches nothing.** `CometChatProvider` renders ONE wrapper — `<div data-theme="light|dark" class="cometchat">` (verified vs 7.1.0: compiled bundle `jsx("div",{ "data-theme": internalTheme, className: "cometchat" })`) — and the kit defines its tokens on `:root, [data-theme=light]` / `[data-theme=dark]`. So `data-theme` and `.cometchat` are the SAME element; the descendant selector `[data-theme="dark"] .cometchat` looks for a `.cometchat` NESTED inside a `[data-theme]` ancestor, which doesn't exist → the rule silently no-ops (a correct-looking override that does nothing). **Fix:** for a per-theme BRAND token use the same-element selector `.cometchat[data-theme="dark"] { --cometchat-primary-color: … }` (or bare `[data-theme="dark"]`); to retint a kit INTERNAL per theme use `[data-theme="dark"] .cometchat-<bem> { … }` — the wrapper as ancestor, a BEM class as the descendant, which is exactly how the kit writes its own dark rules (e.g. `[data-theme=dark] .cometchat-tooltip`). Never target internal BEM for tokens (#7). (AUDIT-025; depth: `cometchat-react-v7-customization`.)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# component-props — BAKED stable props + view slots for the React v7 drop-ins
|
|
2
|
+
|
|
3
|
+
The high-value, STABLE props **and view slots** for the core drop-in components — baked here (not
|
|
4
|
+
fetched) because getting the slots wrong is the #1 recurring UI defect. Verified against live v7
|
|
5
|
+
docs (`components/*.md`). Exhaustive/rare props still come from a component's `.md` twin
|
|
6
|
+
(`docs-map.md`), but **these — especially the VIEW SLOTS — are baked.**
|
|
7
|
+
|
|
8
|
+
## THE RULE — custom UI goes in the component's OWN view slot, NEVER as a sibling on top
|
|
9
|
+
A search icon, extra action button, banner, or custom header belongs **inside** the component via
|
|
10
|
+
its slot (below). Do **NOT** render it as a sibling element above/beside the component. Rendering
|
|
11
|
+
a search control "on top of" the conversation list instead of in its `headerView`, or above the
|
|
12
|
+
message header instead of in its `trailingView`, is a defect — fix it by using the slot.
|
|
13
|
+
|
|
14
|
+
> **List-header actions ("New chat" / "Create group" / "+") go in `headerView` — but `headerView` REPLACES the whole default header, so RE-RENDER the title (AUDIT-083).** The list components (`CometChatConversations` / `CometChatUsers` / `CometChatGroups`) show a default header with a **title** ("Chats"/"Users"/"Groups") by default. Their only header slot is `headerView`, which replaces that ENTIRE header — so if you drop a bare button into `headerView` you LOSE the title. Render BOTH: the title (re-created) AND your action button. Do NOT place the button as a sibling above the list (the defect this rule fixes).
|
|
15
|
+
> ```tsx
|
|
16
|
+
> import { useLocale } from "@cometchat/chat-uikit-react";
|
|
17
|
+
> const { getLocalizedString } = useLocale();
|
|
18
|
+
> <CometChatGroups
|
|
19
|
+
> headerView={
|
|
20
|
+
> <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", padding: "0 12px", height: 56 }}>
|
|
21
|
+
> <h3 style={{ margin: 0 }}>{getLocalizedString("groups")}</h3> {/* re-render the default title */}
|
|
22
|
+
> <button aria-label="Create group" onClick={openCreateGroup}>+</button> {/* the action, right of the title */}
|
|
23
|
+
> </div>
|
|
24
|
+
> }
|
|
25
|
+
> onItemClick={openGroup}
|
|
26
|
+
> />
|
|
27
|
+
> ```
|
|
28
|
+
> Same for a **"New chat"** button on `CometChatConversations` (title `"chats"`) and `CometChatUsers` (title `"users"`). (Use `useLocale().getLocalizedString(...)` for the title so it stays localized; `<h3>Chats</h3>` is fine if you don't localize.)
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## CometChatConversations
|
|
33
|
+
**Props:** `onItemClick(conversation)` · `onSearchBarClicked` · `showSearchBar` (default `true`) · `selectionMode` (default `"none"`) · `activeConversation` · `onSelect` · `conversationsRequestBuilder` (scope which conversations load) · `searchRequestBuilder` (scope server-side search) · hide toggles (`hideReceipts`, `hideUserStatus`, `hideGroupType`, `hideDeleteConversation`).
|
|
34
|
+
**View slots (inject custom UI INSIDE the component):**
|
|
35
|
+
- `headerView: ReactNode` — the **entire header area**. → **Custom header controls (a search icon, filter, custom title) go HERE.**
|
|
36
|
+
- `searchView: ReactNode` — the search bar within the header.
|
|
37
|
+
- `itemView(conversation)` · `leadingView` · `titleView` · `subtitleView` · `trailingView` — per row.
|
|
38
|
+
- `options(conversation) => CometChatConversationOption[]` — per-row context-menu actions.
|
|
39
|
+
- `loadingView` · `emptyView` · `errorView` — list states.
|
|
40
|
+
> **Search icon in the conversation list header → put it in `headerView`** (or wire `onSearchBarClicked` → `CometChatSearch` rendered in the list column). NOT a sibling on top of the list.
|
|
41
|
+
> **Scope the list to the request via `conversationsRequestBuilder` (a `CometChat.ConversationsRequestBuilder`).** A **1:1 / DM-only** app → `.setConversationType("user")` (hides the app's seeded groups); **groups-only** → `.setConversationType("group")`. **Pass the builder INSTANCE, not `.build()`** — the kit builds it internally; passing the built object breaks the list (verified vs live v7 `conversations.md`: "Pass the builder instance — not the result of `.build()`"; AUDIT-038). `searchRequestBuilder` scopes server-side search the same way. A generic unscoped "add chat" → OMIT it (show both users and groups). Don't add a Groups tab to a 1:1-only app.
|
|
42
|
+
> ```tsx
|
|
43
|
+
> import { CometChat } from "@cometchat/chat-sdk-javascript";
|
|
44
|
+
> <CometChatConversations conversationsRequestBuilder={new CometChat.ConversationsRequestBuilder().setLimit(30).setConversationType("user")} />
|
|
45
|
+
> ```
|
|
46
|
+
|
|
47
|
+
## CometChatUsers / CometChatGroups (selector-tab lists)
|
|
48
|
+
**Props — REFLECT the selection (active state):** `onItemClick(user|group)` · **`activeUser` / `activeGroup`** — pass the currently-selected user/group so the list HIGHLIGHTS the open row (the analogue of `CometChatConversations activeConversation`). In a selector-tabs app you MUST pass these; without them the list shows **no active state** and the user can't tell which item is open (AUDIT-079). Also `usersRequestBuilder` / `groupsRequestBuilder` to scope the list, and the same view slots (`headerView`, `itemView`, `titleView`/`subtitleView`/`trailingView`, `options`, `loadingView`/`emptyView`/`errorView`).
|
|
49
|
+
> **Selection has THREE obligations (AUDIT-079):** (1) render the pane, (2) reflect it via `active*` (here), (3) close every panel it opens (round-trip — see `CometChatGroupMembers`/`CometChatSearch`/`CometChatThreadHeader` `onBack`/`onClose`). Wiring only (1) is a composition dead-end.
|
|
50
|
+
|
|
51
|
+
## CometChatSearch (the companion opened from `onSearchBarClicked`)
|
|
52
|
+
**Props (wire the full round-trip — open AND close):** `onBack()` — **fired by the default back button; wire it to CLOSE search and return to the list (the same state that opened it), or the back button dead-ends** · `onConversationClicked(event)` and `onMessageClicked(event)` — result clicks; wire to **close search + select the result** · `hideBackButton` (default `false`) · `uid`/`guid` (scope to one conversation) · `searchIn` (`["conversations","messages"]`) · `loadingView`/`emptyView`/`errorView`.
|
|
53
|
+
> **You opened it — you must close it.** Rendering `CometChatSearch` without `onBack` is the #1 search defect (AUDIT-017): the back button shows but does nothing. Minimal wiring: `const [searching, setSearching] = useState(false)` → open on `onSearchBarClicked`, `onBack={() => setSearching(false)}`, and on `onConversationClicked`/`onMessageClicked` set the selected conversation + `setSearching(false)`.
|
|
54
|
+
>
|
|
55
|
+
> **TWO searches — both default-on:** (1) **GLOBAL** (all conversations) — from `CometChatConversations onSearchBarClicked`, rendered OVER the list column, NO `uid`/`guid`; (2) **IN-CHAT / SCOPED** (this conversation only) — from `CometChatMessageHeader onSearchOptionClicked`, rendered in the **side panel** (same slot as the thread, mutually exclusive), **scoped with `uid`/`guid`** so it only searches the open chat (the official `CometChatHome` sample pattern). The side panel is ONE mutually-exclusive slot: opening scoped search closes the thread and vice-versa. Full side-panel recipe (both searches wired, with the round-trip): `../../cometchat-react-v7-placement/references/recipes.md`.
|
|
56
|
+
|
|
57
|
+
## CometChatMessageHeader
|
|
58
|
+
**Props:** `onItemClick` (open profile) · `onBack` + `hideBackButton` (default `false`) · `showSearchOption` (default `true`) + `onSearchOptionClicked` · `showConversationSummaryButton` + `onSummaryClick`.
|
|
59
|
+
**View slots:**
|
|
60
|
+
- `trailingView: ReactNode` — the header **right side** (replaces call buttons + overflow menu). → **Custom action buttons (search, call, custom icon) go HERE.**
|
|
61
|
+
- `auxiliaryButtonView: ReactNode` — auxiliary button area.
|
|
62
|
+
- `leadingView` · `titleView` · `subtitleView` — replace avatar / name / status.
|
|
63
|
+
- Compound sub-components for granular control: `Avatar`, `Title`, `Subtitle`, `CallButtons`, `SearchButton`, `SummaryButton`, `OverflowMenu`, `AuxiliaryButtons`.
|
|
64
|
+
> **A custom search/action icon in the message header → put it in `trailingView`** (or `auxiliaryButtonView`), or use the built-in `showSearchOption` + `onSearchOptionClicked`. NOT a sibling above the header.
|
|
65
|
+
|
|
66
|
+
## CometChatMessageList
|
|
67
|
+
**Props:** `onThreadRepliesClick(message)` · `hideReplyInThreadOption` · `showSmartReplies` (default `false`; footer) · `showConversationStarters` (default `false`; footer when empty) · hide toggles (`hideReceipts`, `hideDateSeparator`, `hideReactionOption`, …).
|
|
68
|
+
**View slots:**
|
|
69
|
+
- `bubbleView(message, loggedInUser)` — replace an entire message bubble.
|
|
70
|
+
- `headerView: ReactNode` — banner **above** the scroll container. → **A custom banner/notice goes HERE.**
|
|
71
|
+
- `footerView: ReactNode` — area **below** the scroll (smart replies render here).
|
|
72
|
+
- `loadingView` · `emptyView` · `errorView`.
|
|
73
|
+
|
|
74
|
+
## CometChatMessageComposer
|
|
75
|
+
**Props:** `placeholder` (default `"Type a message..."`) · `onSendButtonClick(message, mode)` · `enterKeyBehavior` (`"send" | "newline" | "none"`) · `enableMultipleAttachments` · `disableTypingEvents` · `disableMentions` · `layout` (`"compact" | "multiline"`).
|
|
76
|
+
**View slots:**
|
|
77
|
+
- `headerView: ReactNode` — area **above** the input (reply-preview, banner). → **Custom composer header goes HERE.**
|
|
78
|
+
- `auxiliaryButtonView: ReactNode` — extra buttons in the actions area **before** send. → **A custom action button goes HERE.**
|
|
79
|
+
- `sendButtonView` · `attachmentButtonIconView` · `voiceRecordingButtonIconView` · `emojiButtonIconView` — swap specific icons/buttons.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
For any component NOT above, or exhaustive props → fetch the component's `.md` twin (`docs-map.md`). But for these four, **use the slots above** — don't render custom controls outside the component.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# dependencies — packages, pins, SDK types (React v7)
|
|
2
|
+
|
|
3
|
+
## Packages (two)
|
|
4
|
+
```json
|
|
5
|
+
{ "@cometchat/chat-uikit-react": "^7", "@cometchat/chat-sdk-javascript": "^4" }
|
|
6
|
+
```
|
|
7
|
+
UI Kit = the React components; SDK = the `CometChat` namespace (types + methods).
|
|
8
|
+
> **Keep the `@^7` / `@^4` major pins — never a bare `npm install @cometchat/chat-uikit-react`.** A bare install resolves to `latest`; these skills teach v7, so an unpinned install can pull the wrong major and break the integration.
|
|
9
|
+
|
|
10
|
+
## SDK types you'll use
|
|
11
|
+
```typescript
|
|
12
|
+
import { CometChat } from "@cometchat/chat-sdk-javascript";
|
|
13
|
+
CometChat.User // a chat user
|
|
14
|
+
CometChat.Group // a chat group
|
|
15
|
+
CometChat.Conversation // wraps a User or Group
|
|
16
|
+
CometChat.BaseMessage // any message
|
|
17
|
+
CometChat.TextMessage // a text message
|
|
18
|
+
CometChat.getUser(uid): Promise<CometChat.User>
|
|
19
|
+
CometChat.getGroup(guid): Promise<CometChat.Group>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Cost transparency (disclose when integrating into a new project) — **[v7-verify numbers]**
|
|
23
|
+
The v6 kit added ~2.8 MB JS (~860 KB gzip), ~860 KB CSS, ~1.5 MB Roboto fonts (9 weights). Re-measure for v7. If the app already loads custom fonts, override `--cometchat-font-family` to skip preloading kit fonts. For evaluators: pricing at cometchat.com/pricing (free tier for dev/test); data export via REST (`GET /v3/users|groups|messages`) — no lock-in.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# docs-map — CometChat React v7: intent → the exact docs page to fetch
|
|
2
|
+
|
|
3
|
+
## Reaching docs — PREFER the CometChat docs MCP; fetch is the fallback
|
|
4
|
+
The canonical doc channel is the **first-party CometChat docs MCP** — tools `search_cometchat_docs`,
|
|
5
|
+
`fetch_cometchat_doc_page`, and `get_cometchat_implementation_bundle`. **If those tools are connected,
|
|
6
|
+
use them instead of a raw web fetch:**
|
|
7
|
+
- **Find the page** → `search_cometchat_docs(query, version?)` — replaces browsing the scoped `llms-*` index.
|
|
8
|
+
- **Read the page** → `fetch_cometchat_doc_page(path)` — pass the SAME `<path>` the tables below list
|
|
9
|
+
(the conversations page path for your platform); the MCP resolves the `.md` twin and returns raw Markdown.
|
|
10
|
+
A full `https://…/docs/<path>` URL also works.
|
|
11
|
+
- **A whole feature/recipe** → `get_cometchat_implementation_bundle(...)` is **NON-AUTHORITATIVE** — curated STATIC recipes that can lag the live docs (verified stale vs v7: e.g. `CometChatConversationsWithMessages`, `css-variables.css`). Treat any bundle as a hint only: RECONCILE it against the `fetch_cometchat_doc_page` result + the pack's hardening; never emit bundle code verbatim.
|
|
12
|
+
|
|
13
|
+
The MCP reads whatever docs environment it is pointed at (production by default; a preview when repointed),
|
|
14
|
+
so it also carries the environment-swap concern below — no hardcoded host on the skill side.
|
|
15
|
+
|
|
16
|
+
**If the MCP tools are NOT connected:** add it (`claude mcp add --transport http cometchat-docs https://mcp.cometchat.com/mcp`, or reinstall/enable the plugin) and retry; only if it still will not connect, fall back to a plain fetch via `DOCS_BASE` (defined next).
|
|
17
|
+
Either way the `<path>` catalog in this file is the source of truth for WHICH page — MCP-vs-fetch is only HOW.
|
|
18
|
+
|
|
19
|
+
## DOCS_BASE — the fetch FALLBACK entry point (⚠️ SWAP HERE to change environments)
|
|
20
|
+
```
|
|
21
|
+
DOCS_BASE = https://www.cometchat.com/docs
|
|
22
|
+
```
|
|
23
|
+
> **Fetch rule:** always build a URL as `DOCS_BASE` + the path shown, then append `.md`.
|
|
24
|
+
> Never hardcode a host anywhere else; never read `node_modules`/`.d.ts`.
|
|
25
|
+
|
|
26
|
+
## The convention
|
|
27
|
+
`DOCS_BASE` + `<path>` + `.md` → raw Markdown (verbatim code + an "AI Integration Quick Reference"
|
|
28
|
+
JSON block: prop names, types, defaults).
|
|
29
|
+
```
|
|
30
|
+
Fetch: {DOCS_BASE}/ui-kit/react/components/conversations.md
|
|
31
|
+
```
|
|
32
|
+
Fallback order: `.md` twin → if it 404s, the same URL **without** `.md` (HTML) → **never** a `.d.ts`.
|
|
33
|
+
|
|
34
|
+
## Scoped React v7 index (prefer over the global llms.txt)
|
|
35
|
+
```
|
|
36
|
+
{DOCS_BASE}/ui-kit/react/llms-react-v7.md
|
|
37
|
+
```
|
|
38
|
+
A React-v7-only index of every page as a `.md` link (~3k tok) — use it to discover any page not in
|
|
39
|
+
the table below. Global all-products index (large, ~25k tok; last resort): `{DOCS_BASE}/llms.txt`.
|
|
40
|
+
|
|
41
|
+
## SDK docs — the FALLBACK reference (a feature the UI Kit has NO component for)
|
|
42
|
+
The rule of the pack: **for every feature, first check whether the UI Kit has a component/prop for it
|
|
43
|
+
(this file's table + `component-props.md` + the catalog). If it does — USE it. If it does NOT** (e.g.
|
|
44
|
+
AI agents, campaigns, advanced/AI moderation, transient messages, bots, webhooks, low-level presence)
|
|
45
|
+
**— drop to the JavaScript Chat SDK and call its methods directly** (the SDK library is already
|
|
46
|
+
installed under the UI Kit; init/login already use it). Look the method up in the SDK docs — never guess:
|
|
47
|
+
```
|
|
48
|
+
SDK_DOCS_BASE = https://www.cometchat.com/docs
|
|
49
|
+
```
|
|
50
|
+
- **SDK index (scoped — PREFER this):** `{SDK_DOCS_BASE}/sdk/javascript/llms-javascript-v4.md` — a **JS-SDK-v4-only** routing index of every SDK page as a `.md` twin, grouped by area (Messaging · Calling · Users · Groups · **AI, campaigns & webhooks: AI Moderation · AI Agents · AI Copilot · Campaigns · Webhooks** · Real-time Listeners · Key Concepts · …). Start here to find the feature's page. **Do NOT use the site-wide global `{SDK_DOCS_BASE}/llms.txt`** (all products, far larger) except as a last resort if the scoped index 404s — mirrors the React scoped-index rule above.
|
|
51
|
+
- **Convention:** `{SDK_DOCS_BASE}/sdk/javascript/<page>` then append `.md` for the raw Markdown twin. Each SDK page opens with an **"AI Integration Quick Reference" accordion** (Package · Import · **Key methods**) — read that FIRST for the exact method names/signatures, then the tables + TS/JS examples below.
|
|
52
|
+
- **Example:** AI agents → `{SDK_DOCS_BASE}/sdk/javascript/ai-agents.md` → `CometChat.addAIAssistantListener(id, …)`, `CometChat.AIAssistantMessage`, `CometChat.AIToolCall`, `getAssistantMessageData()`, …
|
|
53
|
+
> Never hand-roll a feature that exists in the UI Kit OR the SDK, and never guess an SDK method — look it up in the SDK index → the page's Quick-Reference accordion.
|
|
54
|
+
|
|
55
|
+
## Don't fetch the hot path — it's baked
|
|
56
|
+
Install, `init → login → render`, the provider, and the ~12 drop-in props for "add chat" are BAKED
|
|
57
|
+
in `cometchat-react-v7-core`. Fetch ONLY for exhaustive props / view-slots / long-tail components /
|
|
58
|
+
theming tokens / feature enablement.
|
|
59
|
+
|
|
60
|
+
## The 80% trigger table (URL = `{DOCS_BASE}` + path, then append `.md`)
|
|
61
|
+
| Intent | Path (append `.md`) |
|
|
62
|
+
|---|---|
|
|
63
|
+
| setup / init / login / render | `/ui-kit/react/integration-react` |
|
|
64
|
+
| Next.js / React Router / Astro setup | `/ui-kit/react/integration-nextjs` · `-react-router` · `-astro` |
|
|
65
|
+
| conversation list (full props) | `/ui-kit/react/components/conversations` |
|
|
66
|
+
| message list | `/ui-kit/react/components/message-list` |
|
|
67
|
+
| message composer | `/ui-kit/react/components/message-composer` |
|
|
68
|
+
| message header | `/ui-kit/react/components/message-header` |
|
|
69
|
+
| users / groups / group members | `/ui-kit/react/components/users` · `groups` · `group-members` |
|
|
70
|
+
| threads | `/ui-kit/react/components/thread-header` |
|
|
71
|
+
| message search | `/ui-kit/react/components/search` |
|
|
72
|
+
| reactions | `/ui-kit/react/components/reactions` |
|
|
73
|
+
| message bubbles (swap/custom) | `/ui-kit/react/components/<x>-bubble` (text/image/video/audio/file/poll/sticker/card…) |
|
|
74
|
+
| voice/video call buttons | `/ui-kit/react/components/call-buttons` |
|
|
75
|
+
| incoming / outgoing call UI | `/ui-kit/react/components/incoming-call` · `outgoing-call` |
|
|
76
|
+
| call logs | `/ui-kit/react/components/call-logs` |
|
|
77
|
+
| calls setup / enable calling (calls-setup) | `/ui-kit/react/integration-react` · Calls SDK: `/calls/javascript/setup` |
|
|
78
|
+
| custom call surface / joinSession (calls-react-integration) | `/calls/javascript/react-integration` |
|
|
79
|
+
| screen-share · recording · device-select · idle-timeout · virtual-bg | `/calls/javascript/screen-sharing` · `recording` · `device-management` · `idle-timeout` · `virtual-background` |
|
|
80
|
+
| AI assistant | `/ui-kit/react/components/ai-assistant-chat` |
|
|
81
|
+
| web push setup (push-overview / web-push) | `/notifications/push-overview` · `/notifications/web-push-notifications` |
|
|
82
|
+
| notification preferences / mute (notification-preferences) | `/notifications/preferences` |
|
|
83
|
+
| theming / CSS `--cometchat-*` tokens | `/ui-kit/react/theming` |
|
|
84
|
+
| plugins | `/ui-kit/react/plugins/overview` |
|
|
85
|
+
| event system | `/ui-kit/react/event-system` |
|
|
86
|
+
| full component list | `/ui-kit/react/components-overview` |
|
|
87
|
+
| v6→v7 migration / upgrade | `/ui-kit/react/migration-overview` · `/ui-kit/react/migration-property-changes` |
|
|
88
|
+
|
|
89
|
+
## Task guides (recipes) — for a whole FEATURE, BUILD FROM the guide + COMPARE against it (docs-maximal)
|
|
90
|
+
For a TASK/feature ask (a whole capability, not just one component's props), the docs ship **full end-to-end
|
|
91
|
+
guides**. **Discover them from the scoped llms index's "Task guides (recipes)" section**
|
|
92
|
+
(`{DOCS_BASE}/ui-kit/react/llms-react-v7.md`) — the index is the source of truth (new guides appear there;
|
|
93
|
+
do NOT bake this list). At time of writing it lists: `guide-new-chat-creation` · `guide-group-chat-setup` ·
|
|
94
|
+
`guide-search-messages` · `guide-threaded-messages` · `guide-message-privately` · `guide-block-unblock-user`.
|
|
95
|
+
**Use the matching guide TWO ways — prefer it over baked recipe prose wherever a guide exists:**
|
|
96
|
+
1. **As the implementation SOURCE** — fetch `{DOCS_BASE}/ui-kit/react/<guide>.md` and build the feature from
|
|
97
|
+
the official recipe. **Adapt it ADDITIVELY** into the user's app (reuse their routing/auth/layout; never
|
|
98
|
+
drop in the guide's standalone shell).
|
|
99
|
+
2. **As a COMPLETENESS + CORRECTNESS check** — after you emit, DIFF your implementation against the guide:
|
|
100
|
+
did you cover every component, prop, step, and affordance it shows? Fill any gap. This is the docs-sourced
|
|
101
|
+
completeness oracle (richer + more current than a baked minimum).
|
|
102
|
+
> **Then apply the baked HARDENING DELTAS on top — the guide is the BASELINE, not the whole truth.** The
|
|
103
|
+
> guides do NOT carry the audit lessons: thread list/composer need the conversation **`user`/`group` AND**
|
|
104
|
+
> `parentMessageId` (AUDIT-060); in-chat search must be **scoped** (`uid`/`guid`) vs global (AUDIT-041);
|
|
105
|
+
> container **sizing** (`100dvh` + column CSS); wrap in **`CometChatErrorBoundary`**; roster lists **double
|
|
106
|
+
> under StrictMode** (dev); **wire-or-hide** every default-on affordance. Build from the guide, then correct
|
|
107
|
+
> with these. (Several audits were literally GAPS in the official guide — the guide gets you complete, the
|
|
108
|
+
> deltas get you correct.)
|
|
109
|
+
|
|
110
|
+
**No matching guide in the index? → continue EXACTLY as before** — build from the pack's baked golden-path /
|
|
111
|
+
recipe (`FULL-APP-BLUEPRINT`, placement recipes, `component-props.md`) and fetch each component's `.md` twin
|
|
112
|
+
for exact props. **The guide is an ENHANCEMENT when present, never a hard dependency** — a feature without a
|
|
113
|
+
task guide is built the normal way, not blocked.
|
|
114
|
+
|
|
115
|
+
## Not in the table?
|
|
116
|
+
Fetch the scoped index (`{DOCS_BASE}/ui-kit/react/llms-react-v7.md`), pick the page, fetch its `.md`.
|
|
117
|
+
Never guess a path; never read `.d.ts`; never answer props from memory.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# i18n, RTL, accessibility (React v7)
|
|
2
|
+
|
|
3
|
+
The UI Kit handles all three out of the box; careless customization breaks them.
|
|
4
|
+
|
|
5
|
+
## RTL
|
|
6
|
+
Reads `dir="rtl"` from the document root — components flip automatically (bubbles mirror, avatars swap, icons rotate). Test with `<html dir="rtl">`. Custom views MUST use logical properties (`margin-inline-start`, `padding-inline-end`) or they break RTL.
|
|
7
|
+
|
|
8
|
+
## i18n — localization works via the provider; NEVER render a raw key
|
|
9
|
+
`CometChatProvider` **auto-wires localization** (it renders `LocaleProvider` internally, `locale` prop) — the kit's ~40 built-in languages load out of the box (default `en-us`). You do NOT manually init for the default language.
|
|
10
|
+
- **Non-default language:** set the `locale` prop on `CometChatProvider` (`<CometChatProvider locale="fr">`) — that's the v7 way to switch language. `init` / `setCurrentLanguage` / `getCurrentLanguage` / `addTranslation` are **INSTANCE** methods on `CometChatLocalize`, NOT statics — calling e.g. `CometChatLocalize.setCurrentLanguage(...)` is a TS2339 error. Reach the live instance with `CometChatLocalize.getSharedInstance()` (registered by `CometChatUIKit.init*` / the provider) and configure it there — `getSharedInstance()?.init({ translationsForLanguage, timezone, calendarObject, fallbackLanguage, … })`. **Don't `new CometChatLocalize(...)`**: the provider reads only the shared instance, so a constructed one isn't wired to the UI. Language stays on the `locale` prop (default `"en-us"`) — the provider applies it on mount/change, overriding an earlier `init({ language })`.
|
|
11
|
+
- **Custom strings:** `CometChatLocalize.getSharedInstance()?.addTranslation(resources)` where `resources` is **nested per-language** `Record<lang, Record<key, string>>` (NOT a flat map; verified vs 7.1.0). Runtime hook: `useLocale()` → `{ getLocalizedString, language }`.
|
|
12
|
+
- **`getLocalizedString(key)` returns the RAW KEY on a miss** (verified in the kit — `translate` falls back to `return key`). So a snake_case token in the UI (`group_info`, `add_members`, `delete_and_exit`, `view_members`) is a **localization failure**: a wrong/removed key, a custom language set without its translations, or — the #1 cause — **custom UI that rendered the key literally as a label.**
|
|
13
|
+
- **NEVER hardcode a localization key as text.** Use the kit component (it localizes itself) or `useLocale().getLocalizedString(key)` — never `<button>group_info</button>`.
|
|
14
|
+
- Don't invent keys; verify against the localization docs (`.md` twin, never the `.d.ts`). **v6→v7 changed some keys**, so a stale v6 key now misses and shows the raw string.
|
|
15
|
+
|
|
16
|
+
## Accessibility
|
|
17
|
+
Defaults ship: `aria-label` on icon buttons; `role="listbox"`/`option` on lists; Tab/Enter/Esc keyboard nav; focus management on thread open/close. When customizing:
|
|
18
|
+
1. Icon-only button → add `aria-label="<verb>"`.
|
|
19
|
+
2. List item → keep `role="option"` + `aria-selected`.
|
|
20
|
+
3. Composer → keep an accessible `<label>` + `Enter`/`Shift+Enter`.
|
|
21
|
+
4. Modal → trap focus, restore on close, `role="dialog"` + `aria-modal="true"` + labelled heading.
|
|
22
|
+
5. Theming → verify text contrast ≥ 4.5:1. Deep custom views own their own a11y; test with a screen reader + keyboard.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# layout — the reflow-free chat surface (the ONE sizing standard)
|
|
2
|
+
|
|
3
|
+
The single source of truth for how a CometChat surface is SIZED so it renders full-size
|
|
4
|
+
from the first frame and never reflows. `core`, `placement`, and `calls` POINT here
|
|
5
|
+
instead of each re-stating the CSS — change the rule once, here.
|
|
6
|
+
|
|
7
|
+
> **The kit is NOT the problem.** Every UI Kit component fills its parent by design
|
|
8
|
+
> (`height:100%` / flex-fill) and ships its OWN loading/empty state
|
|
9
|
+
> (`loadingView` / `emptyView` slots). A surface that starts small and grows, or collapses
|
|
10
|
+
> to ~0px, is a HOST **container-sizing** defect, not a kit bug: the host box is
|
|
11
|
+
> **content-driven** instead of **pinned**. Pin the box and the kit renders full-size
|
|
12
|
+
> immediately and swaps loading→loaded INSIDE a stable box — zero shift.
|
|
13
|
+
|
|
14
|
+
## The named failure modes
|
|
15
|
+
|
|
16
|
+
Two distinct sizing defects, one root cause (a content-driven box the kit then fills):
|
|
17
|
+
|
|
18
|
+
1. **Static collapse** — the surface renders as a ~0px sliver / crammed top-left, because
|
|
19
|
+
the mount container (or an ancestor) has no resolved height. (The #1 "UI looks broken"
|
|
20
|
+
report; anti-patterns #8.)
|
|
21
|
+
2. **Load-transition reflow** *(named here for the first time)* — the surface is SMALL
|
|
22
|
+
while the conversation list loads, then GROWS to full size once content arrives; height
|
|
23
|
+
and/or width expand WITH content instead of being pinned. It looks broken and can
|
|
24
|
+
misplace the UI. Root cause: the box is **content-driven** (ancestor chain not
|
|
25
|
+
`height:100%`, or the container uses `min-height`/`auto`, or an intermediate wrapper
|
|
26
|
+
isn't sized), so before content loads there is nothing to give the box its size — the
|
|
27
|
+
kit fills "nothing," and only grows as messages/list items arrive. **A pinned box with
|
|
28
|
+
a prepared ancestor chain is full-size from frame 1; the kit's own loading state fills
|
|
29
|
+
it; the swap to loaded causes NO reflow.**
|
|
30
|
+
|
|
31
|
+
## The five invariants (a reflow-free surface satisfies ALL)
|
|
32
|
+
|
|
33
|
+
**(a) Prepare the ancestor chain.** Make `html, body, #root` full-height so a
|
|
34
|
+
`100dvh`/`100%` on your container has a non-zero chain to resolve against:
|
|
35
|
+
```css
|
|
36
|
+
html, body, #root { height: 100%; margin: 0; }
|
|
37
|
+
```
|
|
38
|
+
A bare app usually has NONE of these → every descendant height resolves against `0`. A
|
|
39
|
+
fresh Vite/CRA/Next scaffold has the OPPOSITE problem — it CENTERS + width-caps + pads
|
|
40
|
+
`#root` (`max-width:1280px; margin:0 auto; padding:2rem; text-align:center` +
|
|
41
|
+
`body{display:flex; place-items:center}`), gutter-boxing chat into a centered island with
|
|
42
|
+
content clipping off the edge. **Watch for a WIDTH-PINNED root, not just `max-width`
|
|
43
|
+
(AUDIT-035):** some scaffolds pin `#root { width: 1126px; margin: 0 auto; border-inline: … }`
|
|
44
|
+
— nulling only `max-width` leaves the fixed `width`, so the surface stays gutter-boxed on
|
|
45
|
+
desktop AND overflows horizontally on a phone. Reset `width` (and `min-height`/`border`) too.
|
|
46
|
+
Either way, RESET/PREPARE the root before the chat CSS — add what's missing AND undo the
|
|
47
|
+
scaffold cruft (AUDIT-019/035):
|
|
48
|
+
```css
|
|
49
|
+
#root { width: auto; max-width: none; min-height: 0; border: 0; text-align: left; display: block; } /* undo cap/center/pad AND a width-pin */
|
|
50
|
+
body { display: block; place-items: normal; min-width: 0; } /* undo body flex-centering */
|
|
51
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**(b) Pin the surface to a content-INDEPENDENT height.** The surface box's height must NOT
|
|
55
|
+
depend on its content. Full-page → `height: 100dvh` (a stable viewport height). Embedded →
|
|
56
|
+
a **fixed height** (e.g. `600px`) or a **sized grid/flex CELL** that supplies one. **Never
|
|
57
|
+
`min-height` and never `auto`** on the surface box — those grow with content and are the
|
|
58
|
+
load-transition reflow. `100dvh` (dynamic viewport height) beats `100vh` on mobile (no jump
|
|
59
|
+
when the URL bar hides).
|
|
60
|
+
|
|
61
|
+
**(c) Size the columns/panes.** Sizing the root is NOT enough — the columns are the kit's
|
|
62
|
+
actual parents and must resolve a height + a bounded width, or the kit fills content size
|
|
63
|
+
and the surface crams into the top-left:
|
|
64
|
+
```css
|
|
65
|
+
.cc-app { display: flex; height: 100dvh; width: 100%; overflow: hidden; }
|
|
66
|
+
.cc-app .list-column { width: 320px; flex-shrink: 0; height: 100%; }
|
|
67
|
+
.cc-app .message-pane { flex: 1 1 0; min-width: 0; min-height: 0; height: 100%;
|
|
68
|
+
display: flex; flex-direction: column; overflow: hidden; }
|
|
69
|
+
```
|
|
70
|
+
**`min-height: 0` + `min-width: 0`** are load-bearing: a flex child's default
|
|
71
|
+
`min-height:auto` refuses to shrink below its content, so a long list/message GROWS the
|
|
72
|
+
parent (reflow + overflow) instead of scrolling inside it. `min-height:0` lets the child
|
|
73
|
+
**scroll, not grow the parent**; `min-width:0` + `overflow:hidden` stop horizontal spill.
|
|
74
|
+
|
|
75
|
+
**Keep `CometChatProvider` OUT of the flex chain, and don't rely on `height:100%` in a flex
|
|
76
|
+
chain (AUDIT-036).** `CometChatProvider` renders a `<div class="cometchat">` wrapper. Put it
|
|
77
|
+
OUTSIDE the sized `.cc-app` (wrap the whole surface) — NOT between `.cc-app` and the columns:
|
|
78
|
+
a wrapper there becomes an unsized block in the flex row, so the columns stop forming a row
|
|
79
|
+
and the pane's height chain collapses (measured live: the message pane shrank to just its
|
|
80
|
+
65px header). The `height:100%` in (c) above works ONLY because `.cc-app` is a fixed
|
|
81
|
+
`100dvh` box (a definite height for `%` to resolve against). If you add an **app bar above
|
|
82
|
+
the surface** so `.cc-app` becomes a flex *child* (`flex:1`) instead of a fixed `100dvh`
|
|
83
|
+
box, its height is flex-derived/indefinite and `height:100%` on the columns collapses to
|
|
84
|
+
content — drive heights through the flex chain instead: every level `display:flex` +
|
|
85
|
+
`flex:1 1 0` + `min-height:0` (stretch, not `height:100%`), give the provider's `.cometchat`
|
|
86
|
+
wrapper `flex:1 1 0; min-height:0; display:flex`, and flex the list vs composer explicitly
|
|
87
|
+
(list `flex:1 1 0; min-height:0`, composer `flex:0 0 auto`).
|
|
88
|
+
|
|
89
|
+
**(d) Render the kit's OWN loading state inside the pinned box — no load-transition
|
|
90
|
+
reflow.** The surface must be **full-size BEFORE content loads, not grow into it.** Because
|
|
91
|
+
(a)–(c) pin the box independently of content, the kit's built-in loading/empty state
|
|
92
|
+
(`loadingView` / `emptyView` — the components ship them) renders as a **full-size
|
|
93
|
+
skeleton**, and when real data arrives the loaded view swaps in **inside the same box with
|
|
94
|
+
zero shift.** Do NOT gate the whole surface behind your own "is it loaded yet?" flag that
|
|
95
|
+
mounts a small placeholder then a big chat — that IS the reflow. Mount the sized surface
|
|
96
|
+
immediately; let each component show its own loading state in place.
|
|
97
|
+
|
|
98
|
+
**(e) No `transform` / `filter` on ancestors.** A non-`none` `transform`, `filter`,
|
|
99
|
+
`backdrop-filter`, `perspective`, or `will-change:transform` on any ancestor of the chat
|
|
100
|
+
creates a containing block that clips the kit's `position:fixed` overlays (options menu,
|
|
101
|
+
emoji picker, reactions, thread panel, call screen) — and Tailwind `translate-*`/`scale-*`/
|
|
102
|
+
`rotate-*`/`transition-transform` all compile to `transform`. Animate `right`/`left`/width
|
|
103
|
+
instead (anti-patterns #11). Also: don't let host global CSS (`text-align`/flex-centering/
|
|
104
|
+
`flex`/a reset/Tailwind base) leak onto the `.cometchat` subtree — it mis-sizes kit
|
|
105
|
+
internals; scope it away and customize via `--cometchat-*` vars + view slots (anti-patterns
|
|
106
|
+
#12), never by overriding internal BEM classes.
|
|
107
|
+
|
|
108
|
+
## The minimal full-page recipe (put it BEFORE the chat CSS)
|
|
109
|
+
|
|
110
|
+
```css
|
|
111
|
+
/* (a) prepare/RESET the ancestor chain — do this FIRST */
|
|
112
|
+
html, body, #root { height: 100%; margin: 0; padding: 0; }
|
|
113
|
+
#root { max-width: none; text-align: left; display: block; }
|
|
114
|
+
body { display: block; place-items: normal; }
|
|
115
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
116
|
+
/* (b) pin the surface + (c) size the columns (min-height:0 = scroll, don't grow) */
|
|
117
|
+
.cc-app { display: flex; height: 100dvh; width: 100%; overflow: hidden; }
|
|
118
|
+
.cc-app .list-column { width: 320px; flex-shrink: 0; height: 100%; }
|
|
119
|
+
.cc-app .message-pane { flex: 1 1 0; min-width: 0; min-height: 0; height: 100%;
|
|
120
|
+
display: flex; flex-direction: column; overflow: hidden; }
|
|
121
|
+
```
|
|
122
|
+
For the grown three-column app the same invariants hold with an extra `.side-column`
|
|
123
|
+
(fixed-ish width, `height:100%`, `min-height:0`) — the full 3-column CSS is in
|
|
124
|
+
`cometchat-react-v7-placement` (the Combined-app recipe), which references THIS standard for
|
|
125
|
+
the invariants.
|
|
126
|
+
|
|
127
|
+
## Embedded (not full-page)
|
|
128
|
+
|
|
129
|
+
Opt out of `100dvh`, keep invariants (a),(c),(d),(e): give the surface box a **fixed
|
|
130
|
+
height** (`height:600px`) or drop it into a **sized grid/flex cell** whose track supplies a
|
|
131
|
+
resolved height (`grid-template-rows: 1fr` on a `100dvh` parent, or a flex parent with the
|
|
132
|
+
region `flex:1; min-height:0`). Never a `min-height`/`auto` region — same reflow. See the
|
|
133
|
+
`placement` embedded/popup/sidebar variants.
|
|
134
|
+
|
|
135
|
+
## The invariant, per platform (this file is the WEB recipe)
|
|
136
|
+
|
|
137
|
+
The PRINCIPLE is universal — every platform's UI Kit fills its container and must not
|
|
138
|
+
reflow between loading and loaded, so every platform pins a content-independent box and
|
|
139
|
+
lets the kit's own loading state fill it. The RECIPE differs:
|
|
140
|
+
- **web (react/angular):** this file — `100dvh` + the prepared/reset ancestor chain + the
|
|
141
|
+
`min-height:0` columns + no `transform`/`filter` on ancestors + the kit's
|
|
142
|
+
`loadingView`/`emptyView` inside the pinned box.
|
|
143
|
+
- **mobile (rn/flutter/native), when those packs exist:** the equivalent — flex-fill /
|
|
144
|
+
`Expanded`/`match_parent` to a stable screen size, safe-area insets, keyboard-avoidance
|
|
145
|
+
so the composer doesn't reflow the list, and the kit's own loading state inside the
|
|
146
|
+
pinned screen. Each platform's `core`/`placement` bakes its own `layout` recipe and
|
|
147
|
+
inherits the SAME contract (`prepared-ancestor-chain`, `pinned-viewport-height`,
|
|
148
|
+
`no-load-transition-reflow`, `column-min-height-0` — the web tokens; a platform renames
|
|
149
|
+
the mechanism, not the invariant). See the factory `RULES.md` "Layout / sizing" rule.
|
|
150
|
+
|
|
151
|
+
## Verify (advisory, human check)
|
|
152
|
+
|
|
153
|
+
Full-size from the FIRST frame (a full-height skeleton, not a small box that grows); no
|
|
154
|
+
reflow when the conversation list finishes loading (the box doesn't change size); no ~0px
|
|
155
|
+
collapse; no horizontal scrollbar at wide (1280) or narrow (720) widths
|
|
156
|
+
(`scrollWidth > innerWidth` ⇒ broken); overlays (menus, emoji, thread, call) anchor to the
|
|
157
|
+
viewport (no `transform`/`filter` ancestor). If it grows into place, an ancestor is
|
|
158
|
+
content-driven — walk (a)→(c).
|