Wp-calypso: Can't navigate back from support pages

Created on 30 Jun 2020  路  8Comments  路  Source: Automattic/wp-calypso

Steps to reproduce

  1. Starting at URL: https://wordpress.com/settings/writing/[site]
  2. Click on the testimonials link and wait for the support page to load
  3. Click the back button

What I expected

I expected to go back

What happened instead

Nothing

Browser / OS version

Chrome / OSX

Screenshot / Video

calypso nav issue

dogfooding

[Pri] Normal [Type] Bug

Most helpful comment

Let's try to timebox to a day, this will either be easy or something terrible about the History API

All 8 comments

Let's try to timebox to a day, this will either be easy or something terrible about the History API

As suggested above (/cc @gwwar ) I timeboxed a day's worth of investigation on this. It was a little bit baffling, but after some digging I found it seems to be a known issue with page.js, the library Calypso uses for routing, when navigating between applications scopes on the same domain -- in this case, navigating from the Calypso SPA to the Wordpress support site.

See https://github.com/visionmedia/page.js/issues/405 (particularly the point in the discussion beginning in August)

The discussion on this issue ^ links to a related MDN article and some Javascript code that can apparently be inserted into the site being navigated to (i.e. wordpress.com/support) to alleviate the issue. Possibly something that could be looked into adding in the Wordpress support theme? It seems, based on the discussion, like it's not an issue the dev of page.js is resolving from their end.

(An interesting added wrinkle is that because this issue manifests when navigating to a different app on the same domain, it doesn't reproduce cleanly when running Calypso on localhost. So that will make testing possible solutions more complicated. 馃 )

Adding the JS snippet sounds worth a try to me. We can do a diff to the Support theme for adding it, then deploy to ensure it works properly (it's quick and harmless to test in production in this case). It's a pretty sad-trombone bug for users to go looking for help, then be punished for it by not being able to get back to what they were doing 馃檭

JS snippet added at D46831-code and ready for review. 馃槃

Would we be interested in updating the testimonial link to an inline support link instead? That might be a bit friendlier to users vs a full navigation.

Screen Shot 2020-07-23 at 3 14 58 PM

@gwwar I like this a lot -- didn't realize that was an existing pattern but I do think it seems cleaner. (Fallback snippet on the support theme is probably still good to have but I can put together a PR for this as well.)

Happy to do both here @blackjackkent, the reported bug does have pretty funny behavior here

Fallback snippet on the support theme is probably still good to have

Now fixed by @blackjackkent in D46831-code.

Was this page helpful?
0 / 5 - 0 ratings