RCFilters: Create one single source of truth for item display
Synchronize the search input, filter view and all view selection into
a single source of truth through the model.
- Stop using OO.ui.MenuSelectWidget's internal filtering logic, and
use our own filtering logic in the model instead.
- Add a concept of 'search' to the model, that is synchronized with
the current search term of the systme. The search dictates the view
and the visible items in the filters.
-- Whenever the search changes for whatever reason,
the model automatically updates the visibility of all items and
groups in the filter list.
-- This means that after changing view or search, the widgets can
always trust that they have the most updated visible item list
to scroll to or select.
- Make the view model's findMatches
as the ultimate source of truth as to what should be visible.
The items are now **always** all included in the menu, but they
change their visibility according to the logic in the findMatches.
If there is a search term, the function will account for that and
the selected view, so we can be sure that search results also
change between changing views.
This allows us to simplify the operation of selecting a tag, where
we know that the order of operation is bound to switching the views,
that will also show us the relevant results. We can bind to the display
event and properly select -- and scroll to -- the item.
Bug: T182720
Bug: T178540
Change-Id: If575f348705d863b9d68d19761ded55a4d453550