xwikisas / application-filemanager

XWiki application to manage a hierarchy of folders and files
GNU Lesser General Public License v2.1
0 stars 4 forks source link

Add second back button #67

Open petrenkonikita112263 opened 1 year ago

petrenkonikita112263 commented 1 year ago

Currently, if the user has many files in XWiki, and decides to view some of them, it's a document or an image. After navigation from subfolders and pages in a result table. The user will select the file from a page other than the first -> it will open it to view, and after pressing button "Back to File Manager", the user will be taken to the 1st (initial page) of the result instead of going back to page (preview page) from which the file was selected.

To avoid this behavior, a new button can be added and named "Back to Previous page", which would be at the same level as the button "Back to File Manager".

bJCwZFSoIN

vmassol commented 1 year ago

Note: This looks similar to general page navigation in XWiki. The breadcrumb is there to take you back to another level but otherwise the user is supposed to hit "back" in the browser to go back to the previous page. At least that's how it works ATM. We could decide to provide a different breadcrumb or improve it. I guess all I'm saying is that the need expressed here is more generic than just the file manager and also exists for general page navigation in XWiki. However, it could be decided to implement it here while waiting for a generic implementation in XS.

Note that there is also a "Recently Visited" panel in XWiki, for example: https://playground.xwiki.org/xwiki/bin/view/Panels/RecentlyVisited

petrenkonikita112263 commented 1 year ago

Now, then the following question might be what must "Back" button in Web-browser do? Currently, it performs same functionality as the button "Back to the File Manager".

mflorea commented 1 year ago

The browser Back button should load the previous state of the live table (which is stored in the URL so can be restored). I don't think we need a new button. The existing button should take you back to the previous state of the files live table.

lucaa commented 1 year ago

The browser Back button should load the previous state of the live table (which is stored in the URL so can be restored). I don't think we need a new button. The existing button should take you back to the previous state of the files live table.

yes, I thought about that and tested it and it works only on some browsers (FF in my case, not Chrome)

BUT it seems that the URL of the page with the table is not properly a permalink. The URL does change when the navigation changes - the filesOffset param - but when I copy paste that in a different browser tab I get the first page of the table loaded, not the one I was on and also the filesOffset parameter from the URL is reset to 0. This may explain why the back of the browser doesn't work fine on all browsers.

lucaa commented 1 year ago

Now, then the following question might be what must "Back" button in Web-browser do? Currently, it performs same functionality as the button "Back to the File Manager".

no, it doesn't, it may look like it does, in some cases, but it doesn't.

The back button of the FileManager takes the user to the listing of the folder the file is in, not to whatever the screen the user was looking at before.

For example,

So, apart from the second case here, the "Back to file manager" and the Back of the browser are not doing the same thing.