A similar feature existed in the now deprecated list view controls widget and we used it for a dropdown filter on a Task overview.
This kind of dropdown filter allows to add arbitrary options and each option is linked to an XPath Constrained.
In that sample case you select beween "Assigned to Me", "Assigned to My Group" in a dropdown and configuring this like
"Assigned to Me" : [Task_User='[%CurrentUser%]']
"Assigned to My Group" : [Task_Group/Group/User_Group='[%CurrentUser%]']
This kind of widget would provide much more flexible filter options in a datagrid (also gallery).
Even more, if you can use data from context objects in the filters.