Page MenuHomePhabricator

[native] Lift `openedSwipeableID`/`numItemsToDisplay` state to `ConnectedChatThreadList`
ClosedPublic

Authored by atul on Sep 11 2023, 1:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Sep 28, 10:16 PM
Unknown Object (File)
Sat, Sep 28, 10:16 PM
Unknown Object (File)
Sat, Sep 28, 10:16 PM
Unknown Object (File)
Sat, Sep 28, 10:16 PM
Unknown Object (File)
Sat, Sep 28, 10:14 PM
Unknown Object (File)
Sat, Sep 28, 9:57 PM
Unknown Object (File)
Sep 1 2024, 5:02 AM
Unknown Object (File)
Aug 28 2024, 7:41 AM
Subscribers

Details

Summary

(I initially had a huge diff that converted ChatThreadList to a functional component and added various memoizations. However, I realized that diff would be pretty difficult to review so I'm breaking down the refactor into hopefully easier to review pieces.)

This diff is just one step in the process of converting ChatThreadList into a functional component. When this work is done, we will be able to avoid a lot of re-rendering and hopefully improve performance quite a bit.

In subsequent diffs will

  1. Lift up callbacks related to search
  2. Lift up Reanimated Nodes
  3. Lift up "search-related" JSX
  4. etc.. continue turning ChatThreadList into a functional component so we can more precisely memoize things, particularly ChatThreadListItems.

Depends on D9131

Test Plan

Search experience continues to work as expected. Can search for users/threads/etc.

Diff Detail

Repository
rCOMM Comm
Branch
arcpatch-D9132 (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul requested review of this revision.Sep 11 2023, 1:37 PM
ginsu requested changes to this revision.Sep 11 2023, 4:12 PM

Might be overthinking this, so feel free to push back, but I think we can still use prevState with the useState hook

native/chat/chat-thread-list.react.js
443 ↗(On Diff #30940)

I am concerned that by removing the reference to prevState we may set the incorrect value...

https://chat.openai.com/share/63997613-ff36-46e9-ad87-03cc2aa348ce

This revision now requires changes to proceed.Sep 11 2023, 4:12 PM

thanks for fixing this!

This revision is now accepted and ready to land.Sep 12 2023, 1:45 PM
This revision was landed with ongoing or failed builds.Sep 12 2023, 3:43 PM
This revision was automatically updated to reflect the committed changes.