Page MenuHomePhabricator

Add a "Back to Home Page" on tool info pages
Closed, DeclinedPublic

Description

While testing 678433, it took me some time to realize that we are referring to the "browser back" button rather than an interface button that wasn't functioning correctly.

In any case, I find it weird that we have a means for someone to get to the tool info page from the history page but not from the tool info page to the home page. With new changes in 678433, one can use the browser button to navigate seamlessly from tool info to the home page, but a button addition on the tool info page itself would bring a lot of clarity.

Event Timeline

I wonder if we should actually add some breadcrumb navigation to do this kind of "back to where you were" in all the nested contexts that we are creating? The "home" button is in the sidebar nav all the time already.

@bd808 That might be a good idea, but I am wondering if we need that. Looking at the pages that we currently have, only a tool and its history page require the "back to the home page" button (to get back to the exact pagination state on the home page).

(to get back to the exact pagination state on the home page).

Hmmm... how would we do that part? To restore the pagination state we would need to have the page number from the home screen saved somewhere. Right now that somewhere is only in the browser's url history stack that we are updating when the pagination widget is used. I guess we could mirror that state in vuex somewhere so that it could be fetched to make a link.

The user may have reached a tool detail screen from the search screen instead of the home screen, which I think means that we would want the "go back" button to target a different route with different initializing URL state.

Once we have lists, the "go back" route could change to reference a public list or the user's favorites list as the starting point.

Reinventing the browser's history stack in our vue code seems somehow inelegant. I wonder what is "normal" for a SPA to do for this basic problem?

I have found some nice writeups of using nested routes in the vue-router config to generate data for a breadcrumb nav, but those would not handle this idea of returning to where ever you started from. They would be more useful for section sub-navigation where you could have something like this example from Striker) ToolsadmintoolinfoToolforge homepagehistory2020-08-18T11:08:17+00:00

I'm not sure why a 'Back to Home' button is needed. There's already a home button in the sidebar nav right? On mobile the hamburger menu is serving the same job. When i first tried out the Toolhub i had no problems at all finding the home button.

Agreed that replicating browser history stack in Vue code is inelegant and can lead to many complicated states. One easy solution might be to only show a 'Go back to search results' button on the Tool page when a user is arriving from the search results page and simply link it to the back button state (history.go(-1)).

Declining because of overlap with T305455: `Back to ...` buttons should lead users back to where they came from and lack of interest in recreating native browser history navigation in the app at this time.