WebHost: Filter the multitracker summary row using applied search filter #3257
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 torender_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.
If this makes graphical changes, please attach screenshots.