Page MenuHomePhabricator

[web] Use message search context in message search modal
ClosedPublic

Authored by inka on Jun 21 2023, 5:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 5:10 PM
Unknown Object (File)
Sat, Dec 14, 5:10 PM
Unknown Object (File)
Sat, Dec 14, 5:10 PM
Unknown Object (File)
Sat, Dec 14, 5:10 PM
Unknown Object (File)
Sat, Dec 14, 5:10 PM
Unknown Object (File)
Sat, Dec 14, 5:10 PM
Unknown Object (File)
Sat, Dec 14, 5:09 PM
Unknown Object (File)
Sat, Dec 14, 5:04 PM
Subscribers

Details

Summary
Test Plan

(for the purpose of recording this I bound the pinned messages bar to message search modal)

Diff Detail

Repository
rCOMM Comm
Branch
inka/search_web
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

inka edited the test plan for this revision. (Show Details)
inka requested review of this revision.Jun 21 2023, 5:55 AM

Not sure what the status of the "Search" button is, is the plan for it to be implemented in other search modals too, or is it just a one-off? Do you think it would make sense to add it (as an option) to the SearchModal?

web/modals/search/message-search-modal.react.js
212

Couldn't we pass it directly?

Also, the query won't be cleared if you manually remove text in the textbox (compared to clicking the X button) which I think I would find confusing.

Not sure what the status of the "Search" button is, is the plan for it to be implemented in other search modals too, or is it just a one-off? Do you think it would make sense to add it (as an option) to the SearchModal?

Initially I implemented it like this, but because we want to remember the query in the context, using SearchModal made the code so complex, it was unreasonable. This modal is different from other search modals in that it fetches information from the server, not from redux, and it stores some information in the context. So I think it is reasonable that it requires a different implementation.
The search button is needed for this reason - that we are fetching results from the server, and that our message search is a fulltext search (meaning we cannot find words by their prefix or other part), which is not the case with our other searches

Also, the query won't be cleared if you manually remove text in the textbox (compared to clicking the X button) which I think I would find confusing.

I will bring this up with Ted, but it does make sense to me personally

inka edited the summary of this revision. (Show Details)

Address review

Makes sense, thanks for explaining

web/modals/search/message-search-modal.react.js
218 ↗(On Diff #28038)

I think that can be inlined

This revision is now accepted and ready to land.Jun 23 2023, 3:37 AM