Repository navigation
docs(react): add RTL Support for the React UI Kit - #647
aanshisingh-cometchat wants to merge 6 commits into
Conversation
New RTL Support page for the React UI Kit v7: layout direction vs
language, following the page's <html dir> ('auto'), setting it for the
whole kit (UIKitSettingsBuilder.setLayoutDirection, <CometChatProvider
layoutDirection>, CometChatUIKit.setLayoutDirection), the per-component
layoutDirection prop, precedence, what mirrors and what stays LTR,
message and composer text direction, digits and dates, and custom views
with CSS logical properties and the cometchat-icon--mirror class.
Also: a Layout Direction section and a layoutDirection prop entry on 35
component pages, the provider's layoutDirection prop, Methods
(setLayoutDirection on the builder and CometChatUIKit,
getLayoutDirection), Arabic in Localization (20 languages), an RTL
troubleshooting section, the sidebar entry and the LLM index.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SrArYcnTWam26CSxAdeZrz
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Matches uikit-react PR #2456: - d3a6e1120: the Calls SDK call screen inside CometChatOngoingCall is always LTR. - d95bb7432: member, last-seen and thread reply counts use plural keys (group_member_count_*, last_seen_minutes_ago_*, last_seen_hours_ago_*, thread_reply_count_*, thread_view_reply_count_*). New Count Texts section on Localization, and a plural-forms note on RTL Support. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SrArYcnTWam26CSxAdeZrz
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PrajwalDhuleCC
left a comment
There was a problem hiding this comment.
Checked this against the React UI Kit at the head of cometchat-team/uikit-react#2467 (fa8ace88, version 7.4.0). The docs were written against d3a6e1120, and the kit has had 35 commits since, so a few statements are now out of date (inline).
These match the kit:
setLayoutDirection()on the builder,CometChatUIKit.setLayoutDirection()andgetLayoutDirection(), andinit()applying the builder's value every time.- The provider prop winning over the builder and the runtime setter, including when it's
"auto". - The
getDirection()wording, including the no-argument case. - Which components take the prop, including
CometChatVoiceNoteBubblepassing it to the audio bubble; the Card and Delete bubbles don't take it. - The "Count Texts" table against the en-us strings, the Arabic forms, and the fallback to
_other. - The global
cometchat-icon--mirrorrule. - The new anchor links resolve.
Outside the inline notes:
- Nit: 7.4.0 adds other translation keys the Localization page doesn't list:
typing_indicator_typing,typing_indicator_others,file_size_b/_kb/_mb/_gbandaudio_bubble_loading. - The description still points to uikit-react PR #2456; the kit PR is now cometchat-team/uikit-react#2467.
- As the description says, this should merge only once 7.4.0 is on npm. The latest there is now 7.3.0, not 7.2.6 as the description says.
I checked these by reading the kit's code, not by running it. Please verify each point yourself.
…ider root Addresses Prajwal's review on #647: - Localization: an override of an old count word still applies until the new plural key is overridden (08b51be8f); list the other keys 7.4.0 adds (typing_indicator_*, file_size_*, audio_bubble_loading). - RTL support / troubleshooting: menus and dialogs render in the CometChatProvider's root element, so dir around the whole provider works. - Troubleshooting: the --cometchat-language-direction override needs .cometchat[data-cometchat-language-direction] to beat the kit's own rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SrArYcnTWam26CSxAdeZrz
|
@PrajwalDhuleCC Thanks. The three inline points are fixed in e580030 and replied to on their threads. The nit is done too: Localization has a short "Other Texts Added in 7.4.0" table for |
Navigation only; the page URL is unchanged, so no redirect is needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SrArYcnTWam26CSxAdeZrz
ashfaqcometchat
left a comment
There was a problem hiding this comment.
Reviewed at 41823d1d against the published @cometchat/chat-uikit-react 7.4.0 (on npm since today, so the merge-timing note in the description no longer blocks).
No build, redirect or link problems: 0 dangling nav refs, 0 broken internal links, all new anchors resolve. The documented API (setLayoutDirection, getLayoutDirection, getDirection, the CometChatProvider prop, CometChatLayoutDirection, the plural count keys, the 7.4.0 text keys, cometchat-icon--mirror, --cometchat-language-direction) matches the package, and every component listed as taking layoutDirection has the prop in 7.4.0.
Minor fixes:
- Overview contradicts itself:
ui-kit/react/overview.mdx:68still says "19 supported languages"; the table in the same page now says 20. - CSS example: see the inline comment.
- Description is out of date: it says "sidebar: Customization, after Localization", but the last commit moved the page to the Features group; it also says 7.4.0 is not published.
Addresses Ashfaq's review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SrArYcnTWam26CSxAdeZrz
|
@ashfaqcometchat Thanks. All three are fixed:
|
ashfaqcometchat
left a comment
There was a problem hiding this comment.
Re-reviewed at 8038dd0c: all findings from my earlier review are fixed. Approving.
Description
Adds RTL (right-to-left) support documentation for the React UI Kit v7. It matches the React Native (#645), Android (#627) and Flutter (#622) RTL docs, written the web way (
<html dir>, CSS logical properties), and replaces the React half of the earlier combined draft #618.New page: RTL Support (sidebar: Features, after Campaigns). It covers:
'auto'follows the page's<html dir>;CometChatLocalize.getDirection(language)to set it.UIKitSettingsBuilder.setLayoutDirection(),<CometChatProvider layoutDirection>, andCometChatUIKit.setLayoutDirection()at runtime (applies to components mounted afterwards; the provider prop re-renders live).layoutDirectionprop ('ltr' | 'rtl'; onRootin the compound API), with the components that take it.<html dir>rather than a wrapper'sdir.:dir(), and thecometchat-icon--mirrorclass.Updated pages:
layoutDirectionentry in Props. Conversations, Users, Groups, Group Members, Message Header, Message List, Message Composer, Thread Header, Pinned Messages, Saved Messages, Message Information, Reactions, Reaction List, Flag Message Dialog, Search, Notification Feed, Call Buttons, Incoming Call, Outgoing Call, Call Logs, AI Assistant Chat, and the Message, Text, Image, Video, Audio, Voice Note, File, Poll, Sticker, Collaborative Document, Collaborative Whiteboard, Call, Call Action and Group Action bubbles.layoutDirectionprop, a "With Layout Direction" section, the provider tree.setLayoutDirection(),CometChatUIKit.setLayoutDirection()/getLayoutDirection().ar) added (now 20 languages), regional fallback (ar-SA→ar), a note that language and layout direction are separate settings, and a new Count Texts section for the plural count keys (group_member_count_*,last_seen_minutes_ago_*,last_seen_hours_ago_*,thread_reply_count_*,thread_view_reply_count_*) that replace the old keys for those counts. Overview: language count.docs.json: page added to the sidebar.llms-react-v7.mdx: the page link.The TypeScript examples were type-checked against the UI Kit's RTL branch (uikit-react PR #2456): 0 errors in the examples. The docs match the PR at d3a6e1120, including the call-screen fix and the plural count keys (d95bb7432). The kit PR is now cometchat-team/uikit-react#2467 (merged into
dev-v7); e580030 brings the docs up to its head (fa8ace88): old count words, where menus and dialogs render, and the language-direction override.Related Issue(s)
No GitHub issue. Tracked on Multica:
layoutDirectionsetting: ENG-41330Type of Change
Checklist
Additional Information
@cometchat/chat-uikit-react7.4.0 (from cometchat-team/uikit-react#2467), which is now on npm, so this can merge.mint. Every new internal link and#anchorresolves. Amint devpreview hasn't been run yet.useCometChatLayoutDirectionis internal in the React kit (unlike React Native), so the custom-view guidance uses CSS (:dir(), logical properties,cometchat-icon--mirror) andgetComputedStyle.Screenshots (if applicable)
N/A. Text-only changes. RTL screenshots will follow in a separate update.
🤖 Generated with Claude Code
https://claude.ai/code/session_01SrArYcnTWam26CSxAdeZrz