Page MenuHomePhabricator

[lib][native][web] Reorder results in ThreadPickerModal
ClosedPublic

Authored by ashoat on May 30 2024, 9:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 29, 4:48 PM
Unknown Object (File)
Wed, Jun 19, 3:54 PM
Unknown Object (File)
Sun, Jun 16, 5:32 PM
Unknown Object (File)
Thu, Jun 13, 2:14 PM
Unknown Object (File)
Mon, Jun 10, 1:35 AM
Unknown Object (File)
Sun, Jun 9, 11:13 PM
Unknown Object (File)
Sun, Jun 9, 10:00 PM
Unknown Object (File)
Sun, Jun 9, 8:14 PM
Subscribers

Details

Summary

For the main thread list search, we rely on the reordering behavior of getThreadListSearchResults to surface the most relevant results first (private and personal threads) when a user searches for a username.

This diff introduces similar functionality for ThreadPickerModal on both native and web. I considered trying to extract the reordering logic, but since it operates on ChatThreadItem and I needed to operate on ThreadInfo, this would have been messy. Instead I opted to duplicate it.

Note that on native, ThreadList is used in only two places. One of them is ThreadPickerModal, and the other is ComposeSubchannel, which doesn't use the searching functionality at all.

Depends on D12250

Test Plan

I tested by connecting my local simulator to the prod keyserver, logging in as a test user, and confirming that when I searched for "ashoat" in the ThreadPickerModal, the results were reordered so that the test user's PERSONAL thread with me appeared first

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka added inline comments.
web/modals/threads/thread-picker-modal.react.js
80 ↗(On Diff #40780)

I think it would have been cleaner if we were passing the array to reorderThreadSearchResults, and creating the set there

This revision is now accepted and ready to land.Mon, Jun 3, 12:55 AM

Move Set creation into reorderThreadSearchResults

This revision was landed with ongoing or failed builds.Mon, Jun 3, 8:27 AM
This revision was automatically updated to reflect the committed changes.