simplifying hiding/showing the panel, and handling it being hidden by losing focus
few tweaks and refactorings found as I wrote the latest tutorial article