As we apply the [[ https://www.mediawiki.org/wiki/Edit_Review_Improvements/Filters_for_Special:Recent_Changes | new filtering system ]] to more pages such as the Watchlist and User Contributions (T145155) we may want to better integrate some of the more complex filters such as filtering by a specific user, edit tags and namespaces.
The complexity of those filters is due to a combination of:
- **A search space too large.** Listing all users in the single list is not feasible. Even a shorter list such as edit tags or namespaces could unbalance the original filter list if they were aded just as another section.
- **Additional options are required.** Namespaces present some particular relations between the options. Editing tags cannot be presented inside a single group if the expectation is for them to be combined with an AND.
In this context, we probably should aim for a solution that:
- Integrates with the current system to avoid unnecessary duplication.
- Provides specific aids for the particular needs of each of those filters.
- Is scalable: allows to be expanded with more similar filters in the future.
# Proposed solution
We can apply the following ideas to support each of the complex filters:
- **A specific entry point is provided for users to add the new filters.** For example, there will be an "add user" action to add a new filter to view contributions of a given user. Clicking on it will lead you to the process of adding such filter.
- **The active filter area will be reused.** Complex filters will appear as tags when they are active in the same way as the regular filters do.
- **The search bar will be reused with support for special prefixes.** Users can search in the same search bar for regular and complex filters. However, complex filters require a specific prefix: @ for users, # for tags and : for namespaces. These prefixes can be added manually by the users or as a result of clicking on the specific entry points. The entry points will include tooltips where the prefixes will be mentioned, to help establish the connection.
- **The filter panel will transform to accommodate the particular needs.** For example when the user search for an edit tag (either by typing "#" in the search bar or clicking on the "add tag" button), a specific panel showing the list of tags will be shown.
- **The filter panel will include a footer with access to the specialised filters.** In addition to the dedicated entry points, at the end of the list of regular filters, access to additional filters will be provided as a continuation for the user.
Some mockups to illustrate the idea:
**Filtering for specific users**
|{F7608415}|{F7608419}|{F7608427}|{F7608430}|{F7608434}|
|An entry point is provided to add specific users| A specific panel for user addition shows relevant results to facilitate the selection (e.g., users the current user interacted with recently).| Typing the user can look for a specific user. | Filtering for a specific user adds the corresponding tag with the rest.| When closing the panel, prefixes are cleared for the regular panel to be shown by default the next time.|
**Filtering for edit tags**
|{F7607972}| {F7607981}| {F7607992}|{F7607995}|
| The edit tags can be added by selecting the "add tag" action, or starting a search with "#" | The list of tags are shown in the panel. | Selecting tags shows edits having all of them (they are AND-ed) | When more than one edit tag is selected for filtering, a message is shown at the panel to communicate how tags are combined.|
**Filtering for namespaces**
|{F7608134}|{F7608136}|{F7751161}|{F7751163}|
|An entry point is provided to limit the namespace for which contributions are displayed. | Namespaces are grouped by their associated pairs. Selecting multiple namespaces will provide the results in any of them (since an edit can only be part of one namespace). | Additional "exclude" options are provided to facilitate the excluding a namespace without having to add all other namespaces (crowding the list of tags).| When a namespace is excluded, filters in the list look greyed-out and show an "excluded" label, their tag also includes an indicator (notice the "not") to communicate that the criteria is reversed.|
**Additional entry point at the filter panel**
{F7667456}
At the end of the filter panel, the advanced filters can be provided as an option to find more options for those interested in additional filters. It cannot be considered as a main entry point (since it is at the end of a long list), but can be useful for those exploring all existing options.