Skip to content

页面上的 action:button 不翻译按钮文字,传多语言对象还会让整页崩溃 #36717

Description

@objectstack-fleet

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

② fleet finding (class a) · Source: the card thread of cloud#4902 (PR objectstack-ai/cloud#4941), seen in the browser on cloud's current framework pin. Not measured on objectstack main.

What happens. A page-metadata node action:button renders schema.label as it is. A plain string label is never translated, and a label given as an inline locale map ({ 'zh-CN': …, en: … }) crashes the page with React's "Objects are not valid as a React child". element:button cannot name an objectName for a script action, so a page author has no way to put a localized button that runs a declared object action on a page.

Effect today: cloud's billing page (cloud#4902) had to use Markdown links to the environment's record page instead of running 调整席位 / 购买额度 / 管理订阅与发票 in one click.

Expected. action:button resolves its label the way other page nodes do (locale map or translation key), and never crashes on a locale map. Optional: if the action declares its own label, use it when the node gives none.

Acceptance. A test renders an action:button with a locale-map label in two locales and gets the right text, with no crash; a test that a string label still renders. Check on objectstack main first: the report is from cloud's pin.

Grading (proposed): area:ux · Bug · a page crash on a valid-looking label and no way to localize a page action button ⇒ p2. Evidence: measured in the browser on cloud's pin (thread report) + read.

Dedupe: searched repo:objectstack-ai/objectstack is:issue is:open for "action:button label locale", "action button label not localized", "Objects are not valid as a React child label": none.

