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 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.
Some mockups to illustrate the idea:
**Filtering for specific users**
|{F6331265}|{F6331218}|{F6331292}|{F6331234}|{F6331237}|
|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**
|{F6331762}|{F6331770}|{F6331779}|{F6331794}|
|An entry point is provided to limit the namespace for which contributions are displayed. | Namespaces are grouped by their associated pairs. This may be specially relevant if users cannot chose options in more than one group at a time (more on this below). | Additional options may be included in the selection process to exclude an option.|
For namespaces we need to investigate with more detail what the technology allows. Currently users can (a) select one namespace, (b) select a pair of namespaces (with the "select associated namespace" option), (c) exclude a specific namespace (with the "invert selection" option), or (d) exclude a pair of namespaces (with both "associated" and "invert" options selected). Knowing what is possible (like selecting multiple namespaces) will help us decide which is the best way to expose those options.