Commit a82bdcb
authored
fix: post-review
## Breaking Changes
### Removed deprecated `sortReactionDetails` prop and
`ReactionDetailsComparator` type
The `sortReactionDetails` prop has been removed from the following
components and contexts:
- `MessageProps` (and by extension `Message` component)
- `MessageContextValue` (and by extension `MessageContext`)
- `MessageReactionsProps` (and by extension `MessageReactions`
component)
- `MessageReactionsDetailProps` (and by extension
`MessageReactionsDetail` component)
- `MessageListProps` (and by extension `MessageList` component)
- `VirtualizedMessageListProps` (and by extension
`VirtualizedMessageList` component)
The `ReactionDetailsComparator` type export has been removed from
`src/components/Reactions/types.ts`.
**Migration:** Replace all usages of `sortReactionDetails` with the
`reactionDetailsSort` prop, which accepts a `ReactionSort` object
(server-side sort) instead of a client-side comparator function.
### Removed deprecated `reaction_counts` prop from
`MessageReactionsProps`
The `reaction_counts` prop on `MessageReactions` has been removed. It
was previously ignored at runtime.
**Migration:** Use `reaction_groups` instead, which provides richer
per-reaction-type summary data (including `count`).
### Removed deprecated `reactionOptions` prop from
`MessageReactionsProps`
The `reactionOptions` prop on `MessageReactions` has been removed. The
component now reads `reactionOptions` exclusively from
`ComponentContext`.
**Migration:** Pass `reactionOptions` via `<WithComponents overrides={{
reactionOptions }}>...</WithComponents>` instead of directly on
`<MessageReactions>`.
### `UseProcessReactionsParams` no longer accepts `reaction_counts` or
`reactionOptions`
The `UseProcessReactionsParams` type (used by the `useProcessReactions`
hook) no longer includes `reaction_counts` or `reactionOptions` fields,
consistent with the prop removals above.
## New Features
### `capLimit` prop on `MessageReactions`
A new optional `capLimit` prop allows configuring how many reaction
types are displayed before overflow in each visual style:
```ts
capLimit?: {
clustered?: number; // default: 5
segmented?: number; // default: 4
};
```
Previously, only the `segmented` style (in `top` position) capped
reactions at a hardcoded limit of 4. Now the `clustered` style also caps
displayed reaction types (default: 5), and both limits are configurable.
### `reactionGroups` added to `useProcessReactions` return value
The `useProcessReactions` hook now returns `reactionGroups` (the
resolved `Record<string, ReactionGroupResponse> | undefined`) alongside
the existing return fields.
### `reactionGroups` prop on `MessageReactionsDetail`
`MessageReactionsDetail` now accepts a `reactionGroups` prop used to
determine reaction counts when removing a reaction. This enables the
component to switch to the "all reactions" view when the last reaction
of a given type is removed, instead of attempting to refetch an empty
list.
### `UseProcessReactionsParams` type is now exported
The `UseProcessReactionsParams` type is now exported from
`src/components/Reactions/hooks/useProcessReactions.tsx`, making it
available for consumers who build custom reaction processing logic.MessageReactionsDetail adjustments (#3082)1 parent 9472f7b commit a82bdcb
File tree
15 files changed
+104
-140
lines changed- src
- components
- MessageList
- Message
- Reactions
- __tests__
- hooks
- styling
- context
15 files changed
+104
-140
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
| |||
211 | 210 | | |
212 | 211 | | |
213 | 212 | | |
214 | | - | |
215 | 213 | | |
216 | 214 | | |
217 | 215 | | |
| |||
316 | 314 | | |
317 | 315 | | |
318 | 316 | | |
319 | | - | |
320 | 317 | | |
321 | 318 | | |
322 | 319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | 104 | | |
109 | 105 | | |
110 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
| |||
232 | 231 | | |
233 | 232 | | |
234 | 233 | | |
235 | | - | |
236 | 234 | | |
237 | 235 | | |
238 | 236 | | |
| |||
500 | 498 | | |
501 | 499 | | |
502 | 500 | | |
503 | | - | |
504 | 501 | | |
505 | 502 | | |
506 | 503 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
| 89 | + | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| |||
230 | 229 | | |
231 | 230 | | |
232 | 231 | | |
233 | | - | |
234 | 232 | | |
235 | 233 | | |
236 | 234 | | |
| |||
558 | 556 | | |
559 | 557 | | |
560 | 558 | | |
561 | | - | |
562 | 559 | | |
563 | 560 | | |
564 | 561 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | 133 | | |
135 | 134 | | |
136 | 135 | | |
| |||
193 | 192 | | |
194 | 193 | | |
195 | 194 | | |
196 | | - | |
197 | 195 | | |
198 | 196 | | |
199 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 22 | + | |
28 | 23 | | |
29 | 24 | | |
30 | 25 | | |
31 | 26 | | |
32 | 27 | | |
33 | 28 | | |
34 | 29 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 30 | | |
41 | 31 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 32 | | |
48 | 33 | | |
49 | 34 | | |
50 | 35 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | 36 | | |
56 | 37 | | |
57 | | - | |
58 | 38 | | |
59 | 39 | | |
60 | 40 | | |
61 | 41 | | |
62 | 42 | | |
63 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
64 | 47 | | |
65 | 48 | | |
66 | 49 | | |
| |||
80 | 63 | | |
81 | 64 | | |
82 | 65 | | |
| 66 | + | |
83 | 67 | | |
84 | 68 | | |
85 | 69 | | |
86 | 70 | | |
87 | | - | |
88 | 71 | | |
89 | 72 | | |
90 | 73 | | |
91 | 74 | | |
92 | 75 | | |
93 | | - | |
94 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
95 | 83 | | |
96 | 84 | | |
97 | 85 | | |
| |||
118 | 106 | | |
119 | 107 | | |
120 | 108 | | |
121 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
122 | 113 | | |
123 | 114 | | |
124 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
125 | 120 | | |
126 | | - | |
127 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
128 | 126 | | |
129 | 127 | | |
130 | 128 | | |
131 | 129 | | |
132 | 130 | | |
133 | | - | |
134 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
135 | 139 | | |
136 | 140 | | |
137 | 141 | | |
| |||
154 | 158 | | |
155 | 159 | | |
156 | 160 | | |
157 | | - | |
158 | | - | |
159 | | - | |
| 161 | + | |
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
| |||
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
201 | 207 | | |
202 | 208 | | |
203 | 209 | | |
| |||
219 | 225 | | |
220 | 226 | | |
221 | 227 | | |
| 228 | + | |
222 | 229 | | |
223 | 230 | | |
224 | | - | |
225 | 231 | | |
226 | 232 | | |
227 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
25 | | - | |
26 | 25 | | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | 66 | | |
68 | 67 | | |
69 | | - | |
70 | | - | |
71 | 68 | | |
72 | 69 | | |
73 | 70 | | |
| |||
82 | 79 | | |
83 | 80 | | |
84 | 81 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | 82 | | |
94 | 83 | | |
95 | 84 | | |
| |||
142 | 131 | | |
143 | 132 | | |
144 | 133 | | |
145 | | - | |
| 134 | + | |
146 | 135 | | |
147 | 136 | | |
148 | 137 | | |
| |||
173 | 162 | | |
174 | 163 | | |
175 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
176 | 168 | | |
177 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
178 | 176 | | |
179 | 177 | | |
180 | 178 | | |
| |||
0 commit comments