Repository navigation
fix(components): action:button renders no text for a non-string label instead of crashing the page - #37262
Draft
objectstack-fleet[bot] wants to merge 3 commits into
Draft
fix(components): action:button renders no text for a non-string label instead of crashing the page#37262objectstack-fleet[bot] wants to merge 3 commits into
objectstack-fleet[bot] wants to merge 3 commits into
Conversation
… instead of crashing the page Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
…erer hands down Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
Contributor
Author
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for L1 · area a4-U · 2026-11-25T09:01Z
|
Contributor
Author
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
This was referenced Nov 25, 2026
This branch has not been deployed
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 #36717
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
ui/packages/components/src/renderers/action/action-button.tsx: every read ofschema.labelgoes through one guard,renderableLabel. A string label is returned unchanged. Any other value (an inline locale map from metadata that skippedvalidateComponentProps) becomes no label: the button renders with no text and still runs its action, nothing prints[object Object], and a development build logs oneconsole.warnper component, keyed on the component id, naming the bundle keypages.PAGE.components.COMPONENT_ID.label. The dev warning follows the existingprocess.env.NODE_ENV !== 'production'pattern inauto-trigger.ts. The value is never translated, so a value the contract refuses gets no meaning.The guard covers all four label reads in the file: the
visiblediagnostic label, thelabelforwarded to the runner (the param dialog's title), the icon spacing class, and the rendered text.Ruling: option A (7118756694), the maintainer's 「保持走翻译包」.
labelstaysz.string()andpackages/specis untouched.Responsibility:
@object-ui/componentsaction:buttonrenderer;validateComponentProps(for example code-registered pages) and carry a non-string label.Tests
A new top-level
describefor #36717 in the existing action-button harnessaction-button-icon-inputs-11168.test.tsx, which mounts the node through the realSchemaRendererandActionProvider:[object Object]and neither locale string, and a second mount of the same component does not warn again (exactly one warning, which names the component id);translatePagethroughpages.billing.components.buy_credits.labelrenders购买额度.Acceptance notes
useAutoTriggerOnce(schema, …)still readsschema.labelinside a dev-only refusal message and a toast id, as a fallback whennameis absent. That is string interpolation, so it can't throw or show anything to a user. It is inauto-trigger.ts, outside this card's file surface.Verification
Two-minute check:
pnpm --dir ui exec vitest run packages/components/src/renderers/action/__tests__/action-button-icon-inputs-11168.test.tsx -t "non-string label". Expected: 4 passed.Ablation (guard reverted, head e8894fd)
node scripts/ablation-replace.mjsreplaced the guard's string check withreturn label as string | undefined;. The anchor went from 1 to 0 hits and the blob from 212e6892b2cc to 4aa3e1708bd4. Result: 2 failed, 2 passed. Both object-label tests threw "Objects are not valid as a React child (found: object with keys {en, zh-CN})", which is the defect as it is on main. Both controls stayed green. After the restore, the blob equals HEAD (212e6892b2cc) andgit diff HEADis empty.Suites and gates (final head e13c940)
pnpm --filter @object-ui/components type-checkpassed, chained with&&beforevitest run packages/components/src/renderers/action/(38 files, 626 tests passed). VERDICT command-exit 0.packages/components/suite on e8894fd: 510 files passed, 1 skipped; 4970 tests passed. The only later code change is the warning key (dataObjId), and the action-renderer directory was re-run on the final head.dispatch-gates --commands: 38 families derived and run;--ranaccounted for all 38. 37 exited 0 on e13c940.vitest run scripts/had one 15 s timeout under box contention (js-comment-mask-returns-interpolation-9424). That file passed on re-run under the lock on the final head.packages/components.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D