Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(v2) Make version switching to be aware of the current page #2923

Closed
amimas opened this issue Jun 11, 2020 · 3 comments
Closed

(v2) Make version switching to be aware of the current page #2923

amimas opened this issue Jun 11, 2020 · 3 comments
Assignees
Labels
difficulty: advanced Issues that are complex, e.g. large scoping for long-term maintainability. feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@amimas
Copy link

amimas commented Jun 11, 2020

🚀 Feature

I really like the ability to switch version from the top header without going into another page. It'd be great if switching to another version would go to the same page of the target version as the source page (where I'm currently switching from).

Have you read the Contributing Guidelines on issues?

Yes

Motivation

This will make the UX to be much more intuitive. Right now switching version automatically goes to the root/main docs page. But, because of the version drop-down menu from the header, I can select a different version from any page, as show below:

image

But, switching version while in that page, changes my context because I'm taken to the first doc page.

Pitch

(Please explain why this feature should be implemented and how it would be used.)

Since we know the current page from the address bar when switching version, I think we should be able to easily go to the corresponding page in the target version.

Of course there are some edge cases where this would not work. For example, the page may not exist in the target version because doc did not exist or had changed it's filename/path. For the first iteration of this feature, it might make sense to follow the existing process (go to the first doc). In that case, it would be nice if the user can be notified via the notification bar at the top. The notification will advise that the file/doc/path does not exist in the currently selected version.

@amimas amimas added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers labels Jun 11, 2020
@slorber slorber self-assigned this Jun 12, 2020
@slorber slorber added difficulty: intermediate Issues that are medium difficulty level, e.g. moderate refactoring with a clear test plan. difficulty: advanced Issues that are complex, e.g. large scoping for long-term maintainability. and removed status: needs triage This issue has not been triaged by maintainers difficulty: intermediate Issues that are medium difficulty level, e.g. moderate refactoring with a clear test plan. labels Jun 12, 2020
@slorber
Copy link
Collaborator

slorber commented Jun 12, 2020

This is not easy, mostly because the navbar is "global" and decoupled from the docs system.

But it seems to be a feature that multiple issues are asking so I think we should support this. I have some idea on how to do it.

Related:
#2916
#2492 (comment)

@slorber
Copy link
Collaborator

slorber commented Jul 16, 2020

Here's a first preview of what it could look like: https://deploy-preview-2971--docusaurus-2.netlify.app/

Interested by your feedback

@slorber
Copy link
Collaborator

slorber commented Jul 24, 2020

Hey all, this is feature is now released!
If you like it, don't forget to retweet 😄
https://twitter.com/docusaurus/status/1286715187983048704

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: advanced Issues that are complex, e.g. large scoping for long-term maintainability. feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

No branches or pull requests

2 participants