🐛 fix(navbar): fix layout shift on language toggle#259
Merged
lwinmoepaing merged 1 commit intomyanmar-software-engineers:mainfrom Mar 22, 2026
Merged
Conversation
Navbar menu item widths and sign-in button width were changing size when switching between English and Myanmar languages, causing layout instability. - Add `desktopNavWidthByKey` fixed-width map to lock each nav item to a stable Tailwind width class regardless of translated label length - Apply `inline-flex justify-center whitespace-nowrap` on nav links to prevent text-driven width changes - Add `min-w` and `whitespace-nowrap` to `SignInButton` for stable width across locales - Fix React purity issue: replace `Math.random()` in render with static `sparkleDriftX` constant array - Refine desktop nav spacing, gap, and font size for visual balance
2 tasks
eebdfac
into
myanmar-software-engineers:main
4 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Summary
Fixed navbar menu item widths and sign-in button width changing size
when switching between English and Myanmar languages, causing visible
layout shifts on each toggle.
Resolved by locking each nav item to a fixed width via a
desktopNavWidthByKeymap and enforcingwhitespace-nowrap+inline-flexlayout on all nav links and the sign-in button.
📋 What Changed
src/components/Common/Navbar/Navbar.tsxsrc/components/Auth/SignInButton.tsxFeatures / Fixes
desktopNavWidthByKey) locks each nav item regardless of translated label lengthinline-flex justify-center whitespace-nowraponNavLinkprevents text-driven width changesmin-w+whitespace-nowraponSignInButtonfor stable width across localesMath.random()in render with staticsparkleDriftXconstant🎮 How It Works
✅ Testing Checklist
Work of Validation
menu-width.mp4
Issue #255