xwikisas/application-filemanager

Add second back button

Opened this issue · 5 comments

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

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

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".

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

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

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,

  • if you're looking at the "all files" listing of the FM and you click on a file there, open it, and then you click on "Back to file manager", the FileManager will open to the listing of the folder that the file is in, not to the "all files" screen.
  • if you have opened the file from the listing of its folder, "Back to file manager" will open the listing of the same folder.
  • if you have put a link to the filemanager file on some other page of the wiki (since it's a page like any other page, this link is possible), you click on that link to open the file and then click "Back to file manager", it will take you to the filemanager, not to the page you were before.

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