@cometchat/skills 4.4.1 → 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.
Files changed (489) hide show
  1. package/.claude-plugin/marketplace.json +55 -0
  2. package/.claude-plugin/plugin.json +14 -0
  3. package/CHANGELOG.md +36 -0
  4. package/README.md +41 -163
  5. package/RULES.md +114 -0
  6. package/bin/cometchat-skills.mjs +1180 -0
  7. package/bin/legacy-skills.json +95 -0
  8. package/catalogs/android-v6.json +1646 -0
  9. package/catalogs/flutter-v6.json +651 -0
  10. package/catalogs/ios-v5.json +1383 -0
  11. package/catalogs/rn-calls-v5.json +134 -0
  12. package/catalogs/rn-calls-v5.symbols.txt +58 -0
  13. package/catalogs/rn-sdk-v4.json +672 -0
  14. package/catalogs/rn-v5.json +449 -0
  15. package/catalogs/rn-v5.symbols.txt +216 -0
  16. package/catalogs/sdk-android-v5.json +514 -0
  17. package/contracts.android-calls-v5.json +122 -0
  18. package/contracts.android-v6.json +135 -0
  19. package/contracts.angular-v5.json +694 -0
  20. package/contracts.flutter-calls-v5.json +77 -0
  21. package/contracts.flutter-v6.json +126 -0
  22. package/contracts.ios-calls-v5.json +67 -0
  23. package/contracts.ios-v5.json +436 -0
  24. package/contracts.json +82 -0
  25. package/contracts.rn-calls-v5.json +77 -0
  26. package/contracts.rn-v5.json +727 -0
  27. package/contracts.sdk-android-v5.json +15 -0
  28. package/contracts.web-calls-v5.json +45 -0
  29. package/features.android-calls-v5.json +246 -0
  30. package/features.android-v6.json +65 -0
  31. package/features.angular-v5.json +521 -0
  32. package/features.flutter-calls-v5.json +286 -0
  33. package/features.flutter-v6.json +484 -0
  34. package/features.ios-calls-v5.json +236 -0
  35. package/features.ios-v5.json +573 -0
  36. package/features.json +61 -0
  37. package/features.rn-calls-v5.json +187 -0
  38. package/features.rn-v5.json +614 -0
  39. package/features.sdk-android-v5.json +40 -0
  40. package/features.sdk-jsv4.json +24 -0
  41. package/features.web-calls-v5.json +108 -0
  42. package/package.json +151 -74
  43. package/peers.yaml +312 -0
  44. package/registry/README.md +31 -0
  45. package/registry/android-calls-v5.json +54 -0
  46. package/registry/android-v6.json +137 -0
  47. package/registry/angular-v5.json +114 -0
  48. package/registry/flutter-calls-v5.json +54 -0
  49. package/registry/flutter-v6.json +119 -0
  50. package/registry/ios-calls-v5.json +59 -0
  51. package/registry/ios-v5.json +97 -0
  52. package/registry/rn-calls-v5.json +59 -0
  53. package/registry/rn-v5.json +129 -0
  54. package/registry/sdk-android-v5.json +53 -0
  55. package/registry/sdk-jsv4.json +53 -0
  56. package/registry/web-calls-v5.json +54 -0
  57. package/registry/web-v7.json +99 -0
  58. package/skills/cometchat/SKILL.md +42 -2096
  59. package/skills/cometchat-android-v5-calls-sdk/SKILL.md +206 -0
  60. package/skills/cometchat-android-v5-calls-sdk/references/build-truth.md +63 -0
  61. package/skills/cometchat-android-v5-calls-sdk/references/docs-map.md +119 -0
  62. package/skills/cometchat-android-v5-calls-sdk/references/method-map.md +53 -0
  63. package/skills/cometchat-android-v5-calls-sdk/references/pitfalls.md +72 -0
  64. package/skills/cometchat-android-v5-calls-sdk/references/ringing.md +92 -0
  65. package/skills/cometchat-android-v5-calls-sdk/references/user-switch.md +90 -0
  66. package/skills/cometchat-android-v5-sdk/SKILL.md +127 -0
  67. package/skills/cometchat-android-v5-sdk/references/app-surface.md +88 -0
  68. package/skills/cometchat-android-v5-sdk/references/docs-map.md +91 -0
  69. package/skills/cometchat-android-v6-builder-settings/SKILL.md +51 -137
  70. package/skills/cometchat-android-v6-calls/SKILL.md +128 -411
  71. package/skills/cometchat-android-v6-compose-components/SKILL.md +84 -194
  72. package/skills/cometchat-android-v6-compose-customization/SKILL.md +66 -411
  73. package/skills/cometchat-android-v6-compose-placement/SKILL.md +154 -237
  74. package/skills/cometchat-android-v6-core/SKILL.md +236 -672
  75. package/skills/cometchat-android-v6-core/references/anti-patterns.md +31 -0
  76. package/skills/cometchat-android-v6-core/references/component-props.md +168 -0
  77. package/skills/cometchat-android-v6-core/references/docs-map.md +153 -0
  78. package/skills/cometchat-android-v6-core/references/layout.md +112 -0
  79. package/skills/cometchat-android-v6-core/references/lifecycle.md +75 -0
  80. package/skills/cometchat-android-v6-core/references/setup-credentials.md +105 -0
  81. package/skills/cometchat-android-v6-core/references/troubleshooting.md +36 -0
  82. package/skills/cometchat-android-v6-events/SKILL.md +46 -184
  83. package/skills/cometchat-android-v6-extensions/SKILL.md +39 -179
  84. package/skills/cometchat-android-v6-features/SKILL.md +74 -143
  85. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +75 -193
  86. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +67 -419
  87. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +77 -223
  88. package/skills/cometchat-android-v6-migration/SKILL.md +67 -378
  89. package/skills/cometchat-android-v6-production/SKILL.md +40 -179
  90. package/skills/cometchat-android-v6-push/SKILL.md +39 -289
  91. package/skills/cometchat-android-v6-testing/SKILL.md +50 -265
  92. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +70 -254
  93. package/skills/cometchat-angular-v5-calls/SKILL.md +193 -0
  94. package/skills/cometchat-angular-v5-components/SKILL.md +131 -0
  95. package/skills/cometchat-angular-v5-components/references/catalog.md +111 -0
  96. package/skills/cometchat-angular-v5-components/references/host-composed.md +46 -0
  97. package/skills/cometchat-angular-v5-core/SKILL.md +300 -0
  98. package/skills/cometchat-angular-v5-core/references/anti-patterns.md +49 -0
  99. package/skills/cometchat-angular-v5-core/references/component-props.md +55 -0
  100. package/skills/cometchat-angular-v5-core/references/dependencies.md +66 -0
  101. package/skills/cometchat-angular-v5-core/references/docs-map.md +132 -0
  102. package/skills/cometchat-angular-v5-core/references/layout.md +64 -0
  103. package/skills/cometchat-angular-v5-core/references/lifecycle.md +202 -0
  104. package/skills/cometchat-angular-v5-core/references/setup-credentials.md +137 -0
  105. package/skills/cometchat-angular-v5-core/references/theming.md +70 -0
  106. package/skills/cometchat-angular-v5-core/references/troubleshooting.md +27 -0
  107. package/skills/cometchat-angular-v5-customization/SKILL.md +94 -0
  108. package/skills/cometchat-angular-v5-features/SKILL.md +107 -0
  109. package/skills/cometchat-angular-v5-features/references/custom-messages.md +133 -0
  110. package/skills/cometchat-angular-v5-features/references/formatters.md +28 -0
  111. package/skills/cometchat-angular-v5-features/references/host-composed-extensions.md +85 -0
  112. package/skills/cometchat-angular-v5-migration/SKILL.md +40 -0
  113. package/skills/cometchat-angular-v5-migration/references/migration-guide.md +165 -0
  114. package/skills/cometchat-angular-v5-patterns/SKILL.md +107 -0
  115. package/skills/cometchat-angular-v5-placement/SKILL.md +133 -0
  116. package/skills/cometchat-angular-v5-placement/references/combined-app.md +174 -0
  117. package/skills/cometchat-angular-v5-placement/references/core-surface.md +199 -0
  118. package/skills/cometchat-angular-v5-production/SKILL.md +101 -0
  119. package/skills/cometchat-angular-v5-push/SKILL.md +61 -0
  120. package/skills/cometchat-angular-v5-testing/SKILL.md +112 -0
  121. package/skills/cometchat-angular-v5-troubleshooting/SKILL.md +96 -0
  122. package/skills/cometchat-flutter-v5-sdk/SKILL.md +188 -0
  123. package/skills/cometchat-flutter-v5-sdk/references/doc-corrections.md +55 -0
  124. package/skills/cometchat-flutter-v5-sdk/references/docs-map.md +211 -0
  125. package/skills/cometchat-flutter-v5-sdk/references/platform-notes.md +48 -0
  126. package/skills/cometchat-flutter-v5-sdk/references/transcription.md +87 -0
  127. package/skills/cometchat-flutter-v6-calls/SKILL.md +75 -387
  128. package/skills/cometchat-flutter-v6-components/SKILL.md +88 -361
  129. package/skills/cometchat-flutter-v6-core/SKILL.md +154 -593
  130. package/skills/cometchat-flutter-v6-core/references/anti-patterns.md +55 -0
  131. package/skills/cometchat-flutter-v6-core/references/docs-map.md +143 -0
  132. package/skills/cometchat-flutter-v6-core/references/layout.md +45 -0
  133. package/skills/cometchat-flutter-v6-core/references/lifecycle.md +87 -0
  134. package/skills/cometchat-flutter-v6-core/references/setup-credentials.md +84 -0
  135. package/skills/cometchat-flutter-v6-core/references/troubleshooting.md +26 -0
  136. package/skills/cometchat-flutter-v6-customization/SKILL.md +70 -712
  137. package/skills/cometchat-flutter-v6-events/SKILL.md +79 -174
  138. package/skills/cometchat-flutter-v6-features/SKILL.md +55 -394
  139. package/skills/cometchat-flutter-v6-migration/SKILL.md +68 -367
  140. package/skills/cometchat-flutter-v6-migration/references/migration-guide.md +131 -0
  141. package/skills/cometchat-flutter-v6-patterns/SKILL.md +61 -0
  142. package/skills/cometchat-flutter-v6-placement/SKILL.md +94 -381
  143. package/skills/cometchat-flutter-v6-production/SKILL.md +58 -615
  144. package/skills/cometchat-flutter-v6-push/SKILL.md +46 -455
  145. package/skills/cometchat-flutter-v6-testing/SKILL.md +68 -299
  146. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +54 -878
  147. package/skills/cometchat-ios-calls/SKILL.md +105 -511
  148. package/skills/cometchat-ios-components/SKILL.md +44 -834
  149. package/skills/cometchat-ios-core/SKILL.md +181 -1068
  150. package/skills/cometchat-ios-core/references/anti-patterns.md +80 -0
  151. package/skills/cometchat-ios-core/references/docs-map.md +123 -0
  152. package/skills/cometchat-ios-core/references/install.md +23 -0
  153. package/skills/cometchat-ios-core/references/layout.md +186 -0
  154. package/skills/cometchat-ios-core/references/setup-credentials.md +197 -0
  155. package/skills/cometchat-ios-core/references/swiftui.md +91 -0
  156. package/skills/cometchat-ios-core/references/troubleshooting.md +100 -0
  157. package/skills/cometchat-ios-customization/SKILL.md +33 -968
  158. package/skills/cometchat-ios-features/SKILL.md +29 -738
  159. package/skills/cometchat-ios-migration/SKILL.md +39 -0
  160. package/skills/cometchat-ios-placement/SKILL.md +51 -729
  161. package/skills/cometchat-ios-push/SKILL.md +24 -602
  162. package/skills/cometchat-ios-v5-sdk/SKILL.md +161 -0
  163. package/skills/cometchat-ios-v5-sdk/references/docs-map.md +326 -0
  164. package/skills/cometchat-js-v5-sdk/SKILL.md +95 -0
  165. package/skills/cometchat-js-v5-sdk/references/docs-map.md +114 -0
  166. package/skills/cometchat-onboarding/SKILL.md +89 -0
  167. package/skills/cometchat-onboarding/references/archetypes.md +51 -0
  168. package/skills/cometchat-onboarding/references/calling-first.md +77 -0
  169. package/skills/cometchat-onboarding/references/not-in-this-pack.md +8 -0
  170. package/skills/cometchat-onboarding/references/plan-artifact.md +133 -0
  171. package/skills/cometchat-onboarding/references/platforms.md +90 -0
  172. package/skills/cometchat-react-native-bare-patterns/SKILL.md +120 -0
  173. package/skills/cometchat-react-native-calls/SKILL.md +200 -0
  174. package/skills/cometchat-react-native-components/SKILL.md +142 -0
  175. package/skills/cometchat-react-native-core/SKILL.md +313 -0
  176. package/skills/cometchat-react-native-core/references/anti-patterns.md +79 -0
  177. package/skills/cometchat-react-native-core/references/component-props.md +105 -0
  178. package/skills/cometchat-react-native-core/references/dependencies.md +62 -0
  179. package/skills/cometchat-react-native-core/references/docs-map.md +126 -0
  180. package/skills/cometchat-react-native-core/references/layout.md +61 -0
  181. package/skills/cometchat-react-native-core/references/lifecycle.md +64 -0
  182. package/skills/cometchat-react-native-core/references/setup-credentials.md +39 -0
  183. package/skills/cometchat-react-native-customization/SKILL.md +198 -0
  184. package/skills/cometchat-react-native-expo-patterns/SKILL.md +116 -0
  185. package/skills/cometchat-react-native-features/SKILL.md +122 -0
  186. package/skills/cometchat-react-native-migration/SKILL.md +103 -0
  187. package/skills/cometchat-react-native-placement/SKILL.md +158 -0
  188. package/skills/cometchat-react-native-production/SKILL.md +78 -0
  189. package/skills/cometchat-react-native-push/SKILL.md +88 -0
  190. package/skills/cometchat-react-native-sdk/SKILL.md +126 -0
  191. package/skills/cometchat-react-native-sdk/references/method-map.md +239 -0
  192. package/skills/cometchat-react-native-sdk/references/page-map.md +96 -0
  193. package/skills/cometchat-react-native-testing/SKILL.md +94 -0
  194. package/skills/cometchat-react-native-troubleshooting/SKILL.md +116 -0
  195. package/skills/cometchat-react-native-v5-sdk/SKILL.md +150 -0
  196. package/skills/cometchat-react-native-v5-sdk/references/docs-map.md +127 -0
  197. package/skills/cometchat-react-native-v5-sdk/references/ringing-voip.md +369 -0
  198. package/skills/cometchat-react-v7-calls/SKILL.md +75 -0
  199. package/skills/cometchat-react-v7-components/SKILL.md +72 -0
  200. package/skills/cometchat-react-v7-core/SKILL.md +101 -0
  201. package/skills/cometchat-react-v7-core/references/anti-patterns.md +19 -0
  202. package/skills/cometchat-react-v7-core/references/component-props.md +82 -0
  203. package/skills/cometchat-react-v7-core/references/dependencies.md +23 -0
  204. package/skills/cometchat-react-v7-core/references/docs-map.md +117 -0
  205. package/skills/cometchat-react-v7-core/references/i18n-rtl-a11y.md +22 -0
  206. package/skills/cometchat-react-v7-core/references/layout.md +158 -0
  207. package/skills/cometchat-react-v7-core/references/lifecycle.md +74 -0
  208. package/skills/cometchat-react-v7-core/references/setup-credentials.md +58 -0
  209. package/skills/cometchat-react-v7-core/references/ssr.md +11 -0
  210. package/skills/cometchat-react-v7-core/references/theming.md +52 -0
  211. package/skills/cometchat-react-v7-core/references/troubleshooting.md +28 -0
  212. package/skills/cometchat-react-v7-customization/SKILL.md +84 -0
  213. package/skills/cometchat-react-v7-features/SKILL.md +92 -0
  214. package/skills/cometchat-react-v7-migration/SKILL.md +39 -0
  215. package/skills/cometchat-react-v7-migration/references/migration-guide.md +119 -0
  216. package/skills/cometchat-react-v7-patterns/SKILL.md +43 -0
  217. package/skills/cometchat-react-v7-placement/SKILL.md +106 -0
  218. package/skills/cometchat-react-v7-placement/references/recipes.md +354 -0
  219. package/skills/cometchat-react-v7-push/SKILL.md +53 -0
  220. package/test-suite/README.md +70 -0
  221. package/test-suite/catalogs/android-calls-v5.json +830 -0
  222. package/test-suite/catalogs/android-calls-v5.symbols.txt +499 -0
  223. package/test-suite/catalogs/android-v6.json +1646 -0
  224. package/test-suite/catalogs/android-v6.symbols.txt +298 -0
  225. package/test-suite/catalogs/angular-v5.json +7587 -0
  226. package/test-suite/catalogs/flutter-calls-v5.json +196 -0
  227. package/test-suite/catalogs/flutter-calls-v5.symbols.txt +59 -0
  228. package/test-suite/catalogs/flutter-v6.json +651 -0
  229. package/test-suite/catalogs/ios-calls-v5.json +158 -0
  230. package/test-suite/catalogs/ios-calls-v5.symbols.txt +70 -0
  231. package/test-suite/catalogs/ios-v5.json +1383 -0
  232. package/test-suite/catalogs/ios-v5.symbols.txt +699 -0
  233. package/test-suite/catalogs/rn-calls-v5.json +134 -0
  234. package/test-suite/catalogs/rn-sdk-v4.json +672 -0
  235. package/test-suite/catalogs/rn-v5.json +449 -0
  236. package/test-suite/catalogs/sdk-android-v5.json +514 -0
  237. package/test-suite/catalogs/sdk-android-v5.symbols.txt +254 -0
  238. package/test-suite/catalogs/sdk-jsv4.json +800 -0
  239. package/test-suite/catalogs/web-calls-v5.json +195 -0
  240. package/test-suite/catalogs/web-v7.json +1243 -0
  241. package/test-suite/scripts/build-registry.mjs +113 -0
  242. package/test-suite/scripts/catalog-refresh-dart.mjs +151 -0
  243. package/test-suite/scripts/catalog-refresh.mjs +100 -0
  244. package/test-suite/scripts/lint-skills.mjs +909 -0
  245. package/test-suite/scripts/measure-tokens.mjs +169 -0
  246. package/test-suite/scripts/typecheck-fences-dart.mjs +437 -0
  247. package/test-suite/scripts/typecheck-fences-kotlin.mjs +269 -0
  248. package/test-suite/scripts/typecheck-fences.mjs +206 -0
  249. package/test-suite/scripts/verify-catalog.mjs +242 -0
  250. package/test-suite/scripts/verify-contract-fences.mjs +94 -0
  251. package/test-suite/scripts/verify-detection.mjs +178 -0
  252. package/test-suite/scripts/verify-docs-base.mjs +91 -0
  253. package/test-suite/scripts/verify-family-agnostic.mjs +130 -0
  254. package/test-suite/scripts/verify-golden-path.mjs +138 -0
  255. package/test-suite/scripts/verify-oracle-components.mjs +133 -0
  256. package/test-suite/scripts/verify-template-bindings.mjs +148 -0
  257. package/test-suite/typecheck/angular-v5/package.json +21 -0
  258. package/test-suite/typecheck/angular-v5/tsconfig.json +21 -0
  259. package/test-suite/typecheck/flutter-v6/analysis_options.yaml +25 -0
  260. package/test-suite/typecheck/flutter-v6/pubspec.yaml +21 -0
  261. package/test-suite/typecheck/web-v7/package.json +18 -0
  262. package/test-suite/typecheck/web-v7/tsconfig.json +19 -0
  263. package/bin/install.js +0 -1003
  264. package/skills/.claude-plugin/marketplace.json +0 -86
  265. package/skills/cometchat/references/asking-questions.md +0 -48
  266. package/skills/cometchat-a11y/SKILL.md +0 -477
  267. package/skills/cometchat-android-v5/SKILL.md +0 -121
  268. package/skills/cometchat-android-v5-calls/SKILL.md +0 -427
  269. package/skills/cometchat-android-v5-calls/references/README.md +0 -53
  270. package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +0 -197
  271. package/skills/cometchat-android-v5-calls/references/audio-controls.md +0 -91
  272. package/skills/cometchat-android-v5-calls/references/background-handling.md +0 -168
  273. package/skills/cometchat-android-v5-calls/references/call-layouts.md +0 -131
  274. package/skills/cometchat-android-v5-calls/references/call-logs.md +0 -113
  275. package/skills/cometchat-android-v5-calls/references/call-session.md +0 -274
  276. package/skills/cometchat-android-v5-calls/references/custom-ui.md +0 -150
  277. package/skills/cometchat-android-v5-calls/references/event-listeners.md +0 -123
  278. package/skills/cometchat-android-v5-calls/references/group-calls.md +0 -205
  279. package/skills/cometchat-android-v5-calls/references/idle-timeout.md +0 -117
  280. package/skills/cometchat-android-v5-calls/references/in-call-chat.md +0 -134
  281. package/skills/cometchat-android-v5-calls/references/join-session.md +0 -120
  282. package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +0 -222
  283. package/skills/cometchat-android-v5-calls/references/participant-management.md +0 -110
  284. package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +0 -106
  285. package/skills/cometchat-android-v5-calls/references/raise-hand.md +0 -248
  286. package/skills/cometchat-android-v5-calls/references/recording.md +0 -101
  287. package/skills/cometchat-android-v5-calls/references/ringing-integration.md +0 -152
  288. package/skills/cometchat-android-v5-calls/references/screen-sharing.md +0 -78
  289. package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +0 -215
  290. package/skills/cometchat-android-v5-calls/references/session-settings.md +0 -121
  291. package/skills/cometchat-android-v5-calls/references/setup.md +0 -137
  292. package/skills/cometchat-android-v5-calls/references/share-invite.md +0 -156
  293. package/skills/cometchat-android-v5-calls/references/video-controls.md +0 -87
  294. package/skills/cometchat-android-v5-calls/references/voip-calling.md +0 -526
  295. package/skills/cometchat-android-v5-components/SKILL.md +0 -431
  296. package/skills/cometchat-android-v5-core/SKILL.md +0 -486
  297. package/skills/cometchat-android-v5-customization/SKILL.md +0 -469
  298. package/skills/cometchat-android-v5-extensions/SKILL.md +0 -127
  299. package/skills/cometchat-android-v5-features/SKILL.md +0 -131
  300. package/skills/cometchat-android-v5-placement/SKILL.md +0 -277
  301. package/skills/cometchat-android-v5-production/SKILL.md +0 -95
  302. package/skills/cometchat-android-v5-push/SKILL.md +0 -619
  303. package/skills/cometchat-android-v5-testing/SKILL.md +0 -188
  304. package/skills/cometchat-android-v5-theming/SKILL.md +0 -167
  305. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +0 -74
  306. package/skills/cometchat-android-v6/SKILL.md +0 -108
  307. package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +0 -97
  308. package/skills/cometchat-android-v6-calls/references/advanced-features.md +0 -87
  309. package/skills/cometchat-android-v6-calls/references/call-layouts.md +0 -100
  310. package/skills/cometchat-android-v6-calls/references/call-session.md +0 -163
  311. package/skills/cometchat-android-v6-calls/references/device-management.md +0 -172
  312. package/skills/cometchat-android-v6-calls/references/group-calls.md +0 -191
  313. package/skills/cometchat-android-v6-calls/references/idle-timeout.md +0 -110
  314. package/skills/cometchat-android-v6-calls/references/in-call-chat.md +0 -141
  315. package/skills/cometchat-android-v6-calls/references/raise-hand.md +0 -188
  316. package/skills/cometchat-android-v6-calls/references/ringing-integration.md +0 -176
  317. package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +0 -127
  318. package/skills/cometchat-android-v6-calls/references/share-invite.md +0 -105
  319. package/skills/cometchat-android-v6-compose-theming/SKILL.md +0 -250
  320. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +0 -233
  321. package/skills/cometchat-angular-calls/SKILL.md +0 -378
  322. package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +0 -96
  323. package/skills/cometchat-angular-calls/references/call-layouts.md +0 -123
  324. package/skills/cometchat-angular-calls/references/call-session.md +0 -167
  325. package/skills/cometchat-angular-calls/references/custom-ui.md +0 -239
  326. package/skills/cometchat-angular-calls/references/device-management.md +0 -154
  327. package/skills/cometchat-angular-calls/references/group-calls.md +0 -433
  328. package/skills/cometchat-angular-calls/references/idle-timeout.md +0 -161
  329. package/skills/cometchat-angular-calls/references/in-call-chat.md +0 -148
  330. package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +0 -205
  331. package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +0 -53
  332. package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +0 -184
  333. package/skills/cometchat-angular-calls/references/picture-in-picture.md +0 -285
  334. package/skills/cometchat-angular-calls/references/raise-hand.md +0 -172
  335. package/skills/cometchat-angular-calls/references/recording-screen-share.md +0 -260
  336. package/skills/cometchat-angular-calls/references/ringing-integration.md +0 -133
  337. package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +0 -100
  338. package/skills/cometchat-angular-calls/references/share-invite.md +0 -122
  339. package/skills/cometchat-angular-calls/references/virtual-background.md +0 -29
  340. package/skills/cometchat-angular-components/SKILL.md +0 -235
  341. package/skills/cometchat-angular-core/SKILL.md +0 -386
  342. package/skills/cometchat-angular-customization/SKILL.md +0 -616
  343. package/skills/cometchat-angular-features/SKILL.md +0 -329
  344. package/skills/cometchat-angular-patterns/SKILL.md +0 -256
  345. package/skills/cometchat-angular-placement/SKILL.md +0 -314
  346. package/skills/cometchat-angular-production/SKILL.md +0 -564
  347. package/skills/cometchat-angular-push/SKILL.md +0 -389
  348. package/skills/cometchat-angular-testing/SKILL.md +0 -605
  349. package/skills/cometchat-angular-theming/SKILL.md +0 -290
  350. package/skills/cometchat-angular-troubleshooting/SKILL.md +0 -364
  351. package/skills/cometchat-astro-patterns/SKILL.md +0 -708
  352. package/skills/cometchat-calls/SKILL.md +0 -364
  353. package/skills/cometchat-calls/references/use-case-broadcast.md +0 -199
  354. package/skills/cometchat-calls/references/use-case-marketplace.md +0 -157
  355. package/skills/cometchat-calls/references/use-case-support.md +0 -189
  356. package/skills/cometchat-calls/references/use-case-team.md +0 -180
  357. package/skills/cometchat-calls/references/use-case-telehealth.md +0 -153
  358. package/skills/cometchat-components/SKILL.md +0 -1142
  359. package/skills/cometchat-core/SKILL.md +0 -1048
  360. package/skills/cometchat-customization/SKILL.md +0 -580
  361. package/skills/cometchat-customization/references/component-catalog.md +0 -236
  362. package/skills/cometchat-features/SKILL.md +0 -861
  363. package/skills/cometchat-flutter-v5/SKILL.md +0 -173
  364. package/skills/cometchat-flutter-v5-calls/SKILL.md +0 -453
  365. package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +0 -193
  366. package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +0 -103
  367. package/skills/cometchat-flutter-v5-calls/references/call-session.md +0 -285
  368. package/skills/cometchat-flutter-v5-calls/references/device-management.md +0 -124
  369. package/skills/cometchat-flutter-v5-calls/references/group-calls.md +0 -181
  370. package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +0 -99
  371. package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +0 -135
  372. package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +0 -210
  373. package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +0 -255
  374. package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +0 -196
  375. package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +0 -101
  376. package/skills/cometchat-flutter-v5-calls/references/share-invite.md +0 -148
  377. package/skills/cometchat-flutter-v5-conversations/SKILL.md +0 -118
  378. package/skills/cometchat-flutter-v5-core/SKILL.md +0 -239
  379. package/skills/cometchat-flutter-v5-customization/SKILL.md +0 -358
  380. package/skills/cometchat-flutter-v5-events/SKILL.md +0 -156
  381. package/skills/cometchat-flutter-v5-messages/SKILL.md +0 -259
  382. package/skills/cometchat-flutter-v5-production/SKILL.md +0 -216
  383. package/skills/cometchat-flutter-v5-push/SKILL.md +0 -285
  384. package/skills/cometchat-flutter-v5-testing/SKILL.md +0 -401
  385. package/skills/cometchat-flutter-v5-theming/SKILL.md +0 -161
  386. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +0 -130
  387. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +0 -152
  388. package/skills/cometchat-flutter-v6/SKILL.md +0 -446
  389. package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +0 -136
  390. package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +0 -89
  391. package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +0 -105
  392. package/skills/cometchat-flutter-v6-calls/references/call-session.md +0 -229
  393. package/skills/cometchat-flutter-v6-calls/references/device-management.md +0 -105
  394. package/skills/cometchat-flutter-v6-calls/references/group-calls.md +0 -190
  395. package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +0 -88
  396. package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +0 -125
  397. package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +0 -275
  398. package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +0 -171
  399. package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +0 -93
  400. package/skills/cometchat-flutter-v6-calls/references/share-invite.md +0 -102
  401. package/skills/cometchat-flutter-v6-conversations/SKILL.md +0 -238
  402. package/skills/cometchat-flutter-v6-messages/SKILL.md +0 -384
  403. package/skills/cometchat-flutter-v6-theming/SKILL.md +0 -293
  404. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +0 -224
  405. package/skills/cometchat-i18n/SKILL.md +0 -419
  406. package/skills/cometchat-ios/SKILL.md +0 -325
  407. package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +0 -174
  408. package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +0 -45
  409. package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +0 -188
  410. package/skills/cometchat-ios-calls/references/call-layouts.md +0 -76
  411. package/skills/cometchat-ios-calls/references/call-session.md +0 -218
  412. package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +0 -357
  413. package/skills/cometchat-ios-calls/references/custom-ui.md +0 -322
  414. package/skills/cometchat-ios-calls/references/device-management.md +0 -171
  415. package/skills/cometchat-ios-calls/references/group-calls.md +0 -359
  416. package/skills/cometchat-ios-calls/references/idle-timeout.md +0 -184
  417. package/skills/cometchat-ios-calls/references/in-call-chat.md +0 -179
  418. package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +0 -196
  419. package/skills/cometchat-ios-calls/references/picture-in-picture.md +0 -246
  420. package/skills/cometchat-ios-calls/references/raise-hand.md +0 -26
  421. package/skills/cometchat-ios-calls/references/recording-screen-share.md +0 -252
  422. package/skills/cometchat-ios-calls/references/ringing-integration.md +0 -143
  423. package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +0 -267
  424. package/skills/cometchat-ios-calls/references/share-invite.md +0 -148
  425. package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +0 -246
  426. package/skills/cometchat-ios-calls/references/voip-cert-setup.md +0 -166
  427. package/skills/cometchat-ios-production/SKILL.md +0 -738
  428. package/skills/cometchat-ios-testing/SKILL.md +0 -376
  429. package/skills/cometchat-ios-theming/SKILL.md +0 -667
  430. package/skills/cometchat-ios-troubleshooting/SKILL.md +0 -1003
  431. package/skills/cometchat-native-bare-patterns/SKILL.md +0 -550
  432. package/skills/cometchat-native-calls/SKILL.md +0 -669
  433. package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +0 -203
  434. package/skills/cometchat-native-calls/references/call-layouts.md +0 -125
  435. package/skills/cometchat-native-calls/references/call-session.md +0 -182
  436. package/skills/cometchat-native-calls/references/custom-ui.md +0 -254
  437. package/skills/cometchat-native-calls/references/device-management.md +0 -158
  438. package/skills/cometchat-native-calls/references/expo-vs-bare.md +0 -179
  439. package/skills/cometchat-native-calls/references/group-calls.md +0 -296
  440. package/skills/cometchat-native-calls/references/idle-timeout.md +0 -128
  441. package/skills/cometchat-native-calls/references/in-call-chat.md +0 -145
  442. package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +0 -72
  443. package/skills/cometchat-native-calls/references/picture-in-picture.md +0 -276
  444. package/skills/cometchat-native-calls/references/raise-hand.md +0 -205
  445. package/skills/cometchat-native-calls/references/recording-screen-share.md +0 -169
  446. package/skills/cometchat-native-calls/references/ringing-integration.md +0 -118
  447. package/skills/cometchat-native-calls/references/server-push-bridge.md +0 -135
  448. package/skills/cometchat-native-calls/references/server-push-payloads.md +0 -193
  449. package/skills/cometchat-native-calls/references/share-invite.md +0 -146
  450. package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +0 -319
  451. package/skills/cometchat-native-components/SKILL.md +0 -628
  452. package/skills/cometchat-native-core/SKILL.md +0 -679
  453. package/skills/cometchat-native-customization/SKILL.md +0 -716
  454. package/skills/cometchat-native-expo-patterns/SKILL.md +0 -552
  455. package/skills/cometchat-native-features/SKILL.md +0 -638
  456. package/skills/cometchat-native-placement/SKILL.md +0 -509
  457. package/skills/cometchat-native-production/SKILL.md +0 -700
  458. package/skills/cometchat-native-push/SKILL.md +0 -594
  459. package/skills/cometchat-native-testing/SKILL.md +0 -582
  460. package/skills/cometchat-native-theming/SKILL.md +0 -681
  461. package/skills/cometchat-native-troubleshooting/SKILL.md +0 -501
  462. package/skills/cometchat-nextjs-patterns/SKILL.md +0 -899
  463. package/skills/cometchat-placement/SKILL.md +0 -1360
  464. package/skills/cometchat-production/SKILL.md +0 -1027
  465. package/skills/cometchat-react-calls/SKILL.md +0 -749
  466. package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +0 -146
  467. package/skills/cometchat-react-calls/references/call-layouts.md +0 -160
  468. package/skills/cometchat-react-calls/references/call-session.md +0 -235
  469. package/skills/cometchat-react-calls/references/custom-ui.md +0 -247
  470. package/skills/cometchat-react-calls/references/device-management.md +0 -210
  471. package/skills/cometchat-react-calls/references/group-calls.md +0 -257
  472. package/skills/cometchat-react-calls/references/idle-timeout.md +0 -188
  473. package/skills/cometchat-react-calls/references/in-call-chat.md +0 -212
  474. package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +0 -170
  475. package/skills/cometchat-react-calls/references/picture-in-picture.md +0 -245
  476. package/skills/cometchat-react-calls/references/raise-hand.md +0 -238
  477. package/skills/cometchat-react-calls/references/recording-screen-share.md +0 -144
  478. package/skills/cometchat-react-calls/references/ringing-integration.md +0 -255
  479. package/skills/cometchat-react-calls/references/server-web-push-vapid.md +0 -241
  480. package/skills/cometchat-react-calls/references/share-invite.md +0 -175
  481. package/skills/cometchat-react-calls/references/testing-calls-on-web.md +0 -216
  482. package/skills/cometchat-react-calls/references/virtual-background.md +0 -32
  483. package/skills/cometchat-react-calls/references/voip-and-web-push.md +0 -165
  484. package/skills/cometchat-react-patterns/SKILL.md +0 -628
  485. package/skills/cometchat-react-push/SKILL.md +0 -634
  486. package/skills/cometchat-react-router-patterns/SKILL.md +0 -758
  487. package/skills/cometchat-react-testing/SKILL.md +0 -413
  488. package/skills/cometchat-theming/SKILL.md +0 -498
  489. package/skills/cometchat-troubleshooting/SKILL.md +0 -294
