Facepunch / sbox-issues

173 stars 11 forks source link

API Search is not including everything as it should #5573

Open CarsonKompon opened 3 months ago

CarsonKompon commented 3 months ago

Describe the bug

I was searching for the ShowIf attribute since I knew it existed but forgot the name. I searched for "attribute" and couldn't find it anywhere. I was afraid it was removed, but after searching the discord a bunch i found that it was ShowIfAttribute. I searched for it directly by name and was able to find it instantly. I then searched for "attribute" again and was baffled to see it wasn't there.

At first I thought this was because searching for "attribute" would only show me children of System.Attribute (which has "Attribute" by itself) or classes that have the word "attribute" in the description (since that would match the whole-word by itself).

It seems that this assumption is incorrect since ActionNodeAttribute shows up in the search for "attribute" even though it doesn't have the whole-word "attribute" by itself anywhere in it's class, parent class, nor it's description (it doesn't have a description).

To Reproduce

  1. Search for "attribute" (https://asset.party/api/where/is/attribute)
  2. See that you will get many results, but ShowIfAttribute and HideIfAttribute are not included (amongst others potentially)
  3. Search for "showif" or "hideif" (https://asset.party/api/where/is/showif)
  4. See that they do in-fact exist

Expected behavior

It should show anything in the api that contains the string "attribute" (whole-word and otherwise) if I'm searching for "attribute".

Media/Files

No response

Additional context

No response

MD485 commented 3 months ago

This is why I never use the search and just Ctrl+F on Everything, I'm so glad that exists.

This isn't strictly a bug, it's working as intended, the results you get from Types in the search is an alphabetised list truncated to the first 20 results.

I do agree with you though, this is confusing, and often unhelpful behaviour.

Types seems to be limited to 20 while Members seems to be limited to 50.

I do kinda empathise with the design decision in some respects though, while the results for Types will never be longer than just looking at Everything, the results for Members will often be, and I imagine their intent was to let you get to what you were searching for faster, as opposed to giving you the ability to find it from any applicable keyword.

A solution may need to be slightly more nuanced than always showing all results.

Edit1: Maybe a "Load next 20 results" button? If you have to do that 20+ times, then maybe your search is too vague.

Edit2: Great minds think alike.

CarsonKompon commented 3 months ago

Maybe the solution instead is to have a "Show more" button under the Types and Members sections if they have more than 20 or 50 respectively