nos icon indicating copy to clipboard operation
nos copied to clipboard

Search relays during mentions autocomplete

Open pelumy opened this issue 1 year ago • 1 comments

Issues covered

#1560

Description

This PR includes functionality for autocomplete to also search the query in the user's relay list . It contains the following changes:

  • Refactors AuthorListView to use SearchController.

How to test

  1. Build the code.
  2. Tap post button at the bottom of the screen.
  3. Tap the @ button or type "@" into the textfield.
  4. Type in the search bar.
  5. Please check that Authors who weren't in Core Data before the AuthorListView opened are showing up in the list of results.

Screenshots/Video

Before:

https://github.com/user-attachments/assets/a31797af-91f7-45e7-914a-d9fa8a4bb2dd

After:

https://github.com/user-attachments/assets/a48e355f-84a7-401e-bb73-d3d2ed9acd3d

pelumy avatar Oct 04 '24 19:10 pelumy

👀

joshuatbrown avatar Oct 07 '24 17:10 joshuatbrown

👀

mplorentz avatar Oct 08 '24 14:10 mplorentz

Thank you for the suggestions @mplorentz and thanks for pair programming with me on this @joshuatbrown

pelumy avatar Oct 08 '24 18:10 pelumy

After refactoring the AuthorListView based on @mplorentz detailed suggestion, it works perfectly now. @joshuatbrown, also suggested making the keyboard button show "search" instead of "return"; and also searching the query when the user clicks this button.

This has also been added by changing the return button's label in the "SearchBar" view.

pelumy avatar Oct 08 '24 18:10 pelumy

👀

joshuatbrown avatar Oct 08 '24 20:10 joshuatbrown

This looks great! One thing we discussed but I'm not sure how to handle: changing the SearchController's analytics tracking. It currently tracks "Discover Search Started", for example, when we're searching on the mentions screen. @mplorentz do you have a good sense of what we should track here? I'm assuming we want a new event along the lines of "Mentions Search Started", but I'm not sure if we also want an event comparable to the "Discover Search Displayed Author". I suppose so? Maybe call it "Mentions Search Selected Author"?

Aaah, thanks for bringing this up again. I totally forgot. I think Selected sounds like the user has selected an option. Looks like Linda created a new ticket for tracking mentions. But I feel we definitely need to differentiate the "Discover Search started" from the "Mentions search started" in this PR.

pelumy avatar Oct 08 '24 21:10 pelumy

Oh good catch on the tracking. I agree that we shouldn't merge this if it's firing Discover Search Started from the mentions view, because that could mess up our production data.

Maybe we make a new enum called SearchLocation or something? And pass it into SearchController.init and then the Search controller can fire the right events?

Duplicating the existing events but replacing "Discover" with "Mentions" sounds good to me.

mplorentz avatar Oct 09 '24 18:10 mplorentz

👀

joshuatbrown avatar Oct 10 '24 15:10 joshuatbrown