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

fix(theme): preserve url ?search#hash on navbar version/locale dropdowns navigations #8059

Merged
merged 2 commits into from Sep 7, 2022

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Sep 7, 2022

Motivation

?search#hash shouldn't be lost when switchiung version or locale through the navbar dropdowns.

A querystring/hash may be used to enable some page-specific behavior that we want to preserve:

Test Plan

preview / dogfood

Test links

Deploy preview:

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Sep 7, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Sep 7, 2022
@netlify
Copy link

netlify bot commented Sep 7, 2022

[V2]

Name Link
🔨 Latest commit 2426f61
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6318d0f4195fd30008fcea16
😎 Deploy Preview https://deploy-preview-8059--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented Sep 7, 2022

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 62 🟢 98 🟢 100 🟢 100 🟠 80 Report
/docs/installation 🟠 81 🟢 98 🟢 100 🟢 100 🟢 90 Report

@github-actions
Copy link

github-actions bot commented Sep 7, 2022

Size Change: +162 B (0%)

Total Size: 813 kB

Filename Size Change
website/build/assets/js/main.********.js 609 kB +162 B (0%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 52.1 kB
website/build/assets/css/styles.********.css 111 kB
website/build/index.html 40.8 kB

compressed-size-action

@slorber
Copy link
Collaborator Author

slorber commented Sep 7, 2022

when switching version on a hash that doesn't lead to any existing heading (for example a routing hash, cf examples), the navbar disappears 😅

CleanShot 2022-09-07 at 18 46 26@2x

@slorber slorber added the to backport This PR is planned to be backported to a stable version of Docusaurus label Sep 7, 2022
@Josh-Cena
Copy link
Collaborator

Shall we fix that one before merging this? I fear that's an even weirder UX.

@slorber
Copy link
Collaborator Author

slorber commented Sep 7, 2022

looks like there are some weird edge-cases to consider, but should be good enough for now

Example weird edge case: the dropdown not disappearing because it remains hovered, while navbar disappears

CleanShot 2022-09-07 at 19 36 51@2x

I'm not the the prod behavior of this hideable navbar is 100% good atm anyway 🤷‍♂️

@slorber slorber merged commit a492025 into main Sep 7, 2022
@slorber slorber deleted the slorber/navbar-dropdown-preserve-querystring branch September 7, 2022 17:36
slorber added a commit that referenced this pull request Oct 28, 2022
@slorber slorber added backported This PR has been backported to a stable version of Docusaurus and removed to backport This PR is planned to be backported to a stable version of Docusaurus labels Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR has been backported to a stable version of Docusaurus CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants