Repository navigation
fix(hub-ui): preserve dock order across language changes - #446
Merged
Merged
Conversation
|
@SaKaNa-Y is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
|
👁️🗨️ Review this pull request with grouped, summarized diffs at: raw result💭 analyzed by {
"headSha": "a693bd947ca15551ee0efa2f8521fd7c7dd24ed5",
"result": {
"overallSummary": "Fixes a bug where switching the UI language could reorder dock entries (e.g. Settings moving after Terminals) because the ordering tie-breaker compared translated titles. The fix compares the originally registered title for ordering while still displaying the translated title, and localized copies now track both their original and displayed title so updates don't clobber the registered title. Tests are added to lock in correct ordering across languages and update scenarios.",
"groups": [
{
"key": "fix-ordering",
"label": "Preserve dock order fix",
"summary": "Fix dock ordering so it compares the registered (default) title instead of the translated one, preventing entries with equal order weights from reshuffling when the UI language changes. Localized copies now track both their original and displayed title via a hidden symbol so an update can change the displayed title without losing the registered title used for comparisons.",
"category": "core",
"filePaths": [
"packages/hub-ui/src/client/state/locale.ts",
"packages/hub-ui/src/client/state/context.ts",
"packages/hub-ui/src/client/state/dock-settings.ts"
],
"fileNotes": [
{
"path": "packages/hub-ui/src/client/state/locale.ts",
"text": "`getDefaultTitle` keeps the original registered title attached to localized copies; it only falls back to `titled.title` when the caller has actually changed the title (not just the display)."
},
{
"path": "packages/hub-ui/src/client/state/dock-settings.ts",
"text": "Tie-break comparator now uses `getDefaultTitle` instead of the translated `title`, so language changes no longer affect ordering of entries with equal priority."
}
]
},
{
"key": "tests",
"label": "Ordering and locale tests",
"summary": "Add tests covering dock ordering stability across English/Chinese/Japanese locales and embedded/standalone contexts, including title update, custom order, and locale-switch scenarios.",
"category": "tests",
"filePaths": [
"packages/hub-ui/src/client/state/context-locale.test.ts",
"packages/hub-ui/src/client/state/locale.test.ts"
],
"fileNotes": [
{
"path": "packages/hub-ui/src/client/state/context-locale.test.ts",
"text": "End-to-end test using an in-memory RPC client to exercise registration, title updates, locale switches, and custom order through the real docks context."
}
]
}
],
"schemaVersion": 1,
"source": "llm",
"generatedAt": "2026-10-14T04:20:50.343Z",
"model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
"locale": "en"
}
} |
SaKaNa-Y
marked this pull request as ready for review
October 14, 2026 04:22
Contributor
Author
|
This does not affect how the tools work, but I expect their order to stay the same when I change the interface language. |
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.
Important
Please take a moment to read this. Thank you!
I should include a brief explanation of the problem in my own words in every PR. If that explanation is missing, please @mention me and do not merge this PR until I have added it. You may also leave this PR unaddressed (because this means I have not fulfilled my responsibilities as the author).
If my explanation is unclear or difficult to follow, please ask me to clarify or provide reproduction steps or supporting evidence.
I welcome suggestions and counterarguments, especially questions about anything I may have overlooked. (Your feedback helps me learn and improve. 🙏)
I hold myself to this standard for every PR, regardless of its size.
When I change the interface language, dock entries with equal custom and default order weights can move. For example, Settings moves from after Terminals to the end of the popup sidebar when switching from English to Chinese. The title comparison uses translated text, so changing the language changes the order.
Use the registered title for this comparison while keeping translated labels on screen. Custom order and default priority still take precedence. Localized copies track their displayed title so a caller can copy an entry and update its title without the old title replacing the update.
Verification: