The latest update is another full rewrite of the filtering algorithm along with how pane items are generated. The previously new algorithm was not able to support a key text filtering feature: an item matching if the filter text is contained by the combination of an item’s full hierarchy. For example, these items should match on a filter for “a b c”
Similar to that it was not handling hierarchy around mirrors correctly. An item’s matchingnessitude comes from its whole hierarchy - a combination of itself, its parents, and its children. An item is considered matched if its parent matches, unless it itself specifically does not match. Or a parent is considered matched if any descendant matches. But when computing the parent matches for mirror items it was traversing up the target item’s tree instead of the mirror item. Part of the problem is that filtering was originally designed to compute matches by item, but with mirrors an item can match in one area of the hierarchy but not in another, because their different ancestors cause them to match differently.
So I rewrote the whole thing from scratch in a new way that takes an item’s full hierarchy into account (without needing to test each one more than once) to fix both of those issues. It turned out to be even shorter and less complex, and even removed a step of the process of generating pane items:
- Filter items to find matches
- Scan through all items and check matches to build list of pane items (removed, now uses results of #1)
- Iterate pane items and group into blocks
- Sort blocks and generate display elements
So it should also be a bit faster now with that step removed 🙂.
This may additionally fix some of the bugs reported in this thread as well as in https://forum.legendapp.com/d/125-mirrors-bug-mega-compilation-from-slack. I will go back and try to reproduce the previously reported issues but if you can re-test the bugs you found and let me know their status that would help a lot!
Sorry for the flurry of changes around filtering recently! I’m trying to really get this right and lock down filtering as perfectly correct and stable. It’s extremely complex with how it deals with hierarchy, and mirrors throw a big wrench in the hierarchy 😆. I’ve built up a big suite of automated tests so in addition to lots of manual testing I’m pretty confident it’s correct now. But please let me know if you see any more issues (including screenshots is very helpful) and I’ll add more tests and fix them 👍️