-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: docs dropdown alignment #4937
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
base: master
Are you sure you want to change the base?
fix: docs dropdown alignment #4937
Conversation
- Created utils/storage.ts with safe storage access utilities - Added initializeStorage() to clean up null values on app load - Updated NavBar to use safe setStorageItem() function - Prevents 'Cannot read properties of null (reading length)' error Fixes asyncapi#4787
The docs dropdown was showing a slight offset when hovering over it. Cleaned up the positioning classes to make it align properly - removed the negative margin that was shifting things around and simplified the centering logic. Fixes asyncapi#4932
✅ Deploy Preview for asyncapi-website ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughA new centralized localStorage utility module is introduced with three helper functions (getStorageItem, setStorageItem, initializeStorage) to safely manage browser storage. The app initializes storage on mount to prevent runtime errors. NavBar now uses the utility instead of direct localStorage access. FlyoutMenu's CSS positioning is simplified for improved layout alignment. ToolsCard's useEffect dependency array is simplified. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4937 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 798 796 -2
Branches 146 146
=========================================
- Hits 798 796 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-4937--asyncapi-website.netlify.app/ |
I was looking through the open issues and found #4932 about the Docs dropdown having some alignment issues on hover.
After checking the navbar component, I tracked down the problem to the
FlyoutMenu.tsxfile,, and The dropdown was using-ml-4(negative left margin) with some other positioning classes that were conflicting with each other. And it was causing the dropdown to appear slightly offset.Changes Made
I Removed the
-ml-4negative margin that was causing the misalignment.And Cleaned up the positioning logic to use
left-0on mobile screens.Also simplified the centering classes to
left-1/2with-translate-x-1/2on medium screens and above.The dropdown now aligns properly with the navbar at default zoom
Testing
I Tested it locally by hovering over the Docs menu item and the dropdown now appears aligned correctly without the visual shift.
Fixes #4932
Summary by CodeRabbit
Bug Fixes
UI/UX
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.