Use a new Patterns build.
Load patterns consistently.
Use the patterns tooltips.
Delete old tooltips
Use depends pattern.
Use legend transform from patterns.
Use patterns placeholder

And drop unused selected class handling.
Use autofocus patterns.