Allow `not` filtering in issue/mr/epic list views and boards
Problem
Finding and filtering issues, merge requests, and epics can be difficult, especially when users want to exclude certain results. GitLab does not currently support excluding results from filtering, only implicit AND operations.
For example, if a user had 3 exclusive labels: bug, security, feature and were using milestones, it is impossible to filter by milestone and then find all issues in the milestone that are labeled security or feature.
Proposal
- Search for issues, merge requests, and epics in the search bar using a not operator.
- Same for search bar in boards
- Currently, all search filters/attributes are implicitly AND-ed together. This feature does not change that. It only adds a
not
condition to individual filters. - The
not
condition applies to labels, authors, assignees, and milestones. - The
not
condition also includes "absence":-
not(assignee: @ebrinkman)
includes unassigned -
not(label: ~Discussion)
includes unlabeled -
not(milestone: %"9.1")
includes no milestone
-
Example
author: @ebrinkman assignee: @ebrinkman assignee: @smcgivern not(assignee: @jschatz1) label: ~Discussion not(milestone: %"9.3")
This means find all issues that:
- Are authored by @ebrinkman
- AND have @ebrinkman as an assignee
- AND have @smcgivern as an assignee
- AND do not have @jschatz1 as an assignee
- AND has the label gitlab-ce~874211
- AND does not have milestone gitlab-ce%39
Tier
See parent epic for tier explanation &291
Solution
Interaction and design
Example of interactions (not styled) notoperator3
Requirements
All
- Remove the item
Press enter or click to search
from all dropdowns. - The first item in the dropdown list is in a focus state by default, user can press or type [enter/return] to select it. This allows us to cut down on keystrokes for users and preselects smart defaults.
Field (ie: milestone)
Interactions are mostly the same except:
- If possible: User can type value without colon(:) , ie if a user types milestone [space] milestone will tokenize. Can we just assume that if a user types one of the known fields that they are attending to apply it in the filter bar and act as such?
- If user has no value (ie: %13.1) defined, they may still click into the field token to trigger the dropdown (similar to if you click on a value token and it turns to text and triggers the dropdown options) and change the field. If there is a value defined the behavior is as it currently is (can’t edit, only delete).
- The first item in the dropdown list is in a focus state by default, user can press or type [enter/return] to select it.
- Remove hint/help text after the field (ie: @ assignee ), remove the colon if we can allow users to type fields without milestones. If we can not allow this, keep the colon here.
Without colon (preferred) | With colon |
---|---|
Same as before:
- User can type [enter/return] on any focused value and it will tokenize.
Operator (ie: =)
Once a valid value has been applied- a dropdown with operator options appears.
- Dropdown has two options:
- Dropdown option 1:
=
with the hint text (Is) - Dropdown option 2:
!=
with the hint text (Is not)
Operator dropdown |
---|
-
=
(is) is in a focus state by default, user can press or type [enter/return] to select it. - User can type
=
, or!=
[space] and the operator will tokenize - User can type [enter/return] when an operator is focused and it will tokenize
- User can click
=
or!=
to select and the operator will tokenize - The new operator token is similar in design and interaction to the
value-container
token except:- No border radius
- No
remove-token
- User can click into applied operator to re-trigger dropdown with options
Value (ie: 12.3)
Interactions are mostly unchanged except:
- If a user starts typing something that doesn’t match the hint fields (ie: none, any), dismiss those fields from the dropdown so that the fields matching what the user is typing appear first in the dropdown. This allows a user to quickly apply what is intended.
- If a user types in 12.1 for example, can we assume they mean %12.1 and apply %12.1 (or ~"", @, etc)? This allows users that are not experts in our syntax to easily use the search.
- The first item in the dropdown list is in a focus state by default, user can press or type [enter/return] to select it.