Repository navigation
fix(components,react): element:button resolves its inline action's I18nLabel copy (objectui#12757) - #12807
Merged
objectstack-fleet[bot] merged 5 commits intoOct 16, 2026
Conversation
…8nLabel copy element:button now hands its inline action to the runner through useActionTextLocalizer, like every other action surface, and the localizer collapses every declared I18nLabel copy (label, confirmText, successMessage, errorMessage) to the active language, on a nameless action too. A locale-map successMessage now toasts the user's language instead of the runner's generic copy. Claude-Session: https://claude.ai/code/session_01UNQYdaeXCqyhJF48NnmykY Co-authored-by: Claude <noreply@anthropic.com>
…copy fix Claude-Session: https://claude.ai/code/session_01UNQYdaeXCqyhJF48NnmykY Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNQYdaeXCqyhJF48NnmykY Co-authored-by: Claude <noreply@anthropic.com>
…y cast Claude-Session: https://claude.ai/code/session_01UNQYdaeXCqyhJF48NnmykY Co-authored-by: Claude <noreply@anthropic.com>
…ement-button-i18n-copy
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contributor
Author
席位核对 · ACCEPT ·
|
objectstack-fleet
Bot
deleted the
claude/issue-12757-element-button-i18n-copy
branch
October 16, 2026 22:28
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.
Fixes #12757
Clause-②: no
What changes
element:buttonhands its inline action to the runner throughuseActionTextLocalizer, the localizer every other action surface already uses. The spec types an inline action'slabel,confirmText,successMessageanderrorMessageasI18nLabel. Before this change the button forwarded a per-locale map as is. The runner has no language and skips a non-string, so the success toast read the generic 「操作已成功完成」, the error toast read the generic failure copy, and the confirm prompt and the param dialog's title received an object.The localizer itself had the same gap. It collapsed a map only for
labelandsuccessMessage, and only on a NAMED action. An inline action is often nameless, the producer's invite button among them (objectstack-ai/cloud#2909). So adopting the localizer alone would not have fixed the card's pin. The localizer now collapses all four declared copies to the active language on every action. A translation-bundle entry still wins on a named action.errorMessagegets the collapse only, because the spec's action translation bundle declares no key for it. Plain-string copy, and a nameless action whose copy is already text, come back unchanged (the same object).packages/components/src/renderers/basic/elements.tsx:ElementButtonRendererlocalizes the declared action inside the click handler, beforeexecute.packages/react/src/hooks/useActionTextLocalizer.ts: the declaredI18nLabelcopy (confirmText,successMessage,errorMessage, pluslabel) collapses throughpickLocalizedbefore the bundle lookup, and on the nameless path too.ActionRunner.tsis not touched (PR fix(core): a navigation-only action raises no success toast unless it declares successMessage (objectui#12755) #12799's file).ActionParamDialogis not touched: its title isaction.label, which now arrives as a string.The claim listed the localizer as outside the surface. This PR changes it under the dispatch contract's in-place-fix exemption: same defect class, a mechanical extension of the
pickLocalizedstep the hook's docblock already pins, no other claim on the file, and the same test family. The seat amends the claim's file surface.Evidence
element-button-i18nCopy-12757.test.tsx(a zh-CNsuccessMessagemap toasts 「邀请已发送」;label,confirmTextanderrorMessagemaps reach the confirm prompt, the dispatched def and the error toast as zh-CN; an en leg; a plain-string control) anduseActionTextLocalizer.i18nLabelCopy-12757.test.tsx(nameless; named with no bundle entry; the bundle outranks the collapse; a same-object control).localizeActionTextstaken out, 3 of 4 rows go red ('Received: 「操作已成功完成」') and the control stays green. Restored blob = HEAD.successMessageturned into an en/zh-CN map in a throwaway copy. Before: 「操作已成功完成」. After: 「谢谢!我们已收到您的咨询。」. Screenshots: branchclaude/issue-12757-evidence,evidence/12757/.@object-ui/componentsand@object-ui/reactpasses; the i18n, changeset, test-path-roots, spec-symbols, new-line-citations and action-forward-parity checks exit 0.Acceptance notes
element:buttonused to forward undefined. The param dialog shows no title either way.ActionSchema.descriptionis also anI18nLabel, anduseConsoleActionRuntimepasses it toactionDescriptionunreduced. A map description on a registered action with params may reach the param dialog as an object. This is a read-only inference and was not measured.element:buttonforwards a few keys the spec'sInlineActionSchemapick list does not carry (description,name,navigate,to). It is dormant.Changesets:
.changeset/12757-element-button-i18n-copy.md(@object-ui/components, patch) and.changeset/12757-action-text-localizer-copy.md(@object-ui/react, patch).Provenance: built by the cloud session
session_01UNQYdaeXCqyhJF48NnmykY(claim6224898753) and opened by thedomain:uiseat 1 PM (session_011K9g23W67dy2zwnyzaoB6o) from that session's final message, because a cloud session cannot open a PR from its container. The seat replaced the dev's footer line with this paragraph and changed nothing else.Generated by Claude Code