@@ -1,1360 +0,0 @@
1
- ---
2
- name: cometchat-placement
3
- description: "Production integration patterns -- how to add CometChat as a route, modal, drawer, embedded panel, or widget in an existing project. Teaches Claude WHERE to put chat."
4
- license: "MIT"
5
- compatibility: "@cometchat/chat-uikit-react ^6; @cometchat/chat-sdk-javascript ^4"
6
- metadata:
7
- author: "CometChat"
8
- version: "3.0.0"
9
- tags: "chat cometchat react placement route modal drawer widget embedded integration"
10
- ---
11
-
12
- > **Ground truth:** `@cometchat/chat-uikit-react@^6` components composed for placement + `docs/ui-kit/react`. **Official docs:** https://www.cometchat.com/docs/ui-kit/react/overview · **Docs MCP:** `claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp` (or fetch the URL directly without MCP). Verify symbols against the installed package/source before relying on them.
13
-
14
- ## Purpose
15
-
16
- This skill teaches you WHERE to put CometChat in an existing project. It covers five placement patterns: route, modal, drawer, embedded panel, and floating widget. Each pattern includes step-by-step instructions and complete code examples.
17
-
18
- **This skill is framework-AGNOSTIC.** It uses generic instructions like "create a page at the framework's route location" and "add a route entry to the project's router." The framework-specific details (file paths, SSR handling, env var prefixes) come from the framework skill and the `cometchat-core` skill.
19
-
20
- **Before using this skill:**
21
- - Read `cometchat-core` for initialization, login, CSS, and provider patterns
22
- - Read `cometchat-components` for component names, props, and composition patterns
23
-
24
- ---
25
-
26
- ## "What are you building?" -- placement recommendation
27
-
28
- Use this table to recommend a placement based on what the user is building. If the user says "add chat to my app" without specifying where, ask them what they are building and use this table.
29
-
30
- | User intent | Recommended placement | Experience composition |
31
- |---|---|---|
32
- | Messaging app | Route (full page) | Multi-conversation (CometChatConversations + MessageHeader + MessageList + MessageComposer) |
33
- | Marketplace / platform | Drawer on product page + `/messages` route | Single thread (drawer) + Multi-conversation (route) |
34
- | SaaS / dashboard | Modal from navbar + `/messages` route | Single thread (modal) + Multi-conversation (route) |
35
- | Social / community | Route (tabs) | Full messenger (CometChatConversations + CallLogs + Users + Groups with tabs) |
36
- | Support / helpdesk | Floating widget | Widget (use CLI) |
37
- | Just exploring | Demo (replace home page) | Multi-conversation |
38
-
39
- ---
40
-
41
- ## Visual reference — experience layouts
42
-
43
- When presenting experience options to the user, describe these layouts
44
- or share the ASCII art so they can visualize what each looks like.
45
-
46
- ### Multi-conversation (Experience 1)
47
-
48
- Two-pane layout: conversation list on the left, active chat thread on the right.
49
-
50
- ```
51
- ┌─────────────────────────┬───────────────────────────────────────┐
52
- │ Chats Q │ Richard Ray v c i │
53
- ├─────────────────────────┼───────────────────────────────────────┤
54
- │ │ │
55
- │ (RR) Richard Ray 3:45 │ ╭─────────────────────╮ │
56
- │ Is it still up.. │ │ Hi, is the watch │ │
57
- │ │ │ still up for sale? │ │
58
- │ (SB) Sarah Beth 3:40 │ ╰────────── 4:56 PM ─╯ │
59
- │ Sure! Sending .. │ │
60
- │ │ ╭─────────────────╮ │
61
- │ (RA) Robert Allen 3:38 │ │ Yes, it is │ │
62
- │ Thanks! Looks .. │ │ available. │ │
63
- │ │ ╰─ 4:56 PM ──────╯ │
64
- │ (SG) Sam Game 3:30 │ │
65
- │ Sending them .. │ ╭─────────────────────╮ │
66
- │ │ │ Can I see a couple │ │
67
- │ (SF) Scott F. 3:22 │ │ of pictures? │ │
68
- │ I will look .. │ ╰────────── 4:56 PM ─╯ │
69
- │ │ │
70
- │ (EP) Evan Parker 3:15 │ ╭─────────────────╮ │
71
- │ Hey, did you .. │ │ Sure! Sending │ │
72
- │ │ │ them over now. │ │
73
- │ (JP) John Paul 3:10 │ ╰─ 4:56 PM ──────╯ │
74
- │ Sounds good │ │
75
- │ │ ╭─────────────────────╮ │
76
- │ (LK) Linda Kay 3:05 │ │ Thanks! Looks good. │ │
77
- │ See you there │ ╰────────── 4:56 PM ─╯ │
78
- │ ├───────────────────────────────────────┤
79
- │ │ Type a message... > │
80
- └─────────────────────────┴───────────────────────────────────────┘
81
- ```
82
-
83
- Best for: messaging apps, team chat, inboxes, dedicated chat sections.
84
-
85
- ### Single thread (Experience 2)
86
-
87
- One chat window — no conversation list. Shows a direct chat with one user or group.
88
-
89
- ```
90
- ┌─────────────────────────────────────────────────────────────────┐
91
- │ │
92
- │ (RR) Richard Ray v c i │
93
- │ . Online │
94
- │ │
95
- ├─────────────────────────────────────────────────────────────────┤
96
- │ │
97
- │ ╭───────────────────────────────╮ │
98
- │ │ Hi, is the watch still up │ │
99
- │ │ for sale? 4:56 PM vv │ │
100
- │ ╰───────────────────────────────╯ │
101
- │ │
102
- │ ╭───────────────────────╮ │
103
- │ │ Yes, it is available. │ │
104
- │ ╰── 4:56 PM ───────────╯ │
105
- │ │
106
- │ ╭───────────────────────────────╮ │
107
- │ │ Awesome! Can I see a couple │ │
108
- │ │ of pictures? 4:56 PM vv │ │
109
- │ ╰───────────────────────────────╯ │
110
- │ │
111
- │ ╭────────────────────────────────╮ │
112
- │ │ Sure! Sending them over now. │ │
113
- │ ╰── 4:56 PM ────────────────────╯ │
114
- │ │
115
- │ ╭───────────────────────────────╮ │
116
- │ │ Thanks! Looks good. 4:56 PM vv│ │
117
- │ ╰───────────────────────────────╯ │
118
- │ │
119
- │ ╭─────────────╮ │
120
- │ │ Thank you! │ │
121
- │ ╰── 4:56 PM ─╯ │
122
- │ │
123
- ├─────────────────────────────────────────────────────────────────┤
124
- │ + m e a Type a message... > │
125
- └─────────────────────────────────────────────────────────────────┘
126
- ```
127
-
128
- Best for: marketplace chat, embedded consult, support, one-on-one conversations.
129
-
130
- ### Full messenger (Experience 3)
131
-
132
- Two-pane layout like Experience 1, plus a bottom tab bar for switching
133
- between Chats, Calls, Users, and Groups.
134
-
135
- ```
136
- ┌─────────────────────────┬───────────────────────────────────────┐
137
- │ Chats Q │ Richard Ray v c i │
138
- ├─────────────────────────┼───────────────────────────────────────┤
139
- │ │ │
140
- │ (RR) Richard Ray 3:45 │ ╭─────────────────────╮ │
141
- │ How much extra.. │ │ How much extra are │ │
142
- │ │ │ we talking for the │ │
143
- │ (SB) Sarah Beth 3:40 │ │ direct flight? │ │
144
- │ That sounds w.. │ ╰────────── 4:56 PM ─╯ │
145
- │ │ │
146
- │ (RA) Robert Allen 3:38 │ ╭──────────────────────╮ │
147
- │ 4:56 PM │ │ It is $50 more. Save │ │
148
- │ │ │ a couple of hours. │ │
149
- │ (SG) Sam Game 3:30 │ ╰─ 4:56 PM ───────────╯ │
150
- │ Sending them .. │ │
151
- │ │ ╭─────────────────────╮ │
152
- │ (SF) Scott F. 3:22 │ │ That sounds worth │ │
153
- │ I will look .. │ │ it. Let us do it. │ │
154
- │ │ ╰────────── 4:56 PM ─╯ │
155
- │ (EP) Evan Parker 3:15 │ │
156
- │ Hey, did you .. │ ╭──────────────────────╮ │
157
- │ │ │ Great, I will send │ │
158
- │ │ │ you the details. │ │
159
- │ │ ╰─ 4:56 PM ───────────╯ │
160
- │ ├───────────────────────────────────────┤
161
- │ │ Type a message... > │
162
- ├─────────────────────────┼───────────────────────────────────────┤
163
- │ Ch Ca Us Gr │ │
164
- └─────────────────────────┴───────────────────────────────────────┘
165
- ```
166
-
167
- Best for: social apps, community platforms, dating apps, full-featured
168
- chat products.
169
-
170
- ---
171
-
172
- > **Composer choice for narrow/two-pane panes:** the canonical React v6 sample apps use **`CometChatCompactMessageComposer`** (not `CometChatMessageComposer`) in the two-pane messages view — it's the kit's space-optimized composer for a sidebar-width pane (`cometchat-uikit-react-v6/sample-app/src/components/CometChatMessages/CometChatMessages.tsx:85`). Both compile and work; prefer `CometChatCompactMessageComposer` for the split/two-pane layouts below and `CometChatMessageComposer` for full-width single-thread layouts.
173
-
174
- ## Height & scroll — the message-view column MUST be bounded
175
-
176
- Every header+list+composer example below puts the three components as **direct
177
- flex children** of a `display:flex; flexDirection:column` column. That works ONLY
178
- if the column has a bounded height — i.e. the full chain (`html`/`body`/`#root` →
179
- …→ this column) uses a definite **`height`** (e.g. `#root { height: 100vh }`),
180
- never `min-height`, and every flex ancestor of `CometChatMessageList` has
181
- `minHeight: 0`. Delete the Vite/CRA starter `#root { min-height: 100vh; max-width: … }`.
182
-
183
- If the list still won't scroll (most common symptom), or you wrap the list in its
184
- own `<div>` for custom chrome/tabs, you hit the kit's auto-injected `.cometchat`
185
- element — see **`cometchat-react-patterns` → "Container height (and the flex-shrink
186
- trap)" Bug 3**: give the list its own wrapper class with BOTH `.your-list-wrapper
187
- { flex: 1 1 0; min-height: 0; height: 100%; overflow: hidden }` (the **explicit
188
- `height: 100%` is required** — a flex-grow-only height is indefinite, so the kit's
189
- injected child collapses to content height and clips) AND a child rule
190
- `.your-list-wrapper > .cometchat { height: 100%; overflow: hidden }` (inline styles
191
- can't target the injected child). Those two rules are the single most common fix for
192
- "I set heights everywhere and it still won't scroll."
193
-
194
- ---
195
-
196
- ## Thread replies — hidden by default in every example below
197
-
198
- Every `<CometChatMessageList ...>` in the placement patterns below
199
- includes `hideReplyInThreadOption`. The kit's default (`false`) puts a
200
- **"Reply in Thread"** entry in every message's action menu — but that
201
- entry only works if the integrator has wired up a thread panel
202
- (`CometChatThreadHeader` + a scoped `CometChatMessageList` +
203
- `CometChatMessageComposer` with `parentMessageId`). If the thread
204
- panel isn't wired (the case for a simple drawer, widget, modal, or
205
- single-thread experience), the option is still visible and clicking it
206
- silently does nothing — confusing UX.
207
-
208
- Default: **threads hidden**. To enable threads for an experience that
209
- actually has the side-panel plumbing:
210
-
211
- 1. Remove `hideReplyInThreadOption` from the main `<CometChatMessageList>`
212
- 2. Add `onThreadRepliesClick` to capture the thread message
213
- 3. Render the thread panel (see `cometchat-components` § Threading for
214
- the full pattern — `CometChatThreadHeader` + scoped `MessageList` +
215
- scoped `MessageComposer` with `parentMessageId`)
216
-
217
- ---
218
-
219
- ## Route placement
220
-
221
- The most common pattern. Chat gets its own page in the app, accessible via navigation.
222
-
223
- ### Steps
224
-
225
- #### 1. Set up CometChatProvider at the app root
226
-
227
- The provider (from `cometchat-core`) should wrap the entire app or the chat route's layout. This ensures init and login happen once, not per-navigation.
228
-
229
- - **Read the project's existing layout/root component first.** Look for the outermost wrapper (e.g., `App.tsx`, `layout.tsx`, `root.tsx`).
230
- - Add the `CometChatProvider` inside the existing layout, wrapping the router outlet or children.
231
- - Import `@cometchat/chat-uikit-react/css-variables.css` at the app root CSS file if not already imported.
232
-
233
- #### 2. Create a chat page component
234
-
235
- Create a new file (e.g., `ChatPage.tsx` or `MessagesPage.tsx`) at the framework's conventional page location:
236
-
237
- - React (Vite): `src/pages/ChatPage.tsx` or `src/ChatPage.tsx`
238
- - Next.js (App Router): `app/chat/page.tsx`
239
- - Next.js (Pages Router): `pages/chat.tsx`
240
- - Astro: `src/pages/chat.astro` (with a React island)
241
- - React Router: `app/routes/chat.tsx`
242
-
243
- #### 3. Implement the page
244
-
245
- Choose the experience composition from `cometchat-components`:
246
-
247
- **Two-pane (most common for routes):**
248
-
249
- ```tsx
250
- // ChatPage.tsx
251
- import { useState } from "react";
252
- import {
253
- CometChatConversations,
254
- CometChatMessageHeader,
255
- CometChatMessageList,
256
- CometChatMessageComposer,
257
- } from "@cometchat/chat-uikit-react";
258
- import { CometChat } from "@cometchat/chat-sdk-javascript";
259
-
260
- export default function ChatPage() {
261
- const [selectedUser, setSelectedUser] = useState<CometChat.User>();
262
- const [selectedGroup, setSelectedGroup] = useState<CometChat.Group>();
263
-
264
- function handleConversationClick(conversation: CometChat.Conversation) {
265
- const entity = conversation.getConversationWith();
266
- if (entity instanceof CometChat.User) {
267
- setSelectedUser(entity);
268
- setSelectedGroup(undefined);
269
- } else if (entity instanceof CometChat.Group) {
270
- setSelectedUser(undefined);
271
- setSelectedGroup(entity);
272
- }
273
- }
274
-
275
- return (
276
- <div style={{ display: "flex", height: "100vh" }}>
277
- <div style={{ width: "360px", borderRight: "1px solid #eee" }}>
278
- <CometChatConversations onItemClick={handleConversationClick} />
279
- </div>
280
- <div style={{ flex: 1, display: "flex", flexDirection: "column" }}>
281
- {(selectedUser || selectedGroup) ? (
282
- <>
283
- {selectedUser && <CometChatMessageHeader user={selectedUser} />}
284
- {selectedGroup && <CometChatMessageHeader group={selectedGroup} />}
285
- {selectedUser && <CometChatMessageList user={selectedUser} hideReplyInThreadOption />}
286
- {selectedGroup && <CometChatMessageList group={selectedGroup} hideReplyInThreadOption />}
287
- {selectedUser && <CometChatMessageComposer user={selectedUser} />}
288
- {selectedGroup && <CometChatMessageComposer group={selectedGroup} />}
289
- </>
290
- ) : (
291
- <div style={{
292
- flex: 1,
293
- display: "flex",
294
- alignItems: "center",
295
- justifyContent: "center",
296
- color: "#999",
297
- }}>
298
- Select a conversation to start chatting
299
- </div>
300
- )}
301
- </div>
302
- </div>
303
- );
304
- }
305
- ```
306
-
307
- **Full messenger (tabs -- for standalone messaging sections):**
308
-
309
- ```tsx
310
- // MessagesPage.tsx
311
- import { useState } from "react";
312
- import {
313
- CometChatConversations,
314
- CometChatCallLogs,
315
- CometChatUsers,
316
- CometChatGroups,
317
- CometChatMessageHeader,
318
- CometChatMessageList,
319
- CometChatMessageComposer,
320
- } from "@cometchat/chat-uikit-react";
321
- import { CometChat } from "@cometchat/chat-sdk-javascript";
322
-
323
- type Tab = "chats" | "calls" | "users" | "groups";
324
-
325
- export default function MessagesPage() {
326
- const [activeTab, setActiveTab] = useState<Tab>("chats");
327
- const [selectedUser, setSelectedUser] = useState<CometChat.User>();
328
- const [selectedGroup, setSelectedGroup] = useState<CometChat.Group>();
329
-
330
- function selectUser(user: CometChat.User) {
331
- setSelectedUser(user);
332
- setSelectedGroup(undefined);
333
- }
334
- function selectGroup(group: CometChat.Group) {
335
- setSelectedUser(undefined);
336
- setSelectedGroup(group);
337
- }
338
-
339
- return (
340
- <div style={{ display: "flex", height: "100vh" }}>
341
- <div style={{ width: "360px", display: "flex", flexDirection: "column", borderRight: "1px solid #eee" }}>
342
- <nav style={{ display: "flex", borderBottom: "1px solid #eee" }}>
343
- {(["chats", "calls", "users", "groups"] as Tab[]).map((tab) => (
344
- <button
345
- key={tab}
346
- onClick={() => setActiveTab(tab)}
347
- style={{
348
- flex: 1,
349
- padding: "12px 0",
350
- border: "none",
351
- background: "none",
352
- cursor: "pointer",
353
- fontWeight: activeTab === tab ? 700 : 400,
354
- borderBottom: activeTab === tab ? "2px solid var(--cometchat-primary-color, #3399ff)" : "2px solid transparent",
355
- }}
356
- >
357
- {tab.charAt(0).toUpperCase() + tab.slice(1)}
358
- </button>
359
- ))}
360
- </nav>
361
- <div style={{ flex: 1, overflow: "hidden" }}>
362
- {activeTab === "chats" && (
363
- <CometChatConversations
364
- onItemClick={(conv) => {
365
- const entity = conv.getConversationWith();
366
- if (entity instanceof CometChat.User) selectUser(entity);
367
- else if (entity instanceof CometChat.Group) selectGroup(entity);
368
- }}
369
- />
370
- )}
371
- {activeTab === "calls" && <CometChatCallLogs />}
372
- {activeTab === "users" && <CometChatUsers onItemClick={selectUser} />}
373
- {activeTab === "groups" && <CometChatGroups onItemClick={selectGroup} />}
374
- </div>
375
- </div>
376
- <div style={{ flex: 1, display: "flex", flexDirection: "column" }}>
377
- {selectedUser && (
378
- <>
379
- <CometChatMessageHeader user={selectedUser} />
380
- <CometChatMessageList user={selectedUser} hideReplyInThreadOption />
381
- <CometChatMessageComposer user={selectedUser} />
382
- </>
383
- )}
384
- {selectedGroup && (
385
- <>
386
- <CometChatMessageHeader group={selectedGroup} />
387
- <CometChatMessageList group={selectedGroup} hideReplyInThreadOption />
388
- <CometChatMessageComposer group={selectedGroup} />
389
- </>
390
- )}
391
- {!selectedUser && !selectedGroup && (
392
- <div style={{
393
- flex: 1,
394
- display: "flex",
395
- alignItems: "center",
396
- justifyContent: "center",
397
- color: "#999",
398
- }}>
399
- Select a conversation to start chatting
400
- </div>
401
- )}
402
- </div>
403
- </div>
404
- );
405
- }
406
- ```
407
-
408
- #### 4. Wire the route into the project's router
409
-
410
- **Read the project's existing routing setup first.** Do not assume a pattern. Look for:
411
-
412
- - **React Router:** `createBrowserRouter()`, `<Routes>`, `<Route>` in `App.tsx` or a routes file
413
- - **Next.js App Router:** `app/` directory -- just creating the page file at `app/chat/page.tsx` IS the route
414
- - **Next.js Pages Router:** `pages/` directory -- creating `pages/chat.tsx` IS the route
415
- - **Astro:** `src/pages/` directory -- creating `src/pages/chat.astro` IS the route
416
- - **React Router v7:** File-based routing in `app/routes/` or manual routes in `app/routes.ts`
417
-
418
- For manual routers (React Router), add a route entry:
419
-
420
- ```tsx
421
- // Example: adding to an existing createBrowserRouter
422
- {
423
- path: "/chat",
424
- element: <ChatPage />,
425
- }
426
- ```
427
-
428
- For file-based routers (Next.js, Astro, React Router v7), creating the file at the right path is sufficient.
429
-
430
- #### 5. Add a navigation link
431
-
432
- **Read the project's existing navbar/sidebar first.** Find the component that renders navigation links (could be `Navbar.tsx`, `Sidebar.tsx`, `Header.tsx`, `Nav.tsx`, or inline in a layout).
433
-
434
- Add a "Messages" or "Chat" link alongside the existing links:
435
-
436
- ```tsx
437
- // Example: adding to an existing nav component
438
- <Link to="/chat">Messages</Link>
439
- // or
440
- <a href="/chat">Messages</a>
441
- ```
442
-
443
- Match the existing link style. If the nav uses icons, add a chat/message icon. If it uses a specific `NavLink` or `Link` component, use the same one.
444
-
445
- #### 6. Import CSS
446
-
447
- Check if `@cometchat/chat-uikit-react/css-variables.css` is already imported at the app root. If not, add it to the root CSS file or root layout:
448
-
449
- ```css
450
- /* In globals.css or index.css at the app root */
451
- @import "@cometchat/chat-uikit-react/css-variables.css";
452
- ```
453
-
454
- ---
455
-
456
- ## Modal placement
457
-
458
- A centered overlay for quick one-off messages. Use when chat is a secondary action (e.g., "message this user" from a profile page).
459
-
460
- ### When to use modal vs. drawer
461
-
462
- - **Modal:** Quick, one-off messages. User sends a message and closes. No ongoing conversation visible.
463
- - **Drawer:** Ongoing conversation. User keeps the drawer open while browsing the main app. Better for marketplace/support contexts.
464
-
465
- ### Steps
466
-
467
- #### 1. Create a ChatModal component
468
-
469
- ```tsx
470
- // ChatModal.tsx
471
- import { useEffect, useState } from "react";
472
- import {
473
- CometChatMessageHeader,
474
- CometChatMessageList,
475
- CometChatMessageComposer,
476
- } from "@cometchat/chat-uikit-react";
477
- import { CometChat } from "@cometchat/chat-sdk-javascript";
478
-
479
- interface ChatModalProps {
480
- isOpen: boolean;
481
- onClose: () => void;
482
- targetUserId?: string;
483
- targetGroupId?: string;
484
- }
485
-
486
- export function ChatModal({ isOpen, onClose, targetUserId, targetGroupId }: ChatModalProps) {
487
- const [user, setUser] = useState<CometChat.User>();
488
- const [group, setGroup] = useState<CometChat.Group>();
489
- const [loading, setLoading] = useState(true);
490
-
491
- useEffect(() => {
492
- if (!isOpen) return;
493
- setLoading(true);
494
-
495
- if (targetUserId) {
496
- CometChat.getUser(targetUserId)
497
- .then((u) => {
498
- setUser(u);
499
- setGroup(undefined);
500
- setLoading(false);
501
- })
502
- .catch(() => setLoading(false));
503
- } else if (targetGroupId) {
504
- CometChat.getGroup(targetGroupId)
505
- .then((g) => {
506
- setUser(undefined);
507
- setGroup(g);
508
- setLoading(false);
509
- })
510
- .catch(() => setLoading(false));
511
- }
512
- }, [isOpen, targetUserId, targetGroupId]);
513
-
514
- if (!isOpen) return null;
515
-
516
- return (
517
- <div
518
- style={{
519
- position: "fixed",
520
- inset: 0,
521
- zIndex: 1000,
522
- display: "flex",
523
- alignItems: "center",
524
- justifyContent: "center",
525
- }}
526
- >
527
- {/* Backdrop */}
528
- <div
529
- onClick={onClose}
530
- style={{
531
- position: "absolute",
532
- inset: 0,
533
- backgroundColor: "rgba(0, 0, 0, 0.5)",
534
- }}
535
- />
536
-
537
- {/* Modal content */}
538
- <div
539
- style={{
540
- position: "relative",
541
- width: "min(600px, 90vw)",
542
- height: "min(700px, 80vh)",
543
- backgroundColor: "var(--cometchat-background-color-01, #fff)",
544
- borderRadius: "var(--cometchat-border-radius-lg, 12px)",
545
- overflow: "hidden",
546
- display: "flex",
547
- flexDirection: "column",
548
- boxShadow: "0 20px 60px rgba(0, 0, 0, 0.3)",
549
- }}
550
- >
551
- {/* Close button */}
552
- <button
553
- onClick={onClose}
554
- style={{
555
- position: "absolute",
556
- top: 8,
557
- right: 8,
558
- zIndex: 10,
559
- background: "none",
560
- border: "none",
561
- fontSize: 20,
562
- cursor: "pointer",
563
- padding: "4px 8px",
564
- }}
565
- aria-label="Close chat"
566
- >
567
- X
568
- </button>
569
-
570
- {loading ? (
571
- <div style={{ flex: 1, display: "flex", alignItems: "center", justifyContent: "center" }}>
572
- Loading...
573
- </div>
574
- ) : (
575
- <>
576
- {user && <CometChatMessageHeader user={user} />}
577
- {group && <CometChatMessageHeader group={group} />}
578
- <div style={{ flex: 1, overflow: "hidden" }}>
579
- {user && <CometChatMessageList user={user} hideReplyInThreadOption />}
580
- {group && <CometChatMessageList group={group} hideReplyInThreadOption />}
581
- </div>
582
- {user && <CometChatMessageComposer user={user} />}
583
- {group && <CometChatMessageComposer group={group} />}
584
- </>
585
- )}
586
- </div>
587
- </div>
588
- );
589
- }
590
- ```
591
-
592
- #### 2. Wire the trigger
593
-
594
- **Read the project's components to find the right trigger point.** This could be:
595
-
596
- - A "Message" button on a user profile page
597
- - A "Contact Seller" button on a product card
598
- - A chat icon in a navbar
599
- - A "Send Message" link in a user list
600
-
601
- ```tsx
602
- // Example: adding a chat button to an existing product card
603
- import { useState } from "react";
604
- import { ChatModal } from "./ChatModal";
605
-
606
- function ProductCard({ product }) {
607
- const [showChat, setShowChat] = useState(false);
608
-
609
- return (
610
- <div>
611
- {/* existing product card content */}
612
- <button onClick={() => setShowChat(true)}>
613
- Message Seller
614
- </button>
615
- <ChatModal
616
- isOpen={showChat}
617
- onClose={() => setShowChat(false)}
618
- targetUserId={product.sellerId}
619
- />
620
- </div>
621
- );
622
- }
623
- ```
624
-
625
- #### 3. CometChatProvider placement
626
-
627
- The `CometChatProvider` (or equivalent init logic) MUST be at the app root, NOT inside the modal. If init is inside the modal, it re-runs every time the modal opens, causing flicker and reconnection delays.
628
-
629
- ---
630
-
631
- ## Drawer placement
632
-
633
- A side panel that slides in from the right. Better than a modal for ongoing conversations because the user can keep it open while browsing.
634
-
635
- > ⚠️ **Known kit-side traps in narrow containers (≤ ~480px). Mitigate, don't ignore (ENG-35702/03/04/06):**
636
- >
637
- > 1. **Unread-count badges clip at the right edge in 320px panes** — kit's conversation-list item doesn't reserve trailing padding for the pill. Workaround until the kit fix lands: target `.cometchat-conversation-list-item__badge { margin-right: 8px; flex-shrink: 0; }` in your overrides, OR widen the drawer to ≥ 480px on the inner content (use `width: min(420px, 100vw)` + 8px inner padding).
638
- > 2. **`Delete Conversation?` confirmation card overflows the list pane** — kit renders the dialog inside the list column instead of portalling to a top-level scrim. There's no clean CSS workaround today; if the integration depends on right-click delete, raise the drawer width above ~480px so the card fits inside.
639
- > 3. **Composer attachment popover (`+` button) anchors to the wrong ancestor** — opens at viewport bottom-right instead of above the trigger when mounted inside a drawer/modal. Workaround: ensure the drawer container has `position: relative` (NOT just `position: fixed`) on its inner card so absolute popovers anchor correctly. If the popover still misaligns, mount the composer in a full-screen-on-mobile variant (the `right: -100%` recipe from §"Recipe — breakpoint-aware drawer").
640
- > 4. **Voice recorder bubble UI is broken at kit v6.x** — the in-bubble recorder shows visual artifacts AND the pause-resume timer restarts at 00:00 instead of continuing. There is no client-side workaround; if voice messages are part of the integration's core surface, document the limitation for the customer and consider hiding the voice button (`<CometChatMessageComposer hideVoiceRecordingButton={true} />`) until the kit fix ships.
641
- > 5. **`CometChatMessageList` does NOT auto-resubscribe on conversation switch** — passing a new `user` or `group` prop keeps the old listeners. **Required workaround when switching conversations inside a single drawer/modal:** pass `key={user?.getUid() ?? group?.getGuid()}` to force a remount + listener re-subscribe. Without it, switching from Alice → Bob silently shows Alice's messages with Bob's header. (ENG-35702)
642
- > 6. **`CometChatMessageList` may render BLANK on conversations with unread messages** — kit-side data-path bug, no header or empty-state, just blank. No client-side workaround today; if the customer reports a blank list, capture the screenshot + UID/GUID + unread count and file a kit ticket. (ENG-35702 kit-side blocker)
643
- >
644
- > These are kit-side bugs filed in Linear (ENG-35702, 35703, 35704, 35706); the workarounds above are interim until the next kit release.
645
-
646
- ### Steps
647
-
648
- #### 1. Create a ChatDrawer component
649
-
650
- ```tsx
651
- // ChatDrawer.tsx
652
- import { useEffect, useState } from "react";
653
- import {
654
- CometChatMessageHeader,
655
- CometChatMessageList,
656
- CometChatMessageComposer,
657
- } from "@cometchat/chat-uikit-react";
658
- import { CometChat } from "@cometchat/chat-sdk-javascript";
659
-
660
- interface ChatDrawerProps {
661
- isOpen: boolean;
662
- onClose: () => void;
663
- targetUserId?: string;
664
- targetGroupId?: string;
665
- }
666
-
667
- export function ChatDrawer({ isOpen, onClose, targetUserId, targetGroupId }: ChatDrawerProps) {
668
- const [user, setUser] = useState<CometChat.User>();
669
- const [group, setGroup] = useState<CometChat.Group>();
670
- const [loading, setLoading] = useState(true);
671
-
672
- useEffect(() => {
673
- if (!isOpen) return;
674
- setLoading(true);
675
-
676
- if (targetUserId) {
677
- CometChat.getUser(targetUserId)
678
- .then((u) => {
679
- setUser(u);
680
- setGroup(undefined);
681
- setLoading(false);
682
- })
683
- .catch(() => setLoading(false));
684
- } else if (targetGroupId) {
685
- CometChat.getGroup(targetGroupId)
686
- .then((g) => {
687
- setUser(undefined);
688
- setGroup(g);
689
- setLoading(false);
690
- })
691
- .catch(() => setLoading(false));
692
- }
693
- }, [isOpen, targetUserId, targetGroupId]);
694
-
695
- return (
696
- <>
697
- {/* Backdrop */}
698
- {isOpen && (
699
- <div
700
- onClick={onClose}
701
- style={{
702
- position: "fixed",
703
- inset: 0,
704
- zIndex: 999,
705
- backgroundColor: "rgba(0, 0, 0, 0.3)",
706
- }}
707
- />
708
- )}
709
-
710
- {/* Drawer */}
711
- {/*
712
- IMPORTANT: do NOT animate with `transform: translateX(...)`.
713
- `transform` on an element creates a new containing block for
714
- `position: fixed` descendants (per the CSS spec), so every
715
- fixed-positioned popover that CometChat renders inside the drawer
716
- — message options menu, emoji picker, file preview, reactions
717
- popover, thread panel — becomes anchored to the transformed
718
- drawer instead of the viewport. The result is popovers that
719
- appear clipped, offset, or drift as the drawer animates. Animate
720
- the `right` offset instead; no transform, no containing-block
721
- takeover, fixed popovers stay anchored to the viewport.
722
- */}
723
- <div
724
- style={{
725
- position: "fixed",
726
- top: 0,
727
- // Breakpoint-aware: full-width on mobile (≤ 640px), 400px on desktop.
728
- // The "-100%" closed offset slides the drawer off-screen at any width,
729
- // so mobile-full-screen works without recomputing the offset (ENG-35715).
730
- right: isOpen ? 0 : "-100%",
731
- bottom: 0,
732
- width: "min(400px, 100vw)",
733
- maxWidth: "100vw",
734
- zIndex: 1000,
735
- backgroundColor: "var(--cometchat-background-color-01, #fff)",
736
- boxShadow: "-4px 0 20px rgba(0, 0, 0, 0.15)",
737
- display: "flex",
738
- flexDirection: "column",
739
- transition: "right 0.3s ease-in-out",
740
- }}
741
- >
742
- {/* Header with close button */}
743
- <div style={{
744
- display: "flex",
745
- alignItems: "center",
746
- justifyContent: "space-between",
747
- padding: "8px 12px",
748
- borderBottom: "1px solid #eee",
749
- }}>
750
- <span style={{ fontWeight: 600 }}>Chat</span>
751
- <button
752
- onClick={onClose}
753
- style={{
754
- background: "none",
755
- border: "none",
756
- fontSize: 18,
757
- cursor: "pointer",
758
- padding: "4px 8px",
759
- }}
760
- aria-label="Close chat"
761
- >
762
- X
763
- </button>
764
- </div>
765
-
766
- {/* Chat content */}
767
- {loading ? (
768
- <div style={{ flex: 1, display: "flex", alignItems: "center", justifyContent: "center" }}>
769
- Loading...
770
- </div>
771
- ) : (
772
- <>
773
- {user && <CometChatMessageHeader user={user} />}
774
- {group && <CometChatMessageHeader group={group} />}
775
- <div style={{ flex: 1, overflow: "hidden" }}>
776
- {user && <CometChatMessageList user={user} hideReplyInThreadOption />}
777
- {group && <CometChatMessageList group={group} hideReplyInThreadOption />}
778
- </div>
779
- {user && <CometChatMessageComposer user={user} />}
780
- {group && <CometChatMessageComposer group={group} />}
781
- </>
782
- )}
783
- </div>
784
- </>
785
- );
786
- }
787
- ```
788
-
789
- #### 2. Wire the trigger
790
-
791
- Same approach as the modal -- find the right trigger point in the existing project:
792
-
793
- ```tsx
794
- import { useState } from "react";
795
- import { ChatDrawer } from "./ChatDrawer";
796
-
797
- function UserProfile({ userId }) {
798
- const [showChat, setShowChat] = useState(false);
799
-
800
- return (
801
- <div>
802
- {/* existing profile content */}
803
- <button onClick={() => setShowChat(true)}>
804
- Chat with this user
805
- </button>
806
- <ChatDrawer
807
- isOpen={showChat}
808
- onClose={() => setShowChat(false)}
809
- targetUserId={userId}
810
- />
811
- </div>
812
- );
813
- }
814
- ```
815
-
816
- #### 3. Multi-conversation drawer variant
817
-
818
- For a drawer that shows the full conversation list (not just a single thread):
819
-
820
- ```tsx
821
- // ConversationDrawer.tsx -- shows conversation list + message view
822
- import { useState } from "react";
823
- import {
824
- CometChatConversations,
825
- CometChatMessageHeader,
826
- CometChatMessageList,
827
- CometChatMessageComposer,
828
- } from "@cometchat/chat-uikit-react";
829
- import { CometChat } from "@cometchat/chat-sdk-javascript";
830
-
831
- interface ConversationDrawerProps {
832
- isOpen: boolean;
833
- onClose: () => void;
834
- }
835
-
836
- export function ConversationDrawer({ isOpen, onClose }: ConversationDrawerProps) {
837
- const [selectedUser, setSelectedUser] = useState<CometChat.User>();
838
- const [selectedGroup, setSelectedGroup] = useState<CometChat.Group>();
839
-
840
- function handleConversationClick(conversation: CometChat.Conversation) {
841
- const entity = conversation.getConversationWith();
842
- if (entity instanceof CometChat.User) {
843
- setSelectedUser(entity);
844
- setSelectedGroup(undefined);
845
- } else if (entity instanceof CometChat.Group) {
846
- setSelectedUser(undefined);
847
- setSelectedGroup(entity);
848
- }
849
- }
850
-
851
- const hasSelection = selectedUser || selectedGroup;
852
-
853
- return (
854
- <>
855
- {isOpen && (
856
- <div
857
- onClick={onClose}
858
- style={{ position: "fixed", inset: 0, zIndex: 999, backgroundColor: "rgba(0,0,0,0.3)" }}
859
- />
860
- )}
861
- {/*
862
- Animate the `right` offset, never `transform: translateX(...)` —
863
- `transform` creates a new containing block, which re-anchors
864
- CometChat's fixed-positioned popovers (emoji picker, message
865
- options, file preview, thread panel) to the drawer instead of
866
- the viewport and makes them misalign.
867
- */}
868
- <div
869
- style={{
870
- position: "fixed",
871
- top: 0,
872
- right: isOpen ? 0 : "-720px", // off-screen by widest width when closed
873
- bottom: 0,
874
- width: hasSelection ? "720px" : "360px",
875
- maxWidth: "100vw",
876
- zIndex: 1000,
877
- backgroundColor: "var(--cometchat-background-color-01, #fff)",
878
- boxShadow: "-4px 0 20px rgba(0,0,0,0.15)",
879
- display: "flex",
880
- transition: "right 0.3s ease-in-out, width 0.3s ease-in-out",
881
- }}
882
- >
883
- {/* Conversation list */}
884
- <div style={{ width: "360px", borderRight: hasSelection ? "1px solid #eee" : "none", display: "flex", flexDirection: "column" }}>
885
- <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", padding: "8px 12px", borderBottom: "1px solid #eee" }}>
886
- <span style={{ fontWeight: 600 }}>Messages</span>
887
- <button onClick={onClose} style={{ background: "none", border: "none", fontSize: 18, cursor: "pointer" }} aria-label="Close">&times;</button>
888
- </div>
889
- <div style={{ flex: 1 }}>
890
- <CometChatConversations onItemClick={handleConversationClick} />
891
- </div>
892
- </div>
893
-
894
- {/* Message view */}
895
- {hasSelection && (
896
- <div style={{ flex: 1, display: "flex", flexDirection: "column" }}>
897
- {selectedUser && <CometChatMessageHeader user={selectedUser} />}
898
- {selectedGroup && <CometChatMessageHeader group={selectedGroup} />}
899
- <div style={{ flex: 1, overflow: "hidden" }}>
900
- {selectedUser && <CometChatMessageList user={selectedUser} hideReplyInThreadOption />}
901
- {selectedGroup && <CometChatMessageList group={selectedGroup} hideReplyInThreadOption />}
902
- </div>
903
- {selectedUser && <CometChatMessageComposer user={selectedUser} />}
904
- {selectedGroup && <CometChatMessageComposer group={selectedGroup} />}
905
- </div>
906
- )}
907
- </div>
908
- </>
909
- );
910
- }
911
- ```
912
-
913
- ---
914
-
915
- ## Floating widget
916
-
917
- A button-in-the-corner chat overlay. Available on every page of the app
918
- without a dedicated route. Common for support widgets, helpdesk chat,
919
- "contact us" overlays.
920
-
921
- **When to use:** chat is a secondary concern (not the core product), and
922
- should be accessible from anywhere without navigating. **When NOT to use:**
923
- if chat is central to the app, use a route placement instead — widgets
924
- don't scale to inbox-style usage.
925
-
926
- ### Steps
927
-
928
- #### 1. Create the ChatWidget component
929
-
930
- ```tsx
931
- // src/components/ChatWidget.tsx (or components/ChatWidget.tsx in Next.js)
932
- import { useState } from "react";
933
- import {
934
- CometChatConversations,
935
- CometChatMessageHeader,
936
- CometChatMessageList,
937
- CometChatMessageComposer,
938
- } from "@cometchat/chat-uikit-react";
939
- import { CometChat } from "@cometchat/chat-sdk-javascript";
940
-
941
- export default function ChatWidget() {
942
- const [open, setOpen] = useState(false);
943
- const [selected, setSelected] = useState<CometChat.User | CometChat.Group>();
944
-
945
- function handleConversationClick(conv: CometChat.Conversation) {
946
- const entity = conv.getConversationWith();
947
- if (entity instanceof CometChat.User || entity instanceof CometChat.Group) {
948
- setSelected(entity);
949
- }
950
- }
951
-
952
- return (
953
- <>
954
- {/* Floating trigger button — always visible */}
955
- <button
956
- type="button"
957
- aria-label={open ? "Close chat" : "Open chat"}
958
- onClick={() => setOpen((v) => !v)}
959
- style={{
960
- position: "fixed",
961
- bottom: 24,
962
- right: 24,
963
- width: 56,
964
- height: 56,
965
- borderRadius: "50%",
966
- background: "var(--cometchat-primary-color, #6c63ff)",
967
- color: "white",
968
- border: "none",
969
- cursor: "pointer",
970
- fontSize: 24,
971
- boxShadow: "0 4px 16px rgba(0, 0, 0, 0.15)",
972
- zIndex: 9999,
973
- }}
974
- >
975
- {open ? "×" : "💬"}
976
- </button>
977
-
978
- {/* Widget panel — overlay, not a full-page drawer */}
979
- {open && (
980
- <div
981
- style={{
982
- position: "fixed",
983
- bottom: 96, // leave room for the button
984
- right: 24,
985
- width: "min(380px, calc(100vw - 48px))",
986
- height: "min(600px, calc(100vh - 120px))",
987
- background: "var(--cometchat-background-color-01, white)",
988
- border: "1px solid var(--cometchat-border-color-light, #eee)",
989
- borderRadius: 12,
990
- boxShadow: "0 8px 32px rgba(0, 0, 0, 0.2)",
991
- display: "flex",
992
- flexDirection: "column",
993
- overflow: "hidden",
994
- zIndex: 9998,
995
- }}
996
- >
997
- {selected ? (
998
- <>
999
- <button
1000
- onClick={() => setSelected(undefined)}
1001
- style={{ alignSelf: "flex-start", background: "none", border: "none", padding: 12, cursor: "pointer" }}
1002
- >
1003
- ← Back
1004
- </button>
1005
- {selected instanceof CometChat.User && (
1006
- <>
1007
- <CometChatMessageHeader user={selected} />
1008
- <div style={{ flex: 1, overflow: "hidden" }}>
1009
- <CometChatMessageList user={selected} hideReplyInThreadOption />
1010
- </div>
1011
- <CometChatMessageComposer user={selected} />
1012
- </>
1013
- )}
1014
- {selected instanceof CometChat.Group && (
1015
- <>
1016
- <CometChatMessageHeader group={selected} />
1017
- <div style={{ flex: 1, overflow: "hidden" }}>
1018
- <CometChatMessageList group={selected} hideReplyInThreadOption />
1019
- </div>
1020
- <CometChatMessageComposer group={selected} />
1021
- </>
1022
- )}
1023
- </>
1024
- ) : (
1025
- <CometChatConversations onItemClick={handleConversationClick} />
1026
- )}
1027
- </div>
1028
- )}
1029
- </>
1030
- );
1031
- }
1032
- ```
1033
-
1034
- **Key points:**
1035
- - Button and panel are both `position: fixed`. `z-index: 9999` / `9998` ensures they float above the app's content but don't conflict with modals (which typically go to `z-index: 10000+`).
1036
- - Width/height clamp against viewport (`min(...)`) so the widget shrinks gracefully on mobile. On screens < 428px you may want to switch to full-screen (`width: 100vw; height: 100vh; bottom: 0; right: 0`) — gate with a `useEffect` + `window.innerWidth` or CSS media query.
1037
- - The panel renders conversation list by default; clicking a conversation swaps to the single-thread view with a back arrow. Mirrors WhatsApp / iMessage widget UX.
1038
- - Wrap everything in `{open && (...)}` rather than animating transforms — the CometChat components subscribe to SDK events on mount, so keeping the panel in the tree when closed wastes resources.
1039
-
1040
- #### 2. Mount at the app root
1041
-
1042
- Where to mount depends on the framework. The widget must be a sibling (not a descendant) of the app's main layout so its fixed positioning escapes any overflow-hidden containers.
1043
-
1044
- | Framework | Mount location |
1045
- |---|---|
1046
- | React (Vite / CRA) | `src/main.tsx` or `src/App.tsx`, sibling of `<Routes>` |
1047
- | Next.js App Router | `app/layout.tsx`, sibling of `{children}` (inside `<body>`, outside any main container with `overflow: hidden`) |
1048
- | Next.js Pages Router | `pages/_app.tsx`, sibling of `<Component />` |
1049
- | React Router | `app/root.tsx` (v7) or wherever `<Outlet />` lives (v6) |
1050
- | Astro | Inside a `client:only="react"` island in `src/layouts/BaseLayout.astro` |
1051
-
1052
- **Example — Next.js App Router:**
1053
-
1054
- ```tsx
1055
- // app/layout.tsx
1056
- import ChatWidget from "@/components/ChatWidget";
1057
-
1058
- export default function RootLayout({ children }) {
1059
- return (
1060
- <html lang="en">
1061
- <body>
1062
- {children}
1063
- <ChatWidget />
1064
- </body>
1065
- </html>
1066
- );
1067
- }
1068
- ```
1069
-
1070
- In the Pages Router and Vite cases, the provider (`CometChatProvider`) must wrap both the app content *and* the widget — otherwise the widget won't have access to the init'd SDK.
1071
-
1072
- #### 3. Conditional rendering per route (optional)
1073
-
1074
- Most apps want to hide the widget on auth pages (login, signup, password reset). Options:
1075
-
1076
- **React Router / Next.js** — use `useLocation()` / `usePathname()`:
1077
-
1078
- ```tsx
1079
- // Wrap the export with a router-aware gate
1080
- import { useLocation } from "react-router-dom"; // or `usePathname` in Next.js
1081
-
1082
- export default function ChatWidgetGate() {
1083
- const pathname = useLocation().pathname;
1084
- const hiddenOn = ["/login", "/signup", "/forgot-password"];
1085
- if (hiddenOn.some((p) => pathname.startsWith(p))) return null;
1086
- return <ChatWidget />;
1087
- }
1088
- ```
1089
-
1090
- **Astro** — render the island only on the pages that want it, rather than globally in the layout.
1091
-
1092
- #### 4. Feature toggle via config
1093
-
1094
- Record the choice in `.cometchat/config.json` so the integration skill knows the widget was used:
1095
-
1096
- ```bash
1097
- npx @cometchat/skills-cli config save --placement widget --json
1098
- ```
1099
-
1100
- **Do not invoke `cometchat add-widget`** — that's a v2 CLI command that writes a template-based widget. v3 skills write the widget directly using the pattern above, so it fits the project's existing code style. `add-widget` is retained only for backward compatibility with v2 integrations.
1101
-
1102
- ---
1103
-
1104
- ## Embedded placement
1105
-
1106
- Chat embedded directly in an existing page, alongside other content. Common for marketplace product pages, dashboards, or support panels.
1107
-
1108
- ### Steps
1109
-
1110
- #### 1. Create a ChatPanel component
1111
-
1112
- The critical thing about embedded placement is the container MUST have an explicit height. CometChat components fill 100% of their container -- if the container has no height constraint, the components either collapse to zero or overflow the page.
1113
-
1114
- ```tsx
1115
- // ChatPanel.tsx
1116
- import { useEffect, useState } from "react";
1117
- import {
1118
- CometChatMessageHeader,
1119
- CometChatMessageList,
1120
- CometChatMessageComposer,
1121
- } from "@cometchat/chat-uikit-react";
1122
- import { CometChat } from "@cometchat/chat-sdk-javascript";
1123
-
1124
- interface ChatPanelProps {
1125
- targetUserId?: string;
1126
- targetGroupId?: string;
1127
- height?: string; // e.g., "500px", "60vh"
1128
- conversationMode?: boolean; // Show conversation list instead of single thread
1129
- }
1130
-
1131
- export function ChatPanel({
1132
- targetUserId,
1133
- targetGroupId,
1134
- height = "500px",
1135
- }: ChatPanelProps) {
1136
- const [user, setUser] = useState<CometChat.User>();
1137
- const [group, setGroup] = useState<CometChat.Group>();
1138
- const [loading, setLoading] = useState(true);
1139
-
1140
- useEffect(() => {
1141
- if (targetUserId) {
1142
- CometChat.getUser(targetUserId)
1143
- .then((u) => {
1144
- setUser(u);
1145
- setGroup(undefined);
1146
- setLoading(false);
1147
- })
1148
- .catch(() => setLoading(false));
1149
- } else if (targetGroupId) {
1150
- CometChat.getGroup(targetGroupId)
1151
- .then((g) => {
1152
- setUser(undefined);
1153
- setGroup(g);
1154
- setLoading(false);
1155
- })
1156
- .catch(() => setLoading(false));
1157
- }
1158
- }, [targetUserId, targetGroupId]);
1159
-
1160
- return (
1161
- <div
1162
- style={{
1163
- height,
1164
- display: "flex",
1165
- flexDirection: "column",
1166
- border: "1px solid #eee",
1167
- borderRadius: "var(--cometchat-border-radius-lg, 8px)",
1168
- overflow: "hidden",
1169
- }}
1170
- >
1171
- {loading ? (
1172
- <div style={{ flex: 1, display: "flex", alignItems: "center", justifyContent: "center" }}>
1173
- Loading chat...
1174
- </div>
1175
- ) : (
1176
- <>
1177
- {user && <CometChatMessageHeader user={user} />}
1178
- {group && <CometChatMessageHeader group={group} />}
1179
- <div style={{ flex: 1, overflow: "hidden" }}>
1180
- {user && <CometChatMessageList user={user} hideReplyInThreadOption />}
1181
- {group && <CometChatMessageList group={group} hideReplyInThreadOption />}
1182
- </div>
1183
- {user && <CometChatMessageComposer user={user} />}
1184
- {group && <CometChatMessageComposer group={group} />}
1185
- </>
1186
- )}
1187
- </div>
1188
- );
1189
- }
1190
- ```
1191
-
1192
- #### 2. Find the container in the existing page
1193
-
1194
- **Read the existing page where chat should be embedded.** Understand the layout before adding anything. Common patterns:
1195
-
1196
- - **Product page:** Chat panel below or beside the product description
1197
- - **Dashboard:** Chat panel in a sidebar or a dashboard card
1198
- - **Profile page:** Chat panel as a tab or section
1199
-
1200
- #### 3. Render the panel with a target
1201
-
1202
- Connect the target user/group based on the page's data:
1203
-
1204
- ```tsx
1205
- // Example: embedding on a product page
1206
- function ProductPage({ product }) {
1207
- return (
1208
- <div style={{ display: "flex", gap: 24 }}>
1209
- <div style={{ flex: 1 }}>
1210
- <h1>{product.name}</h1>
1211
- <p>{product.description}</p>
1212
- {/* other product content */}
1213
- </div>
1214
- <div style={{ width: 400 }}>
1215
- <h3>Chat with the seller</h3>
1216
- <ChatPanel
1217
- targetUserId={product.sellerId}
1218
- height="500px"
1219
- />
1220
- </div>
1221
- </div>
1222
- );
1223
- }
1224
- ```
1225
-
1226
- #### 4. Conversation-list embedded panel
1227
-
1228
- If you want an embedded panel with a conversation list (not just a single thread), use the multi-conversation composition from `cometchat-components` inside a container with explicit height:
1229
-
1230
- ```tsx
1231
- // EmbeddedInbox.tsx
1232
- import { useState } from "react";
1233
- import {
1234
- CometChatConversations,
1235
- CometChatMessageHeader,
1236
- CometChatMessageList,
1237
- CometChatMessageComposer,
1238
- } from "@cometchat/chat-uikit-react";
1239
- import { CometChat } from "@cometchat/chat-sdk-javascript";
1240
-
1241
- interface EmbeddedInboxProps {
1242
- height?: string;
1243
- }
1244
-
1245
- export function EmbeddedInbox({ height = "600px" }: EmbeddedInboxProps) {
1246
- const [selectedUser, setSelectedUser] = useState<CometChat.User>();
1247
- const [selectedGroup, setSelectedGroup] = useState<CometChat.Group>();
1248
-
1249
- function handleConversationClick(conversation: CometChat.Conversation) {
1250
- const entity = conversation.getConversationWith();
1251
- if (entity instanceof CometChat.User) {
1252
- setSelectedUser(entity);
1253
- setSelectedGroup(undefined);
1254
- } else if (entity instanceof CometChat.Group) {
1255
- setSelectedUser(undefined);
1256
- setSelectedGroup(entity);
1257
- }
1258
- }
1259
-
1260
- return (
1261
- <div style={{ height, display: "flex", border: "1px solid #eee", borderRadius: 8, overflow: "hidden" }}>
1262
- <div style={{ width: "300px", borderRight: "1px solid #eee" }}>
1263
- <CometChatConversations onItemClick={handleConversationClick} />
1264
- </div>
1265
- <div style={{ flex: 1, display: "flex", flexDirection: "column" }}>
1266
- {selectedUser && (
1267
- <>
1268
- <CometChatMessageHeader user={selectedUser} />
1269
- <div style={{ flex: 1, overflow: "hidden" }}>
1270
- <CometChatMessageList user={selectedUser} hideReplyInThreadOption />
1271
- </div>
1272
- <CometChatMessageComposer user={selectedUser} />
1273
- </>
1274
- )}
1275
- {selectedGroup && (
1276
- <>
1277
- <CometChatMessageHeader group={selectedGroup} />
1278
- <div style={{ flex: 1, overflow: "hidden" }}>
1279
- <CometChatMessageList group={selectedGroup} hideReplyInThreadOption />
1280
- </div>
1281
- <CometChatMessageComposer group={selectedGroup} />
1282
- </>
1283
- )}
1284
- {!selectedUser && !selectedGroup && (
1285
- <div style={{ flex: 1, display: "flex", alignItems: "center", justifyContent: "center", color: "#999" }}>
1286
- Select a conversation
1287
- </div>
1288
- )}
1289
- </div>
1290
- </div>
1291
- );
1292
- }
1293
- ```
1294
-
1295
- ---
1296
-
1297
- ## Hard rules
1298
-
1299
- These rules apply to ALL placement patterns. Violating any of them causes integration bugs or destroys the user's existing project.
1300
-
1301
- 1. **NEVER replace the project's existing entry file** (`App.tsx`, `page.tsx`, `layout.tsx`, `main.tsx`, etc.) unless the user explicitly chose "demo mode." Replacing the entry file destroys all existing functionality.
1302
-
1303
- 2. **ALWAYS read the project's existing files before deciding where to put things.** Do not assume a project structure. Read the router config, the nav component, the layout files. Understand what exists before adding to it.
1304
-
1305
- 3. **ALWAYS create new files alongside existing ones.** Do not modify files you do not fully understand. The exceptions are:
1306
- - The router config (to add a route) -- read it first
1307
- - The nav component (to add a link) -- read it first
1308
- - The root CSS file (to add the css-variables.css import) -- read it first
1309
-
1310
- 4. **CometChat CSS must be imported exactly once.** Before adding the import, check if it already exists:
1311
- ```bash
1312
- grep -r "css-variables.css" src/ app/ pages/ 2>/dev/null
1313
- ```
1314
- If it is already imported, do not add a duplicate.
1315
-
1316
- 5. **CometChatProvider or init must be at the app root**, not inside a modal/drawer/panel. Re-initializing on every open causes flicker, dropped WebSocket connections, and race conditions.
1317
-
1318
- 6. **Every CometChat container must have explicit dimensions.** Components fill 100% of their parent. If the parent has no height, the components collapse to zero. Always set `height`, `min-height`, or use flex/grid layout with a bounded container.
1319
-
1320
- 6a. **Flex parents that hold a `CometChatMessageList` MUST set `minHeight: 0`** (and `minWidth: 0` for horizontal flex parents). The W3C default `min-height: auto` makes flex children refuse to shrink below their intrinsic content size — so once the conversation grows past the viewport, the list pushes the composer below the fold and the layout breaks. **This is the canonical chat-layout bug** — works fine for short conversations, breaks for long ones. The fix is one CSS property; the diagnosis takes hours if you don't know the rule.
1321
-
1322
- ```tsx
1323
- /* ✓ CORRECT — header + list + composer with the flex-shrink trap fixed */
1324
- <div style={{ display: "flex", flexDirection: "column", height: "100vh" }}>
1325
- <div style={{ flex: 1, display: "flex", flexDirection: "column", minHeight: 0 }}>
1326
- <div style={{ flex: "0 0 auto" }}>
1327
- <CometChatMessageHeader user={user} />
1328
- </div>
1329
- <div style={{ flex: "1 1 0", minHeight: 0, overflow: "hidden" }}>
1330
- <CometChatMessageList user={user} hideReplyInThreadOption />
1331
- </div>
1332
- <div style={{ flex: "0 0 auto" }}>
1333
- <CometChatMessageComposer user={user} />
1334
- </div>
1335
- </div>
1336
- </div>
1337
-
1338
- /* ✗ WRONG — list grows past the viewport once messages exceed visible area */
1339
- <div style={{ display: "flex", flexDirection: "column", height: "100vh" }}>
1340
- <CometChatMessageHeader user={user} />
1341
- <CometChatMessageList user={user} /> {/* takes intrinsic height, no scroll */}
1342
- <CometChatMessageComposer user={user} /> {/* falls off the bottom */}
1343
- </div>
1344
- ```
1345
-
1346
- The wrap-each-component-in-a-flex-sized-div pattern is what makes this work. Don't pass the kit components directly as flex children — wrap them.
1347
-
1348
- 7. **Resolve target users/groups before rendering CometChat components.** Use `CometChat.getUser(uid)` or `CometChat.getGroup(guid)` to get the full `CometChat.User` or `CometChat.Group` object. Do not pass a raw UID string to `user` props -- they expect object instances.
1349
-
1350
- 8. **For SSR frameworks, wrap CometChat components appropriately.** See the `cometchat-core` skill, section 5 (SSR safety), for framework-specific patterns.
1351
-
1352
- 9. **Every `<CometChatMessageList>` MUST include `hideReplyInThreadOption`** unless the integration also wires a thread panel (`CometChatThreadHeader` + scoped `MessageList` + scoped `MessageComposer` with `parentMessageId`). The kit's default (`false`) puts a "Reply in Thread" entry in the message action menu that silently does nothing when no panel is wired. Drawer, widget, modal, and embed patterns never wire a thread panel, so the prop is mandatory there. Two-pane route patterns (full messenger, social) MAY omit it if-and-only-if they implement the full thread-panel plumbing; otherwise keep it. Writing `<CometChatMessageList user={user} />` without the prop in a drawer or widget is a generation bug — every example in this skill includes it for a reason.
1353
-
1354
- 10. **Never animate a CometChat-containing element with `transform`, `translate-*`, or any `transition-transform`.** This includes:
1355
- - Inline `transform: translateX(...)`, `transform: scale(...)`, etc.
1356
- - Tailwind utilities `translate-x-*`, `-translate-x-*`, `translate-x-0`, `translate-x-full`, `translate-y-*`, `scale-*`, `rotate-*`, `skew-*`, `transform-*`
1357
- - `transition-transform`, `motion-safe:translate-*`, `will-change: transform`
1358
- - `filter`, `perspective`, `backdrop-filter`
1359
-
1360
- Any of these creates a new containing block for `position: fixed` descendants, which reparents CometChat's fixed-positioned popovers (emoji picker, message options menu, file preview, reactions popover, thread panel) to the animated container instead of the viewport. Animate the `right` / `left` offset instead (inline: `right: isOpen ? 0 : '-420px'`; Tailwind: `right-0` / `right-[-420px]` with `transition-[right]`). See `cometchat-core` § 8 anti-pattern 11 for the full CSS-spec explanation.