Repository navigation
fix(navbar): mirror layout for RTL locales - #52
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
sapatmohit
left a comment
There was a problem hiding this comment.
Direction resolves from Locale.rtl → isRtl → explicit dir, matching LanguageSwitcher; dropdown uses inline-end; per-option dir covered by tests. No remaining physical-direction classes in NavBar. Approved.
|
Merged, thanks @Wenyan0315. |
Description
Selecting Arabic in
NavBarchanges the labels but leaves the bar and language dropdown left-to-right. Derive the root direction from the selected locale (Locale.rtlfirst, then sharedisRtl), honor an explicitdirprop, align the dropdown to inline-end, and give each option its own direction with start-aligned labels. Desktop and mobile now mirror with the same rule asLanguageSwitcher.Closes #45
Type of change
Validation
bun install --frozen-lockfilewith Bun 1.3.14 — checked 712 installs across 897 packages, no changes.npm run lint,npm run format:check,npm run typecheck— passed.npm run test— 192 tests passed; registry import-closure check passed. The 10 added cases cover locale selection, controlled updates, regional locale fallback,rtl: true/false, explicitdiroverrides, and per-option direction in both menus. Seven of the new cases failed before the fix.npm run build,npm run build:lib,npm run test:pack,git diff --check— passed. Packaging smoke check includes ESM/SSR, CJS, utils subpath and preserved client directives.Local checks used Node 22.23.2. The screenshots use the actual before/after library components with identical props and Tailwind styles in a standalone Vite harness, rather than the full docs page. No dependency or lockfile changes.
Screenshots / Recording
Each screenshot shows Before above After, with the language menu open (and the mobile menu open at 390px).
All 8 before/after views (LTR/RTL, desktop/mobile, light/dark)
Checklist
bun.lock)verifypassed (run)Usage
AI-assisted implementation, testing and screenshot capture. Only
navbar.tsxand its regression tests are changed.