shell: Hide the visible dialog when navigating

Fixes #822