Changing namespaces when on the details pages should return you to the dashboard page
Closed this issue · 5 comments
When looking at a details page (for notebooks or volumes), you still have the option to change the namespace.
But, if you do change the namespace, the navigator stays at the details page of the resource you were looking at. This might cause confusion since that resource does not belong to the new currently selected namespace.
(new namespace is selected, but still on the same resource)
Looks like this issue can cause a bit more inconsistencies than originally thought of. I initially though the issue was just when looking at the details page of a resource, and then changing the namespace, the page would still display the resource of the previously selected namespace. But just hitting the back arrow would bring you back to the main jupyter-apis page with the correct data of the newly selected namespace showing.
But I tested this workflow:
- click on a notebook that has a volume to view it's details page, in namespace 1
- in the details page, change the namespace to namespace 2
- click on the volume link in the open details page
- on the volume details page, hit the back arrow in the top left to go back to the main jupyter-apis page
After this scenario, on the index page, you should still see the notebooks for the first namespace selected, namespace 1. Not the values for the newly selected namespace, namespace 2. This is a different behavior that causes inaccuracies, with no way for the user to correct it other than reloading the page, as you can't "re-select" the selected namespace. But if they are unaware of the issue, then they would see "namespace 2" selected, but the notebooks of "namespace 1" being displayed.
While debugging, I noticed that the URL is getting changed when on the jupyter-apis menu link in centraldashboard and changing the namespace. So if you :
- go to the notebooks menu link
- go to the details page of a notebook(or the new notebook form, anything that will change the URL to reflect a new page)
- change the namespace
You will notice that the URL reverts to the previous page you were on(the index page) after the namespace is changed. But this is also happening in the other direction. If you input directly the URL for the new notebook form to start at that page. Then, go back to the index page using the arrow button in the top left. Then change the namespace, the url will get changed back to the new notebook form's URL even though you are on the index page.
I'm still trying to figure out where this bug is coming from. Since this issue deals with components from both centraldashboard and jupyter-apis and the connection between the two, I have to determine in which of those two repos the bug is coming from.
At first i thought it was coming from centraldashboard, but looking more into it, this seems like the issue is actually in jupyter-apis. This bug seems to only happen when actually hitting the pages of jupyter-apis (excluding the page-not-found component of that repo, the bug doesn't seem to trigger when hitting that page)
Ok upon further inspection, the issue might be coming from this function in central dashboard. Seems like the iframe src is always the first page you opened with the iframe open. And then, when changing the namespace, it sets the url with the value of the iframe src.
issue was that the app wasnt updating the iframe src when its pages were changing, and changing the namespace reset the url to the iframe src.
Decided to change my approach to fix this issue. I was having trouble trying to fix the iframe src to properly set the page for the iframe (jupyter-api component), and what I tried didn't solve the issue 100% of the time.
So instead, I went to fix this issue in jupyter-apis itself, since it seems like that was the only component affect by this bug. So now, in those various pages in jupyter-apis, there is a subscription to watch the namespace value and when the namespace changes, it navigates back to the base route("/"). So now, it will always reset to the base index page when changing the namespace while in the form or the details page.
This won't fix the URL inconsistencies that might appear from the centraldashboard-side of the code. But as far as what is actually happening in jupyter-apis, it should fix any inconsistencies there.