Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search users by username first #2764

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

benmanns
Copy link
Contributor

@benmanns benmanns commented Aug 4, 2024

I ran into an issue where users with short usernames sometimes don't get returned from the search-users API in the first few rows. This is a problem, as the @ dialog in the comment box uses search-users with a limit of 6, so there is sometimes no way to mention a user, even with an exact username match. This change adds a query to search for an exact match username and present that as the first result, if present.

Note: I've not gotten manifold running locally, so I haven't been able to test this.

I ran into an issue where users with short usernames sometimes don't get returned from the search-users API in the first few rows. This is a problem, as the @ dialog in the comment box uses search-users with a limit of 6, so there is sometimes no way to mention a user, even with an exact username match. This change adds a query to search for an exact match username and present that as the first result, if present.
Copy link

vercel bot commented Aug 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
dev ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2024 4:38pm
docs ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2024 4:38pm
prod ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2024 4:38pm

Copy link

vercel bot commented Aug 4, 2024

@benmanns is attempting to deploy a commit to the Manifold Markets Team on Vercel.

A member of the Team first needs to authorize it.

@IanPhilips
Copy link
Collaborator

Hey thanks for submitting this! Could you share a username this works for that our current search doesn't work for?

@benmanns
Copy link
Contributor Author

benmanns commented Aug 7, 2024

I was trying to tag Vo username @d on this market.

image

image

@IanPhilips
Copy link
Collaborator

It's a bit more complicated because if I type zvi it should match ZviMowshowitz and not 'zvi', so not sure how to handle that yet

@jahooma
Copy link
Collaborator

jahooma commented Aug 9, 2024

I support the exact match use case, even with the downside that it might not surface the most popular person.

One solution would be to put the exact match after the first other result!

@benmanns
Copy link
Contributor Author

Yeah, the problem I was trying to fix was mostly that it's currently impossible to tag @d, even with an exact name match, and there's not really anything to do to get more specific. I do think there could be more work put into the scoring of results, but as someone who has worked on search scoring, you can spend a decade on it and still not feel done.

For the ZviMowshowitz example, even if someone registered Z, Zv, Zvi, ZviM, ZviMo, ZviMow, ... you could still tag the full username if you typed the whole thing out. It's an interesting problem, though.

Some other example sites, on X if you start typing @e, the first result is @elonmusk, even though @e exists. Same for the rest of the prefixes (@e through @elonmus).

image

However, I would also note that if I just left it as-is, the tweet would mention @e, which is different from Manifold where you have to select from the dropdown to trigger a mention. Perhaps it would be a better solution to tag the exact match if it exists on typing @..., even without selecting from the suggestions.

@IanPhilips
Copy link
Collaborator

I like the suggestion of making it auto-mention the exact match if no other is selected!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants