In short, there were some filtering logic both in view, and some in controller. Since count was only done in controller things got out of sync. Moved all filtering to controller (which should be fine unless some other controller turns out to also be using this view for output 🤔 ), and gathered some duplicated code.
There are still some existing controller filtering + what was done in view, so probably needs another touchup later to merge those as well. But count should now be correct based on number of documents visible to view.
Fixes: https://github.com/gathering/wannabe/issues/50
In short, there were some filtering logic both in view, and some in controller. Since count was only done in controller things got out of sync. Moved all filtering to controller (which should be fine unless some other controller turns out to also be using this view for output 🤔 ), and gathered some duplicated code.
There are still some existing controller filtering + what was done in view, so probably needs another touchup later to merge those as well. But count should now be correct based on number of documents visible to view.