Activity

  1. added
    bug
    priority:p2
    pm:queue
    domain:ui
    on Nov 23, 2026
  2. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ux · domain:ui · priority:p2 · Bug · pm:queue; seat grade kept.
    Rationale: a page-metadata action:button shows its label untranslated, and an inline locale map as the label crashes the whole page ("Objects are not valid as a React child"). That leaves a page author no way to place a localized button that runs a declared object action. The crash needs that specific authoring shape, and the plain-string case is wrong-language text, so this is p2. Seen on cloud's framework pin, not measured on main.

  3. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

    Claim: PM loop round 10 · 2026-11-23T21:27Z
    Session: session_01JQwxbZeHNsF3RWcWpj7rGj
    Thread session: opened by the coordinator; the thread names itself in its first report
    Account: os-warren
    Branch: the card thread's own branch, named at its first push; the seat records it then
    Worktree: objectstack-issue-36717
    Domain: domain:ui
    Seat: repo:objectstack#1
    Area: card thread #36717 (w9-36717)
    Dispatch: p2 area:ux, non-epic page-crash bug; the thread first checks the behaviour on objectstack main (the report came from cloud's pin). The maintainer resumed area:ux cards at 2026-11-23T21:18:46Z (「area 的ux任务继续处理」), lifting the 2026-11-23T15:36Z freeze for area:ux; p1+p2, epic children first, under the 15-thread cap.
    File surface: the action:button page node renderer under ui/packages and the shared label resolver it should use, tests, a changeset; a change to the page-node schema in packages/spec is out of surface and is reported as a fork (stop on breach; the thread's first report states the real surface and the seat amends this line)
    Container & model: S, mode:thread, model: opus — default tier; the thread's first report states the served tier, effort: high
    Clause-②: no. A new route, contract, spec key or export is amended to yes before its code
    Metadata-protocol: none
    Responsibility: as the card body states
    Thread-read: 7103037498
    Premise: read from the card; the thread re-reads it on its base before code
    Serial constraints cleared: no open PR names the card

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 23, 2026
  5. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

    Decision owed · 2026-11-23T21:46Z: the card thread (session session_01JQwxbYExPfxvwHxCxmsBWX) stopped before code with needs_decision; its readings on main e0f0e9f are in the project file issue-36717/premise-reading.md. The seat releases the claim and moves the card to the decision inbox.

    维护者速读

    • 卡上说「页面按钮的文字没法翻译」,实测不对:按钮文字本来就能翻译,走的是翻译包里这个组件的条目,云端的按钮没走这条路。
    • 卡上要的「文字直接写成多语言对象」,协议里明确不允许,在命令行和运行时保存页面时会直接拒收。云端那个页面是代码注册的,绕过了这道检查,所以才崩。
    • 建议:协议不改,这张卡不做;另开一张云端卡,把计费页的三个按钮改成正规写法(按钮 + 对象 + 翻译包文字)。

    Readings (card thread, measured on main e0f0e9f)

    1. True: action-button.tsx:486 prints schema.label raw, so an inline locale map crashes the render.
    2. False: "a string label is never translated". The declared route is the bundle key pages.PAGE.components.COMPONENT_ID.label; translatePage turns an action:button label 'Buy credits' into '购买额度' from that key.
    3. The locale map is contract-refused: ActionButtonPropsSchema.label is z.string(), and its describe says to localize through the bundle entry for the component id, not an inline locale map (packages/spec/src/ui/component.zod.ts ~4095). validateComponentProps enforces it on the CLI and on runtime page writes. Cloud hit the crash because its code-registered tenant pages never pass that gate.
    4. False: "no way to place a localized button that runs an object action". action:button forwards objectName, and its label localizes through the route in point 2.

    Governing text: ActionButtonPropsSchema.label describe in packages/spec/src/ui/component.zod.ts.

    Options

    • A (recommended). Keep the contract; close this card not planned. A cloud card moves the billing page's three buttons to action:button + component id + objectName with bundle labels, and may add a cloud test that runs validateComponentProps over its code-registered pages. Open point for that card: how the button names the environment record on a standalone page.
    • B. Widen the label to the i18n label type: a spec change that reverses the row's written choice.
    • C. Renderer-only tolerance of the refused value. Not recommended: a value the contract refuses would render silently.

    Four axes: business need: one cloud page, served by A's existing route. Long-term: one translation route per component, already declared. AI-error: A keeps the strict row, and a map is refused loudly at write. Startup scope: A adds nothing.

  6. added
    needs-user-decision
    and removed
    pm:dispatched
    on Nov 23, 2026
  7. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzi4PechTRCTBrfxV8W

    Ruled: A · needs-user-decision cleared → pm:queue · 2026-11-24T01:05Z

    The maintainer (Yibo Wang) picked option A on the seat's decision card in the os-support-ai fleet project at 2026-11-24T01:05Z, verbatim: 「保持走翻译包」 (question: 「#36717 页面按钮的多语言:保持走翻译包,还是让按钮文字直接接受多语言对象?」). The options were reviewed independently (contract-review tier) before they went to the maintainer.

    Ruling

    1. The action:button page-component label stays z.string() (packages/spec/src/ui/component.zod.ts:4095-4096); it is localized through the translation bundle entry for its component id (pages.<name>.components.<componentId>.<key>, packages/spec/src/system/translation.zod.ts:1600), not an inline locale map. Not taken: widening the label to I18nLabel.
    2. Reading on origin/main: a string label already translates through that bundle key (card thread reading 7114917709), so "never translated" and "no way to localize" do not hold.

    What this card now carries (dispatch shape)

    • Render guard only: ui/packages/components/src/renderers/action/action-button.tsx:486 prints {schema.label} raw, so a non-string label (e.g. a locale map from code-registered metadata that skipped validateComponentProps) throws "Objects are not valid as a React child" and white-screens the page. The renderer must never throw on a non-string label: render no text (or the component id) and log a development warning; it must NOT translate the map (that would accept a value the contract refuses). Pin: a page with an object label renders without crashing and shows no [object Object].
    • Clause-②: no, Metadata-protocol: none, size S.
    • Moving the cloud billing page's buttons to the bundle-key route belongs to a repo:cloud card, not this one.
  8. added
    pm:queue
    and removed
    needs-user-decision
    on Nov 24, 2026
  9. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D

    Claim: PM loop round 2 · area a4-U · 2026-11-25T07:20Z
    Session: session_01QSeKYmRepQK9DkZeU7F53D
    Account: os-justin
    Branch: claude/issue-36717-action-button-label-guard
    Worktree: objectstack-issue-36717
    Domain: domain:ui
    Seat: repo:objectstack#4
    Area: a4-U
    File surface: ui/packages/components/src/renderers/action/action-button.tsx (the label render, ~line 486), its pin as a top-level describe in the existing action-button renderer harness, and one patch changeset (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default (dispatch-gates --tier at d7f299c: no path-derived mandate), effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: the platform's own renderer (@object-ui/components action:button, objectstack) | the translation bundle key for the component id (pages.<name>.components.<componentId>.<key>) is the contract path and already translates a string label | a page whose metadata skipped validateComponentProps (e.g. code-registered) and carries a non-string label; today that white-screens the page
    Thread-read: 7118756694
    Premise: holds — at origin/main d7f299c, action-button.tsx:486 prints {schema.label} raw, so an object label throws "Objects are not valid as a React child". The dispatch shape is the ruling's (7118756694, the maintainer's 「保持走翻译包」, option A): render guard only. Never throw on a non-string label; render no text (or the component id) and log a development warning; do NOT translate the map; label stays z.string().
    Serial constraints cleared: open PR #37215 (another seat's ask_ai action type) edits action-button.tsx at its imports (~21) and ~432, not at the label render (~486). The dev keeps clear of those hunks and runs overlap-check before each push
    Pre-claim lane: this seat's whole-repo lane. Seat 1 released the claim to the decision inbox (7114917709); seat 3 recorded the ruling and returned the card to pm:queue with no seat routing; seat repo:objectstack#4 confirmed. Not an epic child (no parent issue)
    Pre-claim deps: no Blocked-by:
    Prior rulings read: 7118756694 (Ruled A, the maintainer's 「保持走翻译包」): label stays z.string(), localized through the bundle key; this card carries only the render guard; moving cloud's billing page buttons is a repo:cloud card. Repo: objectstack-ai/objectstack

  10. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 25, 2026
  11. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D
    os-dev-report

    {
      "issue": 36717,
      "status": "done",
      "branch": "claude/issue-36717-action-button-label-guard",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37262",
      "session": "session_01QSeKYmRepQK9DkZeU7F53D",
      "premise_still_valid": true,
      "summary": "Render guard only, per ruling A (7118756694, the maintainer's 「保持走翻译包」). In action-button.tsx every read of schema.label goes through renderableLabel: a string passes unchanged, and any other value becomes no label. So the button renders with no text, still runs, never prints [object Object], and a dev build warns once per component id (the process.env.NODE_ENV pattern from auto-trigger.ts). All four reads are covered: the visible diagnostic label, the label forwarded to the runner, the icon spacing, and the text. packages/spec is untouched and nothing is translated. Final head e13c940; draft PR #37262.",
      "tests": "Pin: a top-level describe for #36717 appended to the existing harness action-button-icon-inputs-11168.test.tsx (real SchemaRenderer + ActionProvider), 4 tests: an object label renders empty with no [object Object] and exactly one warning across two mounts; an object label still runs and forwards no label; CONTROL string label; CONTROL translatePage bundle key pages.billing.components.buy_credits.label renders 购买额度. Harness file: 59/59 passed. Final head e13c940: type-check && vitest packages/components/src/renderers/action/ gave 38 files and 626 tests passed, VERDICT command-exit 0. Full packages/components/ on e8894fd: 510 files passed, 1 skipped; 4970 tests passed. Ablation via scripts/ablation-replace.mjs (guard reverted, anchor 1 to 0, blob 212e6892 to 4aa3e170): 2 failed with 'Objects are not valid as a React child (found: object with keys {en, zh-CN})', controls 2 passed. Restore: blob equals HEAD 212e6892, git diff HEAD empty. No dist preflight: the harness imports the renderer from src.",
      "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack: 38 derived and 38 run; 37 non-vitest families exited 0 on e13c940 (exit captured per command before any pipe). vitest run scripts/: 171/174 files, with one 15 s timeout under box contention (js-comment-mask-returns-interpolation-9424); that file passed under the lock on e13c940. --ran reconciliation exit 0: 38 accounted, 0 UNRUN. overlap-check --branch=origin/claude/issue-36717-action-button-label-guard: VERDICT clean (origin/main and #37215 merge cleanly). CI on PR #37262: in_progress at report time. NOT MEASURED locally: the CI type-check lanes and CI-measured-only families, and Test UI outside packages/components.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "3 — git push (5 pushes to the branch, not REST); fleet-write relay pr_create (POST pulls + POST issues/37262/assignees); post-stamped os-dev-report comment on issue 36717",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": ["carrier: none · noted, not filed — useAutoTriggerOnce(schema, …) still interpolates schema.label into a dev-only refusal message and a toast id when name is absent. It can't throw and shows nothing to a user; it is in auto-trigger.ts, outside the file surface; recorded in the PR's Acceptance notes"]
    }
  12. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D

    Slot note · area a4-U · 2026-11-25T09:11Z

    The L1 on PR #37262 at e13c940 is REWORK (7157997155), with one should-fix: S1.

    • useAutoTriggerOnce gets the raw schema, so an object label reaches the refusal toast as [object Object].
    • The fix: hand the hook a subject that carries the guarded label, pin the refusal toast, and correct the changeset, body and Acceptance note.
    • Also add an Acceptance-notes line on the sibling components (action-menu, action-group, action-icon).

    The zone is at its three-dev cap, all p1 (#37246, #37212's rework, #37259). This p2 round runs at a free slot, after the zone's p1 lane, from the same branch and dev.

  13. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D
    os-dev-report

    {
      "issue": 36717,
      "status": "done",
      "branch": "claude/issue-36717-action-button-label-guard",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37262",
      "session": "session_01QSeKYmRepQK9DkZeU7F53D",
      "premise_still_valid": true,
      "summary": "Rework round for REWORK 7157997155; head fce37f7. S1: useAutoTriggerOnce now gets autoTriggerSubject (React.useMemo of `{ ...schema, label }` when the guarded label differs). Its refusal toast, toast id and dev warning therefore never carry [object Object] and name the action by `name`. All five label reads now go through renderableLabel. Changeset corrected: every read is guarded, and a numeric label is now dropped. CI red at da40a35 root cause: the new pin mounted through SchemaRenderer, whose node gate hides a visible:false node before the renderer mounts, so the hook never ran. That was a mounting error, not timing; it failed locally the same way. The pin now mounts the registered renderer directly, the path action:bar takes. Corrected PR body (from the live body, signed line last) is in the scratchpad. It covers N1 (numeric label dropped, in Acceptance notes and 速读), #37266 for action:menu/group/icon, and N2.",
      "tests": "New pin 'an object label never reaches the auto-trigger refusal notice' in the #36717 describe of action-button-icon-inputs-11168.test.tsx. Red: at da40a35 (CI Test UI 16/16 and locally) 'expected Mock to be called 1 times, but got 0 times', from the SchemaRenderer gate. Green at fce37f7: harness 60/60; `type-check && vitest run packages/components/src/renderers/action/` 37 files and 619 tests passed, VERDICT command-exit 0. Ablation at committed fce37f7 via scripts/ablation-replace.mjs, restoring `useAutoTriggerOnce(schema, …)` (anchor 1 to 0, blob 60bb1f19 to 426c3814): 1 failed, 4 passed, with `expected '\"[object Object]\" is not available on…' not to contain '[object Object]'`. Restore: blob equals HEAD 60bb1f19, git diff HEAD empty.",
      "gates": "At fce37f7: dispatch-gates --commands derived 38; the 37 non-vitest families all exited 0 (each exit captured before any pipe). `vitest run scripts/` was NOT re-run this round (the diff does not touch scripts/); its reading is round 1's (one contention timeout, the file passed on re-run). overlap-check --branch=HEAD before both pushes: VERDICT clean (origin/main and #37215). CI check-runs at fce37f7: 45 success, 13 skipped, 0 failed or pending, Test UI included. The CI log's 'Expected onClick listener to be a function, instead got string' warning does not reproduce in my local runs; it is not attributed to this diff, and NOT MEASURED. K=6, so no merge of main.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "1 this round — post-stamped os-dev-report comment on issue 36717 (plus git pushes, not REST). PR body not patched; corrected body at the scratchpad path for the seat to write",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": ["carrier: #37266 · action:menu / action:group / action:icon render a non-string label raw (action:menu throws on a locale map); cited in the corrected Acceptance notes"]
    }
  14. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D

    Delivered · area a4-U · 2026-11-25T13:52Z. PR #37262 merged as 08bf7d2a41 and closed this card through Fixes #36717. The delta L1 ACCEPT was 7163285438. The sibling renderers (action:menu/group/icon) and the dev-console read are carried on #37266. The pm:dispatched label comes off with this comment.

  15. removed
    pm:dispatched
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxbugdomain:uipriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions