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): fix announcement bar layout shift due to missing storage key namespace #10144

Merged
merged 2 commits into from
May 16, 2024

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented May 16, 2024

Motivation

Fix regression from #10121

The announcement bar key is duplicated in 2 places, and one of those places didn't apply the new localStorage namespacing, leading to a layout shift on load.

I also extracted all those inline scripts to a separate file to keep the theme code simpler.

Test Plan

Preview should not have announcement bar layout shifts after dismissing the announcement bar.

Unlike what we currently see on https://docusaurus.io/ where the announcement bar is visible for a few milliseconds before being removed.

Test links

https://deploy-preview-10144--docusaurus-2.netlify.app/

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label May 16, 2024
@slorber slorber requested a review from Josh-Cena as a code owner May 16, 2024 15:58
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 16, 2024
Copy link

netlify bot commented May 16, 2024

[V2]

Name Link
🔨 Latest commit 7e0a8a9
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/66462d3b862b3c000883452c
😎 Deploy Preview https://deploy-preview-10144--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 configuration.

Copy link

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 65 🟢 98 🟢 96 🟢 100 🟠 88 Report
/docs/installation 🟠 64 🟢 96 🟢 100 🟢 100 🟠 88 Report
/docs/category/getting-started 🟠 75 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog 🟠 69 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 62 🟢 96 🟢 100 🟢 100 🟠 88 Report
/blog/tags/release 🟠 70 🟢 100 🟢 100 🟠 80 🟠 88 Report
/blog/tags 🟠 74 🟢 100 🟢 100 🟢 90 🟠 88 Report

Copy link

Size Change: 0 B

Total Size: 1.71 MB

ℹ️ View Unchanged
Filename Size Change
website/.docusaurus/codeTranslations.json 2 B 0 B
website/.docusaurus/docusaurus.config.mjs 26.9 kB 0 B
website/.docusaurus/globalData.json 107 kB 0 B
website/.docusaurus/i18n.json 930 B 0 B
website/.docusaurus/registry.js 275 kB 0 B
website/.docusaurus/routes.js 179 kB 0 B
website/.docusaurus/routesChunkNames.json 119 kB 0 B
website/.docusaurus/site-metadata.json 2.17 kB 0 B
website/build/assets/css/styles.********.css 112 kB 0 B
website/build/assets/js/main.********.js 853 kB -4 B (0%)
website/build/index.html 38.1 kB +4 B (+0.01%)

compressed-size-action

@slorber slorber merged commit ef627f8 into main May 16, 2024
31 of 33 checks passed
@slorber slorber deleted the slorber/fix-announcementBar-keys branch May 16, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

2 participants