Commit a4b1c26
authored
fix(Icons, RTL): update icon catalog, RTL layout fixes, dark mode & thread voice recording (#3090)
### 🎯 Goal
Sync remaining out-of-date icons with the refreshed Phosphor Line SVG
catalog, add automatic RTL mirroring for directional icons,
comprehensively fix RTL layout issues across the SDK, fix reaction count
dark mode support, and enable voice recording in threads.
### 🛠 Implementation details
**Icon catalog sync** (follows up on #3080):
- **`IconCrossSmall` → `IconXmarkSmall`**: updated path from
`xmark-small.svg`
- **`IconExclamationTriangle` → `IconExclamationTriangleFill`**:
upgraded from 16×16 to 20×20 filled variant
- **`IconEyeOpen` → `IconEyeFill`**: upgraded from 16×16 to 20×20 filled
variant
- **`IconGiphy`**: synced precision updates
- All renames include `// was:` comments; updated all consumer imports
**RTL icon mirroring**:
- Extended `createIcon`'s `defaultProps` type to accept `data-*`
attributes
- Flagged 12 directional icons with `{ 'data-rtl-mirror': '' }` via
`defaultProps`
- Added CSS rule: `[dir='rtl'] .str-chat__icon[data-rtl-mirror] {
transform: scaleX(-1) }`
- Mirrored icons: `IconArrowLeft`, `IconArrowUpRight`, `IconReply`,
`IconChevronLeft`, `IconChevronRight`, `IconSidebar`, `IconSearch`,
`IconMute`, `IconSend`, `IconVideo`, `IconVideoFill`, `IconAudio`
**RTL layout fixes** (comprehensive audit — physical → logical CSS
properties):
- **ContextMenu**: `text-align: left` → `start`
- **AttachmentPreview**: `right` → `inset-inline-end` (remove button),
`padding-right` → `padding-inline-end`, `left` → `inset-inline-start`
(video indicator, loading/error icons)
- **AudioPlayback**: `left` → `inset-inline-start` on progress
indicators (CSS + inline), gradient direction flips in RTL
- **AudioRecorder**: `padding-left` → `padding-inline-start`, removed
arbitrary `max-width` caps on waveform containers
- **Message**: `margin-left`/`margin-right` → logical on edited
indicator and reactions host, `text-align: right` → `end`
- **Reply connector**: physical `border-*`/`left`/`right` → logical
`border-inline-*`/`border-end-*`/`inset-inline-*` on `::after`
pseudo-element
- **AvatarStack**: `margin-left` → `margin-inline-start`
- **Avatar**: `left` → `inset-inline-start` (status badge)
- **GroupAvatar**: `left`/`right` → `inset-inline-start`/`end` (grid
positions + online badge)
- **ChatView**: `border-right` → `border-inline-end`, `left` →
`inset-inline-start` (tooltip)
- **ChannelListItem**: `right` → `inset-inline-end` (action buttons)
- **Gallery**: `left`/`right` → logical (nav buttons)
- **Giphy**: `left` → `inset-inline-start` (badge)
- **Modal**: `right` → `inset-inline-end` (close button)
- **Callout**: `right` → `inset-inline-end` (close button)
- **ScrollToLatestMessage**: `right` → `inset-inline-end` (unread badge)
- **MessageReactionsDetail**: `left` → `inset-inline-start`, physical
border-radius → logical
- **QuotedMessagePreview**: `left` → `inset-inline-start` (play
indicator)
- **TextInput**: `margin-right` → `margin-inline-end` (trailing slot)
**Dark mode fix**:
- **Reactions**: applied `color: var(--reaction-text)` to reaction
button mixin — the variable was defined for light/dark modes but never
used, causing invisible count text in dark mode
**Example app fixes**:
- Panel resize logic: detect `direction` at drag start and flip
`clientX` calculations for RTL
- Thread composer: enable `audioRecordingEnabled` via
`additionalMessageComposerProps`
**Tests**: updated 3 assertions (`left` → `inset-inline-start`) and
refreshed 4 snapshots.
### 🎨 UI Changes
- No visual changes in LTR light mode
- In RTL (`dir="rtl"`): icons auto-flip, all layout elements position
correctly, waveforms respect reading direction, avatar stacks/group
avatars mirror properly, context menus/modals/callouts align to correct
side
- In dark mode: reaction count text is now visible
- Voice recording now available in thread composer (example app)1 parent 6239895 commit a4b1c26
40 files changed
Lines changed: 137 additions & 108 deletions
File tree
- examples/vite/src
- AppSettings/ActionsMenu
- ChatLayout
- src/components
- Attachment
- __tests__
- styling
- AudioPlayback
- components
- styling
- Avatar/styling
- ChannelListItem/styling
- ChatView/styling
- Dialog/styling
- Form/styling
- Gallery
- __tests__/__snapshots__
- styling
- Icons
- styling
- MediaRecorder/AudioRecorder
- __tests__
- __snapshots__
- styling
- MessageComposer
- AttachmentPreviewList
- __tests__/__snapshots__
- styling
- MessageList/styling
- Message/styling
- Modal/styling
- Notifications
- Reactions/styling
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
155 | 158 | | |
156 | 159 | | |
157 | 160 | | |
158 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
159 | 165 | | |
160 | 166 | | |
161 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| 262 | + | |
| 263 | + | |
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
265 | 267 | | |
266 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
267 | 271 | | |
268 | 272 | | |
269 | 273 | | |
| |||
361 | 365 | | |
362 | 366 | | |
363 | 367 | | |
| 368 | + | |
364 | 369 | | |
365 | 370 | | |
366 | 371 | | |
367 | 372 | | |
368 | 373 | | |
369 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
370 | 377 | | |
371 | 378 | | |
372 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
0 commit comments