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 support for matching full terms at song select using suffixed ! #24058

Merged
merged 7 commits into from
Jun 28, 2023

Conversation

peppy
Copy link
Member

@peppy peppy commented Jun 27, 2023

Given the following beatmap artists:

  • artist
  • The artist name
  • The artistic

You now have three methods of searching:

  • artist will match all three (term can appear anywhere, even inside a word)
  • "artist" will match the first two (term must be isolated in a phrase, not inside a word)
  • "artist"! will only match the first (full term must match)

The ! suffix is non-standard, but feels like it will work well and also be easy for users to remember. It also has the advantage that you can add it without moving the cursor backwards in the string (which... is not currently possible at song select).

Tested to work with artist="test"! style searches too.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jun 27, 2023
@bdach
Copy link
Collaborator

bdach commented Jun 27, 2023

Have pushed some fixups:

  • Renamed MatchMode.None to MatchMode.Substring (e3d97b3) - felt pretty weird to have a match mode of "none" that... does something
  • Fixed a case wherein the .Trim('!', '\"') call could eat characters from inside the quotes (bf99fc6), with test coverage (aba380b) - maybe feels edgecasey, but a very real one to hit in specific circumstances ("circles!"!, anyone?)
  • Slightly expanded test coverage to include case insensitivity (bca1a91)

Please check before merging.

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

Successfully merging this pull request may close these issues.

2 participants