Commit 5feeccb
authored
feat: allow message overlay anchoring (#3504)
## 🎯 Goal
This PR updates the message row and overlay interaction model. The
message context menu now anchors its top and bottom portal items to the
message bubble area instead of the full message row, and custom
MessageItemView implementations can control that behavior via
`useMessageContext().contextMenuAnchorRef`. Swipe-to-reply was also
moved from the inner bubble to the full `MessageItemView`, while keeping
the existing swipe logic intact.
As part of that cleanup, the old `messageContentWidth` plumbing was
removed, the internal `MessageBubble` component was inlined into
`MessageItemView`, and the nested `messageItemView.bubble.*` theme keys
were flattened into top level `messageItemView` style keys.
## 🛠 Implementation details
<!-- Provide a description of the implementation -->
## 🎨 UI Changes
<!-- Add relevant screenshots -->
<details>
<summary>iOS</summary>
<table>
<thead>
<tr>
<td>Before</td>
<td>After</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<!--<img src="" /> -->
</td>
<td>
<!--<img src="" /> -->
</td>
</tr>
</tbody>
</table>
</details>
<details>
<summary>Android</summary>
<table>
<thead>
<tr>
<td>Before</td>
<td>After</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<!--<img src="" /> -->
</td>
<td>
<!--<img src="" /> -->
</td>
</tr>
</tbody>
</table>
</details>
## 🧪 Testing
<!-- Explain how this change can be tested (or why it can't be tested)
-->
## ☑️ Checklist
- [ ] I have signed the [Stream
CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform)
(required)
- [ ] PR targets the `develop` branch
- [ ] Documentation is updated
- [ ] New code is tested in main example apps, including all possible
scenarios
- [ ] SampleApp iOS and Android
- [ ] Expo iOS and Android1 parent 72bd39f commit 5feeccb
7 files changed
Lines changed: 253 additions & 278 deletions
File tree
- package/src
- components/Message
- MessageItemView
- __tests__
- hooks
- contexts
- messageContext
- themeContext/utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 2 | + | |
10 | 3 | | |
11 | 4 | | |
12 | 5 | | |
| |||
54 | 47 | | |
55 | 48 | | |
56 | 49 | | |
| 50 | + | |
57 | 51 | | |
58 | 52 | | |
59 | 53 | | |
| |||
332 | 326 | | |
333 | 327 | | |
334 | 328 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
339 | 332 | | |
340 | 333 | | |
341 | 334 | | |
342 | 335 | | |
343 | 336 | | |
344 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
345 | 341 | | |
346 | 342 | | |
347 | 343 | | |
| |||
698 | 694 | | |
699 | 695 | | |
700 | 696 | | |
| 697 | + | |
701 | 698 | | |
702 | 699 | | |
703 | 700 | | |
| |||
815 | 812 | | |
816 | 813 | | |
817 | 814 | | |
| 815 | + | |
| 816 | + | |
818 | 817 | | |
819 | 818 | | |
820 | 819 | | |
| |||
841 | 840 | | |
842 | 841 | | |
843 | 842 | | |
844 | | - | |
| 843 | + | |
845 | 844 | | |
846 | 845 | | |
847 | 846 | | |
848 | 847 | | |
849 | 848 | | |
850 | 849 | | |
851 | 850 | | |
852 | | - | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
853 | 855 | | |
854 | 856 | | |
855 | 857 | | |
| |||
865 | 867 | | |
866 | 868 | | |
867 | 869 | | |
868 | | - | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
869 | 873 | | |
870 | 874 | | |
871 | 875 | | |
| |||
883 | 887 | | |
884 | 888 | | |
885 | 889 | | |
886 | | - | |
| 890 | + | |
887 | 891 | | |
888 | 892 | | |
889 | 893 | | |
890 | 894 | | |
891 | 895 | | |
892 | 896 | | |
893 | | - | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
894 | 901 | | |
895 | 902 | | |
896 | 903 | | |
| |||
Lines changed: 5 additions & 98 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | 18 | | |
83 | 19 | | |
84 | 20 | | |
85 | 21 | | |
86 | | - | |
| 22 | + | |
87 | 23 | | |
88 | 24 | | |
89 | 25 | | |
90 | 26 | | |
91 | 27 | | |
92 | 28 | | |
93 | 29 | | |
94 | | - | |
| 30 | + | |
95 | 31 | | |
96 | 32 | | |
97 | 33 | | |
| |||
187 | 123 | | |
188 | 124 | | |
189 | 125 | | |
190 | | - | |
| 126 | + | |
191 | 127 | | |
192 | 128 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
| 129 | + | |
198 | 130 | | |
199 | 131 | | |
200 | 132 | | |
| |||
205 | 137 | | |
206 | 138 | | |
207 | 139 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | 140 | | |
213 | 141 | | |
214 | 142 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | 143 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
| 144 | + | |
238 | 145 | | |
0 commit comments