Actually, in double-checking on that I found one case where it's added even when the panel is closed (which makes the check important since it needs to no-op then) and one cases where it's added _multiple_ times (which we should avoid because it leads to over-computation, similar to #6923.  I'll add another commit that fixes those issues.