Page MenuHomePhabricator

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

Authored by ashoat on May 30 2024, 9:02 AM.
Tags
None
Referenced Files
F3391435: D12251.diff
Sat, Nov 30, 3:59 AM
Unknown Object (File)
Sat, Nov 23, 4:15 AM
Unknown Object (File)
Tue, Nov 12, 3:51 AM
Unknown Object (File)
Tue, Nov 12, 3:40 AM
Unknown Object (File)
Tue, Nov 12, 3:23 AM
Unknown Object (File)
Mon, Nov 11, 11:51 PM
Unknown Object (File)
Mon, Nov 11, 4:54 PM
Unknown Object (File)
Oct 10 2024, 10:25 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.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.