Page MenuHomePhabricator

[native] Convert ChatThreadListSearch to Reanimated 2 syntax
ClosedPublic

Authored by ashoat on May 21 2024, 2:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jul 11, 8:03 AM
Unknown Object (File)
Wed, Jul 10, 11:56 PM
Unknown Object (File)
Wed, Jul 10, 7:13 PM
Unknown Object (File)
Tue, Jul 9, 6:07 PM
Unknown Object (File)
Sat, Jul 6, 7:43 PM
Unknown Object (File)
Jun 21 2024, 5:29 AM
Unknown Object (File)
Jun 21 2024, 5:29 AM
Unknown Object (File)
Jun 21 2024, 5:28 AM
Subscribers

Details

Summary

Addresses ENG-8148.

Note that I replaced animateTowards with something more simple. The difference is the animation is reversed while partway through, it will still take the same length as if it was started from an end state.

Test Plan

On both iOS and Android physical devices, tested ChatThreadListSearch to confirm no functionality regressed.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/chat/chat-thread-list-search.react.js
48 ↗(On Diff #40517)

How come we don't specify the duration? It used to be 100, and the default for withTiming is 300. Do we want it to take longer now?

native/chat/chat-thread-list-search.react.js
48 ↗(On Diff #40517)

Good call – I'll fix this

Actually, I experimented with this and found 100ms to be too short. I'd like to change it to 300ms.

Meanwhile, I decided that we had too many animated variables here... we don't need to have a boolean that triggers animation, we can just trigger animation directly.

Finally: I noticed some unrelated issues with this component. Will address them in a later diff.

native/chat/chat-thread-list-search.react.js
46 ↗(On Diff #40630)

Shouldn't this also be withTiming(0)?

native/chat/chat-thread-list-search.react.js
46 ↗(On Diff #40630)

No, I think we shouldn't be calling withTiming from a render function. It should be called from a callback, an effect, or within a worklet.

If you want an animation to start when a component is rendered, I think the best way to do that is by triggering it from an effect.

This revision is now accepted and ready to land.May 24 2024, 7:45 AM