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

Add syntax highlighting to searches #498

Draft
wants to merge 8 commits into
base: 1.19.3
Choose a base branch
from

Conversation

haykam821
Copy link
Contributor

@haykam821 haykam821 commented Nov 5, 2022

This pull request refactors the search functionality to allow for more dynamic and highlighted searches. In particular, keywords must now be prefixed with @, and complete keywords will be colored to match their badge if they are associated with one.

image

In the future, these changes can be used to make various other improvements possible, including:

  • Negating search terms (such as -@library to match non-library mod)
  • Combining content search terms (such as "Mod Menu" to match mod menu but not mod or menu)
  • Searching specific fields (such as @author:Prospector to match mods authored by Prospector)
  • Suggesting search terms

@haykam821 haykam821 added the enhancement A new feature or improvement label Nov 5, 2022
@jackassmc
Copy link
Member

This is really cool! I'm worried about the change of search behavior though. We need to teach users to prepend the @ and that they now must use the full keywords.

@haykam821
Copy link
Contributor Author

Ideally, the syntax highlighting would be supplanted by suggestions akin to commands. The library button could also just add or remove @library from the search terms.

I think this change actually improves discovery overall. Previously, adding a filter was easy to do accidentally and could even hide mods that would otherwise match the search terms. Now, a correct search term is prefixed by the @ symbol and is highlighted to indicate to the user that it does something.

In the end, search terms are a power user tool and I think that after the proposed changes, their discoverability will be suitable.

@Prospector Prospector marked this pull request as draft January 19, 2023 05:25
@Prospector Prospector marked this pull request as ready for review February 18, 2023 09:31
@Sollace
Copy link

Sollace commented Mar 9, 2024

This is a really cool feature!

I have one question though: Is the usage of @ neccessary, or could that be changed to something more familiar like #?

@Jab125
Copy link
Contributor

Jab125 commented Jun 26, 2024

This is a really cool feature!

I have one question though: Is the usage of @ neccessary, or could that be changed to something more familiar like #?

It's like @s in commands

@Sollace
Copy link

Sollace commented Jun 26, 2024

This is a really cool feature!
I have one question though: Is the usage of @ neccessary, or could that be changed to something more familiar like #?

It's like @s in commands

Selectors in a command aren't really the same as tags in a search though. I'm looking at this from the perspective of someone who's used to search engines like twitter or mastodon where terms/categories/concepts use #tags and individuals use @Handles .

Using command syntax for something that's not a command, to filter for things that are not selectors, is just going to confuse matters.

If you really want to lean into the command-like syntax, then you shouldn't have searches like @library @author:Prospector. It should instead be @library[author="Prospector"].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants