If the user has some changes in progress in the sidebar and tries to exit (leave Phoenix, close sidebar, open sidebar for a different file, move to different route) he needs to be notified about pending changes and offered to stop stay and finish them or discard them.