Archipelago
Archipelago copied to clipboard
WebHost: Filter the multitracker summary row using applied search filter
What is this fixing or adding?
The summary row added in #1965 always shows the status of the entire multiworld, regardless of any filter settings applied. This post in #general-suggestions https://discord.com/channels/731205301247803413/1231050777121001482 suggested that if a search filter is applied, the search filter should also apply to the summary. That way it would be easy for a player to easily see the percentage of their own checks they've completed across the multiworld. I agree with that suggestion, so here's an implementation.
Note that with this change the multiTracker.html template doesn't really need to populate the footer at all. And thus we can probably remove a view variables from render_generic_multiworld_tracker's call to render_template(). I did not make that part of this PR but am happy to do so if that is desired.
How was this tested?
I was a bit concerned about performance since this is now calculating it from the data in the table, so I also tested with a 2000-player multi-world (thank you Factorio for being fast to generate). The footerCallback took 4ms-6ms to run with the whole table. After searching for Player100 which gave me the 12 playes Player100 and Player1000-1009 it took 0.4ms.
I also tested it by just playing around with the search on a copy of the db of a multiworld on my webhost I have in progress, to make sure everything looked right. Also made sure to test empty result as well as ensure things kept working after update was called.