I performed a couple of testing sessions and observed some new users using my test anvil app. Overall it went really well, but one part that REALLY bit them was the browser back/forward buttons
Here’s the typical situation. The user:
Does something on the current screen
Clicks on a navigation link on the left
Performs the action on the new screen
Hits the browser back button
They end up with a blank page and very confused and don’t know what they did wrong.
This happened again and again, and i’m concerned its going to be a significant usability problem.
Oh and one quick addition - this really was obvious on mac/mobile, where gesture navigation was normal. They went back one in history without even really thinking (two finger swipe right) and it confused them very quickly.
Looks like i might be doing some AngularJS style routing with hashes! That’ll be a fun challenge, typing navigation and buttons together and routes, and python.
Routing is something we definitely want to implement, for all these reasons! This is where I would like to plug our support plans - these give you the ability to “put your thumb on the scale” and prioritise certain features on our roadmap. So if you want to accelerate the arrival of a full routing system in Anvil, please do drop us a line at support@anvil.works.
One thing you could do here (if the aim is to prevent a user pushing the back button and unwittingly leaving the app) is to use the onbeforeunload function.
Linked topic with related conversation and info
Putting the function in your native libraries will give a warning when your user is about to navigate away from the app. You’ve probably seen it on the web generally when using other websites.
I highly encourage you to put the work into learning the hash routing dependency. It isn’t as bad as it looks at first, and it totally transforms both the user experience and how you end up writing your apps.