Lua-Modules icon indicating copy to clipboard operation
Lua-Modules copied to clipboard

feat(filterButtons): add filterable item counting

Open iMarbot opened this issue 1 year ago • 2 comments

Summary

Introducing ability to count filterable items in filter groups. They can either be counted in a hidable group, or individually.

Also introduced ability to set multiple values to filter specific items (where all values must be enable via filters to show the item).

All filters active Some filter disabled
image image
Example code from above
image
Example page link: https://liquipedia.net/counterstrike/User:IMarbot/Majors/Player_Database

How did you test this change?

Tested with dev tools and via userscripts by myself and extensively by @CarbonDogma

Also tested existing buttons for tournaments list here and they appear to show no regression in behaviour: https://liquipedia.net/counterstrike/User:IMarbot/Sandbox_6

(userscript and above example links use data-filter-dev property on objects to avoid clashes with existing filtering code)

iMarbot avatar Apr 21 '25 18:04 iMarbot

I think this is going to break, or at least be confusing with, the (weird) region mapping stuff in use on e.g. Valorant main page, as they are CSV category values

mbergen avatar Apr 21 '25 18:04 mbergen

I think this is going to break the (weird) region mapping stuff in use on e.g. Valorant main page, as they are CSV category values

The data-filter-category field is not split by commas, only the new data-filter-categories field, so it shouldn't make a difference I think.

iMarbot avatar Apr 21 '25 18:04 iMarbot