Commit c059844
authored
fix: reanimated 4.3.0 attachment preview list (#3569)
## 🎯 Goal
This PR fixes an issue that was unfortunately introduced with upgrading
`react-native-reanimated` to `4.3.0` amongst other things. The issue
stems from how `reanimated` actually synchronizes values with state and
scrolling behaviour, which has clearly changed. Because of that, it was
very common for our scrollable area (the calculated one) to become
completely out of sync with the list because of the correction we were
applying.
For now, this has been fixed by ditching that approach entirely and
relying purely on a resizable spacer that waits for animations to finish
and all frames to settle before reducing its width. Essentially, it's
deferred list resizing that forces waiting for animations to finish
before that. A lot of code has been added, but now the animations are
smooth on both versions of reanimated.
## 🛠 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 b70f8d5 commit c059844
4 files changed
Lines changed: 514 additions & 194 deletions
File tree
- examples
- ExpoMessaging
- SampleApp
- package/src/components/MessageInput
- __tests__
- components/AttachmentPreview
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1578 | 1578 | | |
1579 | 1579 | | |
1580 | 1580 | | |
1581 | | - | |
1582 | | - | |
1583 | | - | |
1584 | | - | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
1585 | 1585 | | |
1586 | 1586 | | |
1587 | 1587 | | |
| |||
2583 | 2583 | | |
2584 | 2584 | | |
2585 | 2585 | | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
2586 | 2595 | | |
2587 | 2596 | | |
2588 | 2597 | | |
| |||
3750 | 3759 | | |
3751 | 3760 | | |
3752 | 3761 | | |
| 3762 | + | |
| 3763 | + | |
| 3764 | + | |
| 3765 | + | |
| 3766 | + | |
3753 | 3767 | | |
3754 | 3768 | | |
3755 | 3769 | | |
| |||
3771 | 3785 | | |
3772 | 3786 | | |
3773 | 3787 | | |
| 3788 | + | |
| 3789 | + | |
| 3790 | + | |
| 3791 | + | |
| 3792 | + | |
| 3793 | + | |
| 3794 | + | |
| 3795 | + | |
| 3796 | + | |
| 3797 | + | |
| 3798 | + | |
3774 | 3799 | | |
3775 | 3800 | | |
3776 | 3801 | | |
| |||
5410 | 5435 | | |
5411 | 5436 | | |
5412 | 5437 | | |
| 5438 | + | |
| 5439 | + | |
| 5440 | + | |
| 5441 | + | |
| 5442 | + | |
5413 | 5443 | | |
5414 | 5444 | | |
5415 | 5445 | | |
| |||
6043 | 6073 | | |
6044 | 6074 | | |
6045 | 6075 | | |
6046 | | - | |
6047 | | - | |
6048 | | - | |
6049 | | - | |
| 6076 | + | |
| 6077 | + | |
| 6078 | + | |
| 6079 | + | |
6050 | 6080 | | |
6051 | 6081 | | |
6052 | 6082 | | |
6053 | | - | |
| 6083 | + | |
6054 | 6084 | | |
6055 | 6085 | | |
6056 | 6086 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3565 | 3565 | | |
3566 | 3566 | | |
3567 | 3567 | | |
3568 | | - | |
3569 | | - | |
3570 | | - | |
3571 | | - | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
3572 | 3572 | | |
3573 | | - | |
3574 | | - | |
3575 | | - | |
| 3573 | + | |
| 3574 | + | |
| 3575 | + | |
3576 | 3576 | | |
3577 | 3577 | | |
3578 | 3578 | | |
| |||
5088 | 5088 | | |
5089 | 5089 | | |
5090 | 5090 | | |
| 5091 | + | |
| 5092 | + | |
| 5093 | + | |
| 5094 | + | |
| 5095 | + | |
5091 | 5096 | | |
5092 | 5097 | | |
5093 | 5098 | | |
| |||
5129 | 5134 | | |
5130 | 5135 | | |
5131 | 5136 | | |
| 5137 | + | |
| 5138 | + | |
| 5139 | + | |
| 5140 | + | |
| 5141 | + | |
| 5142 | + | |
| 5143 | + | |
| 5144 | + | |
| 5145 | + | |
| 5146 | + | |
| 5147 | + | |
5132 | 5148 | | |
5133 | 5149 | | |
5134 | 5150 | | |
| |||
7482 | 7498 | | |
7483 | 7499 | | |
7484 | 7500 | | |
| 7501 | + | |
| 7502 | + | |
| 7503 | + | |
| 7504 | + | |
| 7505 | + | |
7485 | 7506 | | |
7486 | 7507 | | |
7487 | 7508 | | |
| |||
8270 | 8291 | | |
8271 | 8292 | | |
8272 | 8293 | | |
8273 | | - | |
8274 | | - | |
8275 | | - | |
8276 | | - | |
| 8294 | + | |
| 8295 | + | |
| 8296 | + | |
| 8297 | + | |
8277 | 8298 | | |
8278 | 8299 | | |
8279 | 8300 | | |
8280 | | - | |
| 8301 | + | |
8281 | 8302 | | |
8282 | 8303 | | |
8283 | 8304 | | |
| |||
Lines changed: 46 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
181 | 226 | | |
182 | 227 | | |
183 | 228 | | |
| |||
0 commit comments