Page MenuHomePhabricator

[native] Convert ChatThreadListSearch to Reanimated 2 syntax
ClosedPublic

Authored by ashoat on May 21 2024, 2:42 PM.
Tags
None
Referenced Files
F3538584: D12166.diff
Wed, Dec 25, 11:08 PM
Unknown Object (File)
Mon, Dec 16, 5:49 PM
Unknown Object (File)
Mon, Dec 16, 5:49 PM
Unknown Object (File)
Mon, Dec 16, 5:49 PM
Unknown Object (File)
Mon, Dec 16, 5:49 PM
Unknown Object (File)
Mon, Dec 16, 5:49 PM
Unknown Object (File)
Nov 9 2024, 3:34 PM
Unknown Object (File)
Nov 9 2024, 12:15 PM
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
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/chat/chat-thread-list-search.react.js
48

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

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