Edit Review Improvements/New filters for edit review/How to implement a filter

Product and design


There are first some product and design questions to answer:


 * Purpose and effect of the filter - Consider the user experience and use cases. This will both help you decide what the filter does, and how to describe it.ChangesListStringOptionsFilterGroup or a ChangesListBooleanFilterGroup. is best if you have many options, they are not naturally expressed as hide-based (e.g. hideanons) filters, and/or they are not full coverage (full coverage means checking all boxes in a group is the same as checking no boxes). is best for existing hide-based filters (like ), or filters that can be expressed simply using that idea.

If you are creating a new group, create an object for that. The  is an internal identifier. However, for, it's also used as the URL parameter. Either (see above):

or:

Either way, you then register the group with:

You can optionally include information for a What's This? popup ( ,  ,  , and   - see the thumb image). If you need to access an existing group (e.g. defined by core), instead use:

Filters
Regardless of whether you created a group, you will want to add filters to new or existing groups.

If all the filters belong to a group you're creating, you should put the definitions in the  parameter of the group constructor; this will automatically order them for you. To add filters to pre-existing groups, follow the below instructions.

There are currently two types of filter, ChangesListBooleanFilter and ChangesListStringOptionsFilter. They each go only in the group with the matching type. The 'name' is used as an identifier, which also appears in the URL. Use:

or:

You do not have to do anything after constructing the filter.