Simplify "hide skipped rules" implementation #658
Merged
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.
It's always bothered me that the "hide skipped rules" toggle had to remove elements from the DOM to hide them so that the
:last-child
selector would work. This was fine when the toggle was off by default, but became a problem once we switched it to default on: skipped rules appear and then suddenly disappear once the DOM loads and the script runs.The new version does all of the hiding with CSS rules, so the JS toggle only flips an attribute value instead adding or removing nodes. While this needed a bit of server support in the template, it should make the loading experience better and the toggle faster with large policies. And because the tree is otherwise static, there's no disadvantage to attaching extra information for styling in the template.
This is going to conflict with #656, but I'll fix whichever one merges second.