Repository navigation
fix(react): an inline action's description locale map shows in the user's language in the param dialog - #29452
Merged
Merged
Conversation
… action text localizer useActionTextLocalizer now treats a declared `description` as declared I18nLabel copy, beside confirmText, successMessage and errorMessage: a per-locale map collapses to the active language before the runner and the param dialog receive it; a plain string and a template envelope pass through as themselves. Collapse-only: the bundle entry stays the param-collection host's read. An action with no description gains no key. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUba5gmu4hkimKCSC6
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUba5gmu4hkimKCSC6
…-xq5c4g Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUba5gmu4hkimKCSC6
Creating the component reference during ParamHost's render tripped react-hooks/static-components in Lint UI. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUba5gmu4hkimKCSC6
Contributor
Author
|
domain:ui#4 · zhuangjianguo · session_01QsR2jR7ZFkpqmm4U8S1f9y 席位核对 · ACCEPT · 2026-11-02T16:39ZHead-sha:
Generated by Claude Code |
Contributor
Author
|
domain:ui#4 · zhuangjianguo · session_01QsR2jR7ZFkpqmm4U8S1f9y Landed · 2026-11-02T17:19Z · PR #29452 merged through the merge queue as
The card closed through Generated by Claude Code |
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.
Requested by Steedos · project thread
Fixes #29249
Clause-②: no
Metadata-protocol: none
维护者速读
element:button)的description写成多语言 map 时,控制台在弹出参数对话框之前先把它折成当前语言的那一句。没写description的动作不受影响,对话框照旧显示「请填写以下信息以继续操作。」。description, so an inline action's param dialog can say what it does #29369)已落地,允许内联动作写description。这是 UI 半张:不折的话,云端「邀请成员」对话框收到的是一个对象而不是一句话,邀请人看不到用自己语言写的说明。confirmText、errorMessage同一条处理;纯字符串和template信封原样返回,不读翻译包。回滚即 revert 本 PR。ui/packages/react/src/hooks/useActionTextLocalizer.ts(DECLARED_COPY_KEYS一行与文档注释),ui/packages/components/src/__tests__/element-button-paramDialogDescription-29249.test.tsx。ui/下运行pnpm exec vitest run packages/react/src/hooks/__tests__/useActionTextLocalizer.description-29249.test.tsx packages/components/src/__tests__/element-button-paramDialogDescription-29249.test.tsx,预期 2 个文件、9 条全部通过。What changes
ui/packages/react/src/hooks/useActionTextLocalizer.ts:DECLARED_COPY_KEYSgainsdescription, so a declareddescriptiongoes throughcollapseCopylikeconfirmText,successMessageanderrorMessage. AnI18nLabellocale map becomes the active language's string; a{ dialect: 'template', source }envelope and a plain string come back as themselves. TheActionTextLocalizertype docblock and the module docblock's bullet list now namedescriptionwith the other declared copy, and a new bullet records that it is collapse-only.descriptionin this hook. The param-collection host (useConsoleActionRuntime) still resolves_actions.NAME.descriptionthroughactionDescriptionover the string it is handed.descriptiongains no key, so the dialog keeps its generic line..changeset/29249-inline-action-description-locale.md:@object-ui/react: patch.DECLARED_COPY_KEYSis module-private.Tests
ui/packages/react/src/hooks/__tests__/useActionTextLocalizer.description-29249.test.tsx(6 cases, realI18nProvider): a nameless inline action's zh-CN/en map gives the zh-CN string under zh-CN and the English string under en; a named action collapses the map and does not read a bundledescriptionentry (positive control: the same bundle node'slabelis read); atemplateenvelope comes back as the same object; a plain string comes back unchanged; nodescriptionadds no key, nameless or named.ui/packages/components/src/__tests__/element-button-paramDialogDescription-29249.test.tsx(3 cases): the registeredelement:button, the real localizer and the realActionRunnerbehindActionProvideropen the param dialog. A zh-CN/endescriptionmap shows the zh-CN string under zh-CN and the English string under en, and the runner hands the host one string. With nodescriptionthe dialog shows 「请填写以下信息以继续操作。」. Each case first asserts the dialog opened with the action's title.descriptionremoved fromDECLARED_COPY_KEYS(viascripts/ablation-replace.mjs, restored to the HEAD blob,git diff HEADempty), the five map cases go red and the four controls (envelope, plain string, no description x2) stay green.Acceptance notes
Dialog, because@object-ui/componentscannot import@object-ui/app-shell. It draws the line the wayActionParamDialogdoes (state.description || t('actionDialog.description'),ActionParamDialog.tsxline 691).element:buttonforwardsname, and the console's param handler callsactionDescription(objForI18n, action?.name, action?.description)for every dispatch (useConsoleActionRuntime.tsxline 337), so a named inline action's bundledescriptionis resolved there. Measured by reading; no finding.DeclaredActionsBar,ObjectView,RecordDetailView,RelatedRecordActionsBridge,containers.tsx,record-quick-actions,record-related-list), so a registered action's locale-mapdescriptionreaches its dialog as a string too. The contract review of feat(spec): InlineActionSchema picksdescription, so an inline action's param dialog can say what it does #29369 named that as the same pre-existing gap.elements.tsxstill listslabel,confirmText,successMessage,errorMessageas the localized copy. It is outside this card's file surface and was left as is; comment only.Verification
Local runs
Final head
47f9d6de(a merge oforigin/main7b1ae338onto the fixcf64ea1b; main touched none of the four files).cd ui && pnpm exec vitest run --maxWorkers=2 packages/react/ packages/components/src/__tests__/element-button packages/components/src/__tests__/elementButtonActionMembers-8071.test.tsx packages/components/src/renderers/action/__tests__/action-forward-parity.test.tsxat47f9d6de: Test Files 139 passed (139), Tests 1562 passed (1562). That is the whole@object-ui/reactsuite (133 files atcf64ea1b, 1538 tests) plus the componentselement:buttonand forward-parity files.pnpm exec turbo run type-check --filter=@object-ui/react --filter=@object-ui/componentsat47f9d6de: 45/45 tasks, exit 0. Both new test files are in their package'stsconfig.test.jsonprogram (--listFilesOnly). No casts in either new file.cf64ea1b:node scripts/ablation-replace.mjsreplaced theDECLARED_COPY_KEYSline without'description'(anchor 1 -> 0, blobccebd928->b7c8dbed); the two new files ran 5 failed, 4 passed (the five map cases red; envelope, plain string and both no-description cases green); restored blob equals HEAD,git diff HEADempty.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 34 families atcf64ea1b; all 34 ran with exit 0 (includingnode scripts/check-sdui-manifest.mjsandpnpm --dir ui exec vitest run scripts/), and--ranreconciles 34 derived, 34 run, 0 NOT-MEASURED. The ratchet and body gates were run again at47f9d6de(see the report on the card).Generated by Claude Code