Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Version switching user experience improvements #13921

Merged
merged 3 commits into from
Jan 18, 2019

Conversation

aaronmarkham
Copy link
Contributor

@aaronmarkham aaronmarkham commented Jan 17, 2019

Description

This PR fixes some usability problems with the version selector. You tend to lose your place when you use the search feature or when browsing the APIs looking for stuff. If you switch versions, you don't always end up where you were or get redirected to the home page.

EDIT: It also fixes a search bug for developers that try to use the search feature in their dev versions of the website.

Preview for Search

When you search for something on the website in an older version, don't find it, then switch to a newer version, you are redirected to the root of the website.

For example:

  1. Search for "taco": http:https://mxnet.incubator.apache.org/versions/1.0.0/search.html?q=taco&check_keywords=yes&area=default
    No 🌮 ! What if master has 🌮 ?
  2. Use the versions dropdown and change to master.
    You lost your search! 😭 and still no 🌮 .

Now try to search for 🌮 on the preview:

  1. http:https://34.201.8.176/versions/1.3.1/search.html?q=taco
    No 🌮 .
  2. Change to master.
    Still no 🌮 but 🌤 you didn't get bounced to the home page.

Preview for Anchors

It seems to work now when the page is loaded anew. However, I noticed that using in-page anchors the page didn't provide a new window.location.hash to the function in docversion.js that updates the version dropdown's links, so the when switching versions you don't load the last anchor you were on.

  1. Go look at ndarray docs: http:https://34.201.8.176/versions/1.3.1/api/python/ndarray/ndarray.html
  2. Scroll down and click the link for ndarray.shape.
  3. You jump down to the docs for shape. But you decide you don't like it, and you want to know if master has more features. Your current location is now http:https://34.201.8.176/versions/1.3.1/api/python/ndarray/ndarray.html#mxnet.ndarray.NDArray.shape
  4. Use the version dropdown to change to Master.
  5. Witness 👀 that you are now on: http:https://34.201.8.176/versions/master/api/python/ndarray/ndarray.html#mxnet.ndarray.NDArray.shape

If you try this flow in production you see that it is kind of broken.

Comments

The redirects update and overview of intentions and test links are on the wiki: https://cwiki.apache.org/confluence/display/MXNET/Redirects+on+the+Website

The search feature on the website is buggy. Today it shows results in an old version that shouldn't be there. For example "allreduce" shouldn't appear <v1.2.1, but it does today. I'm not trying to fix Sphinx's search in this PR.

@aaronmarkham
Copy link
Contributor Author

This is a rehash of #12689 - but this time the redirects to master or other versions seem to be working well. @safrooze can you take a look and let me know what you think? @ddavydenko this uses your regex's. Thank you! Please take a look at the implementation.

docs/_static/js/docversion.js Outdated Show resolved Hide resolved
docs/_static/js/docversion.js Outdated Show resolved Hide resolved
docs/_static/js/docversion.js Outdated Show resolved Hide resolved
@ChaiBapchya
Copy link
Contributor

nitpick: Can we get rid of the "searching" after it has searched and displays the output
screen shot 2019-01-17 at 4 48 18 pm

Copy link
Contributor

@ChaiBapchya ChaiBapchya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise!

@aaronmarkham
Copy link
Contributor Author

@ChaiBapchya - IDK, maybe I can fix that.
I just fixed a bug in the search where if you tried to click on a search result from the results shown in the search bubble, it would never connect because dev servers don't have https (usually). I made it look at the current protocol instead and use that. Now using and debugging search should be easier on dev machines. (I am trying to figure out why search is messed up right now, but if this passes CI, we should probably just merge it and get whatever bug fixes I might come up with later.)

@ChaiBapchya
Copy link
Contributor

Yes, this sounds good.

@IvyBazan
Copy link
Contributor

LGTM!

@aaronmarkham aaronmarkham merged commit de5948b into apache:master Jan 18, 2019
jessr92 pushed a commit to jessr92/incubator-mxnet that referenced this pull request Jan 27, 2019
* fix version switching for anchors and search

* improved redirects

* fix bug for dev previews; remove hardcoded protocol
stephenrawls pushed a commit to stephenrawls/incubator-mxnet that referenced this pull request Feb 16, 2019
* fix version switching for anchors and search

* improved redirects

* fix bug for dev previews; remove hardcoded protocol
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
* fix version switching for anchors and search

* improved redirects

* fix bug for dev previews; remove hardcoded protocol
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants