Okay, here is my use case. Assume we have two menuitems in the navigation panel A and B. When the user clicks on either A or B, they have a 'stack progression' consisting of other panels ( A1 , A2 , A3 ) , (B1 -> B2 -> B3). A more concrete example is where the user clicks on A and is taken to view A1 which is a list. They select an item in A1 and is taken to another list A2 and after selecting something in A2 they are taken to an inspection/view/more info panel A3.
Now that the base has been set here is my problem. Let's say the user clicks A in the menu. Selects an item in list A1. So the current view up on the A stack is A2. Then the user clicks B in the menu, now they have B1 up as their current view. The user then clicks A and should return to view A2.
My question is how two parts, what is a recommended way of storing that if menu A is clicked, the the route that should be redirected to is A2 and not A1. And also what happens to the back button ? Since both A and B work as viewstacks if the user goes A1->A2->B2 and clicks the back button, the expected behavior is to go to B1, but the back button will just take them to A2. Mind you, the viewstacks don't actually exists as I am creating the single views dynamically and using routes to guide my navigation.
Any help is greatly appreciated. And if I botched the explanation don't hesitate to ask for more information.