fix(i18n): update language switch immediately without refresh#2525
fix(i18n): update language switch immediately without refresh#2525BittuBarnwal7479 wants to merge 4 commits intonpmx-dev:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
📝 WalkthroughWalkthroughUpdates keyboard shortcut mappings in navigation (comma to 's' for settings, normalised 'c' for compare), corrects a prop binding on navigation links, and refactors locale change handling in settings to use controlled component pattern with a helper function. Changes
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Hello! Thank you for opening your first PR to npmx, @BittuBarnwal7479! 🚀 Here’s what will happen next:
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/components/AppHeader.vue (1)
313-320:⚠️ Potential issue | 🟡 MinorKeep
ariaKeyshortcutson these header links.
LinkBasestill uses itsariaKeyshortcutsprop to set thearia-keyshortcutsattribute and render the visible<kbd>hint inapp/components/Link/Base.vue:108-131. Adding:classiconfixes the icon, but dropping the shortcut prop regresses both accessibility metadata and the desktop hint badge for Compare and Settings.Proposed fix
<LinkBase v-for="link in desktopLinks" :key="link.name" class="border-none" variant="button-secondary" :to="link.to" :classicon="link.iconClass" + :ariaKeyshortcuts="link.keyshortcut" > {{ link.label }} </LinkBase>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/components/AppHeader.vue` around lines 313 - 320, The header LinkBase loop removed the ariaKeyshortcuts prop, which breaks the aria-keyshortcuts attribute and the visible <kbd> hint rendered by Link/Base.vue (see render logic around lines 108-131); restore the binding by passing ariaKeyshortcuts from each link (e.g., :ariaKeyshortcuts="link.ariaKeyshortcuts") in the v-for so Compare and Settings keep their accessibility metadata and desktop hint badge while retaining the :classicon change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@app/components/AppHeader.vue`:
- Around line 313-320: The header LinkBase loop removed the ariaKeyshortcuts
prop, which breaks the aria-keyshortcuts attribute and the visible <kbd> hint
rendered by Link/Base.vue (see render logic around lines 108-131); restore the
binding by passing ariaKeyshortcuts from each link (e.g.,
:ariaKeyshortcuts="link.ariaKeyshortcuts") in the v-for so Compare and Settings
keep their accessibility metadata and desktop hint badge while retaining the
:classicon change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b29319e8-2afa-4fbd-8bfc-38a0cbfcb883
📒 Files selected for processing (2)
app/components/AppHeader.vueapp/pages/settings.vue
romansp
left a comment
There was a problem hiding this comment.
Thanks for looking into that as this was bugging me too.
Let's keep this PR minimal though and fix language switch issue only.
Icons and shortcuts in AppHeader seem to be this way by design right now. I don't know the reason behind choosing , and s might actually be better. Anyways, I suggest to revert this part. Let's open a new issue if you think that's a problem and we address it there instead.
Thanks, makes sense. I’ll keep this PR minimal and revert the AppHeader icon changes so it only fixes the language switch issue. |
This reverts commit 9b2c854.
|
@romansp please review. |
|
This looks good to me. Thanks @BittuBarnwal7479. To whoever will be merging I suggest use squash strategy to avoid revert commits appearing on |
🔗 Linked issue
#2526
🧭 Context
When switching language from Settings, the first change didn’t fully apply unless the page was refreshed.
This PR fixes both so the UI updates immediately and stays consistent.
📚 Description
I updated the language-change flow in Settings so locale updates are applied through the same path every time, including the first switch. That removes the partial-translation state and the refresh workaround.
I tested this manually by:
switching locales multiple times from the Settings page
checking header icons immediately after each switch
confirming shortcuts still navigate correctly
Before:
npmx.mp4
After:
Recording.2026-04-15.010332.mp4