For me, that's the most annoying point with the new navigation.
Related: When navigating to some DB and reloading the page (the hash-page redirecting to the normal page), the navigation for the current DB is not open.
@lem9 and @roccivic, opinions?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
PMA_reloadNavigation() from navigation.js contains the logic necessary to save the state of the tree and to request a new copy of the tree in the same state. So I guess that's a good place to start looking...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There are other cases where the status of currently opened db/table in the navi is not remembered; not sure how much work it would be to fix that. I'll try to takes notes when this happens.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@J,M: the navigation state is not stored in the url hash, it's not stored anywhere in fact and that's why it's getting lost on refresh. And a session implemetation should take into consideration that a user could have multiple tabs open...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Maybe we could add an URL parameter containing a hash pointing to a session variable with the navigation state. But, then, each navigation click would trigger a browser history entry, which I consider suboptimal.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If this is stored in the session and a user's session expires due to inactivity, I presume the navigation information would be lost? I think ideally, the user would still be able to return to their previous location even if they are inactive for an extended amount of time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Also, the current state of the navigation is generated in the PMA_reloadNavigation function. We could split that function into 2 parts, one that generates the state of the tree and another that performs the ajax request to refresh it.
This would allow us to save the HTTP parameters that would be sent in the ajax request. After the page reload, we could just send an ajax request with those parameters using the second function.
It's not spectacular, but I believe that it would work. But then, again, the issue seems to be with where to save the data, right?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi ,
I'm interested in fixing this bug as part of "User interface enhancements" in GSOC 2014. Can we use local-storage to store the state of the database tree ? We can use store.js(https://github.com/marcuswestin/store.js) or PersistJS(http://pablotron.org/?cid=1557) to support cross-browser. Can you please give your opinions about my solution ? Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Marc,
I checked this particular issue. For me navigation panel state for the current database doesn't get loss on reload. But if there are multiple databases expanded in the navigation panel, their states get lost. Is that what this issue is ? Please see my above comment also.
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Perhaps Michael can comment on whether this is still present.
If I remember correctly, the reason the proper page is displayed again after an expired session is because the URL contains what we need; the session would have been removed and so we can't store this there.
We already use local storage as part of the User Preference feature (which uses the phpMyAdmin Configuration Storage database if present, but falls back to local storage if not). The best implementation of this would be to first look at what means is used for the user preferences and re-use some of those library functions if possible.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Michal,
Are you referring to the expansion of tables,columns,indexes ? Yes they get lost after reloading. I was only referring to the expansion of database. Expansion of database doesn't get lost, only it's sub elements' expansions get lost.
I think the reason PMA manages to expand the database after reload is because url contains the database name. But I don't think its convenient to add table names to the url too. We need to store them elsewhere. Can we use cookies or local-storage ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Michal,
In that case we have to use Session Storage
In Session Storage
1. Values persist only as long as the window or tab in which they stored.
2. Values are only visible within the window or tab that created them.
But it only supports It supported by FF3.5+, Chrome4+, Safari4+, Opera10.5+, and IE8+. Would that be a problem ?
But I guess since it's supported by many browsers and the feature that is to be implemented is not a critical one, it's okay to Session Storage.
Let me know your thoughts
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For me, that's the most annoying point with the new navigation.
Related: When navigating to some DB and reloading the page (the hash-page redirecting to the normal page), the navigation for the current DB is not open.
@lem9 and @roccivic, opinions?
PMA_reloadNavigation() from navigation.js contains the logic necessary to save the state of the tree and to request a new copy of the tree in the same state. So I guess that's a good place to start looking...
I discourage embedding the navigation panel state in the URL hash, though. We should store it in the session, shouldn't we?
And: Do we need to allow users to turn off the navigation state restore?
There are other cases where the status of currently opened db/table in the navi is not remembered; not sure how much work it would be to fix that. I'll try to takes notes when this happens.
@J,M: the navigation state is not stored in the url hash, it's not stored anywhere in fact and that's why it's getting lost on refresh. And a session implemetation should take into consideration that a user could have multiple tabs open...
Maybe we could add an URL parameter containing a hash pointing to a session variable with the navigation state. But, then, each navigation click would trigger a browser history entry, which I consider suboptimal.
If this is stored in the session and a user's session expires due to inactivity, I presume the navigation information would be lost? I think ideally, the user would still be able to return to their previous location even if they are inactive for an extended amount of time.
@JM: Just a heads-up, the hash part of the url is already used for the microhistory.
Also, the current state of the navigation is generated in the PMA_reloadNavigation function. We could split that function into 2 parts, one that generates the state of the tree and another that performs the ajax request to refresh it.
This would allow us to save the HTTP parameters that would be sent in the ajax request. After the page reload, we could just send an ajax request with those parameters using the second function.
It's not spectacular, but I believe that it would work. But then, again, the issue seems to be with where to save the data, right?
PMA_reloadNavigation could be split like this: https://github.com/roccivic/phpmyadmin/commit/d159bde834a2c2883bf232a38a8008a27a8c2702
Hi ,
I'm interested in fixing this bug as part of "User interface enhancements" in GSOC 2014. Can we use local-storage to store the state of the database tree ? We can use store.js(https://github.com/marcuswestin/store.js) or PersistJS(http://pablotron.org/?cid=1557) to support cross-browser. Can you please give your opinions about my solution ? Thank you
Hi Marc,
I checked this particular issue. For me navigation panel state for the current database doesn't get loss on reload. But if there are multiple databases expanded in the navigation panel, their states get lost. Is that what this issue is ? Please see my above comment also.
Thank you
Perhaps Michael can comment on whether this is still present.
If I remember correctly, the reason the proper page is displayed again after an expired session is because the URL contains what we need; the session would have been removed and so we can't store this there.
We already use local storage as part of the User Preference feature (which uses the phpMyAdmin Configuration Storage database if present, but falls back to local storage if not). The best implementation of this would be to first look at what means is used for the user preferences and re-use some of those library functions if possible.
Isaac,
I think this issue is not there anymore. Did you try to reproduce it ?
Michael,
I can you please confirm this? Also see my above comments. I really value your thoughts on this. I need to describe this my gsoc proposal
Thank you
I think this is still happening:
I'd expect navigation tree to be same (same leafs expanded), but currently it resets to default state for current main frame.
Last edit: Michal Čihař 2014-03-12
Hi Michal,
Are you referring to the expansion of tables,columns,indexes ? Yes they get lost after reloading. I was only referring to the expansion of database. Expansion of database doesn't get lost, only it's sub elements' expansions get lost.
I think the reason PMA manages to expand the database after reload is because url contains the database name. But I don't think its convenient to add table names to the url too. We need to store them elsewhere. Can we use cookies or local-storage ?
Expansion of database gets lost as well if you only expand it, but not select it.
Michal,
Ahh yes. Got that. So what do you think about my ideas to save the state ?
1. local-storage
2. PMA Configuration Storage
3. Cookies
I think local storage is best choice here. Also remember that user might have more tabs open with phpMyAdmin, each having different state.
Michal,
In that case we have to use Session Storage
In Session Storage
1. Values persist only as long as the window or tab in which they stored.
2. Values are only visible within the window or tab that created them.
But it only supports It supported by FF3.5+, Chrome4+, Safari4+, Opera10.5+, and IE8+. Would that be a problem ?
But I guess since it's supported by many browsers and the feature that is to be implemented is not a critical one, it's okay to Session Storage.
Let me know your thoughts
Sounds good enough.
Related to this: https://sourceforge.net/p/phpmyadmin/bugs/4439/