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)
Thu, Oct 10, 10:25 PM
Unknown Object (File)
Thu, Oct 10, 10:25 PM
Unknown Object (File)
Thu, Oct 10, 10:25 PM
Unknown Object (File)
Thu, Oct 10, 10:25 PM
Unknown Object (File)
Thu, Oct 10, 10:24 PM
Unknown Object (File)
Sep 9 2024, 9:29 AM
Unknown Object (File)
Sep 9 2024, 9:28 AM
Unknown Object (File)
Sep 9 2024, 9:28 AM
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
Branch
ashoat/threadpickermodal
Lint
No Lint Coverage
Unit
No Test Coverage

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.Jun 3 2024, 12:55 AM

Move Set creation into reorderThreadSearchResults

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