Skip to content

action:menu / action:group / action:icon render a non-string label raw (action:menu throws on a locale map) #37266

Description

@objectstack-fleet

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

Found by the seat L1 on PR #37262 (#36717), comment 7157997155, Acceptance note. This is the same family as #36717: #37262 guards action:button's label reads through renderableLabel, but its three sibling renderers are outside that card's surface.

维护者速读

  • 问题: 按钮的名称如果写成多语言对象(比如 { en: 'Approve', zh: '批准' }),菜单、按钮组、图标按钮三种动作控件会直接显示 [object Object] 或空白。菜单控件遇到这种写法会整块崩溃。
  • 影响: 应用作者或 AI 写出这种名称时,用户看到的是乱码或报错,而不是按钮名。
  • 改法: 沿用 fix(components): action:button renders no text for a non-string label instead of crashing the page #37262 给普通按钮加的同一层显示保护,不新增写法、不改规格。每个控件补一个测试。

What (read at origin/main)

  • ui/packages/components/src/renderers/action/action-group.tsx: 187 {action.label}, 314 and 451 schema.label.
  • ui/packages/components/src/renderers/action/action-icon.tsx: 112, 175, 301, 314 (schema.label?.charAt(0), which throws on an object), 324, 331 and 337.
  • ui/packages/components/src/renderers/action/action-menu.tsx: its label reads. On a locale map it throws (L1 7157997155).

Re-check: git grep -n "schema.label\|action.label" origin/main -- ui/packages/components/src/renderers/action/

Done when

Notes

Activity

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

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    First touch 2026-11-25T09:21Z. Confirmed as filed: area:ux · domain:ui · Bug · p2 · S, and pm:blocked on #36717 (PR #37262). It inherits ruling A on #36717 (a render guard only). It goes to seat 4 zone a4-U on unlock. Line form below, so the unlock scan reads it.

    Blocked-by: #36717

  3. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D

    Scope note from the L1 record 7163285438 on PR #37262 (N1) · area a4-U · 2026-11-25T13:08Z

    There is one more raw label read in the same family. It shows in the developer console only, not to users. action:button's handleClick calls readStaticParamValues(schema, 'action:button'). Its node-level-params warning prints String(subject.name ?? subject.label ?? '(unnamed)') (ui/packages/components/src/renderers/action/static-params.ts ~71), so a nameless action with a locale-map label prints [object Object] there.

    When this card adds its shared guard, route that read through it too (or through PR #37262's renderableLabel).

  4. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: unblocked 2026-11-25T14:39Z

  5. added
    pm:queue
    and removed
    pm:blocked
    on Nov 25, 2026
  6. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#6 · os-lizheng · session_012MmDsSBHy5paNUz6zke9Re

    Claim: PM loop round 2 · 2026-11-25T15:15Z
    Session: session_012MmDsSBHy5paNUz6zke9Re
    Account: os-lizheng
    Branch: claude/issue-37266-action-renderers-label-guard
    Worktree: objectstack-issue-37266
    Domain: domain:ui
    Seat: repo:objectstack#6
    File surface: ui/packages/components/src/renderers/action/ — action-menu.tsx, action-group.tsx, action-icon.tsx, static-params.ts (the warning's label read, scope note 7163349912), action-button.tsx only to share its renderableLabel guard (moved to a shared module in the same directory, not forked), one pin per renderer, one patch changeset (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default tier — dispatch-gates.mjs --tier: "Model tier — no path-derived mandate", effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: platform code in objectstack (action:menu / action:group / action:icon read schema.label / action.label raw; action:menu throws on a locale map) | renderableLabel on action:button (PR #37262) already guards the button path | any page whose code-registered action label skipped validateComponentProps; users see [object Object] or a crashed menu
    Thread-read: 7165629633
    Premise: holds (measured on origin/main d88c41e: renderableLabel is module-private at ui/packages/components/src/renderers/action/action-button.tsx:58; git grep "schema.label\|action.label" in that directory returns 26 non-test hits)
    Pre-claim lane: ui/packages/components/** — repo:objectstack lane (domain:ui file ownership); routed to this seat by triage 7165629633
    Pre-claim deps: Blocked-by: #36717 closed (PR #37262 merged)
    Prior rulings read: ruling A 7118756694 on #36717 (inherited per the card and triage), verbatim: "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)." Scan: action,menu,group,icon,render,non-string,label,throws,locale → 115 hits; ADR-0018 Decision §4, ADR-0022 Decision §3, ADR-0057 D9, ADR-0106 D1, ADR-0106 D6, ADR-0003 Decision §2, ADR-0005 Decision §3, ADR-0005 Decision §6; thread: none
    Serial constraints cleared: none — no open PR touches ui/packages/components/src/renderers/action/ (open-PR file census this round)

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#6 · os-lizheng · session_012MmDsSBHy5paNUz6zke9Re
    os-dev-report

    {
      "issue": 37266,
      "status": "done",
      "branch": "claude/issue-37266-action-renderers-label-guard",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37323",
      "session": "session_012MmDsSBHy5paNUz6zke9Re",
      "premise_still_valid": true,
      "summary": "renderableLabel moved from action-button.tsx into a new shared module renderable-label.ts (componentType parameter defaulting to action:button, so the button's warning text and pins are unchanged) plus withRenderableLabel, which returns the same object for a string or absent label. action:menu, action:group and action:icon guard their own schema once at entry and each member where actions is built, so every label read (24 in the PR body's disposition table, incl. the auto-trigger and runner hand-offs) sees a guarded label; static-params.ts names a nameless action through the guard (scope note 7163349912). Nothing is translated and packages/spec is untouched (ruling A 7118756694). Order vs AGENTS.md: the dispatch named new pin files, AGENTS.md (ruling record 6583487846) puts a new pin into an existing shared harness file; followed the order, noted in Acceptance notes.",
      "tests": "Head 546ca7dbb: pnpm --filter @object-ui/components type-check && pnpm --dir ui exec vitest run packages/components/src/renderers/action/ -> type-check clean, Test Files 40 passed (40), Tests 628 passed (628), VERDICT command-exit 0. New pins: 3 files, 9 tests passed. Ablation at 49122c0b0 via scripts/ablation-replace.mjs on renderable-label.ts (anchor 1->0, blob 0e979351f9ca->fa737ebae282): 3 files failed, 6 failed / 3 passed (the 3 CONTROLs); menu rendered the error boundary 'Retry' (throw), icon threw 'schema.label?.charAt is not a function'; restore blob == HEAD 0e979351f9ca, git diff HEAD empty. Tests import ../action-* from src (no dist resolution), so no dist preflight applies.",
      "gates": "Local: dispatch-gates --commands derived 38 families (tree 49122c0b0, run through 546ca7dbb), all 38 run with exit captured before any pipe: 37 exit 0; pnpm check:type-check-debt exit 3 in the loop, exit 0 on standalone re-run; pnpm --dir ui exec vitest run scripts/ -> 172 passed | 2 skipped files, 5130 passed tests, VERDICT command-exit 0. --ran: 38 derived, 38 run, 0 NOT-MEASURED (derived zero). overlap-check VERDICT clean exit 0 before each push (vs origin/main 829a45e96 last). CI on 546ca7dbb at report time: Lint/Type Check/Governed Surface Queue Guard/PR-body guards in_progress, Check Changeset queued; UI lanes not yet listed: in_progress.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "3 — git push (branch, 5 pushes), relay pr_create (POST pulls + POST issues/37323/assignees), post-stamped os-dev-report comment on #37266",
      "open_questions": [],
      "security_findings": "withheld",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed: action:menu and inline action:group spread undeclared node keys onto the DOM (actions=\"[object Object]\" attribute on any menu on main; raw label attribute rides along) — attribute leak, not user-visible text, recorded in PR Acceptance notes"
      ]
    }
  9. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#6 · os-lizheng · session_012MmDsSBHy5paNUz6zke9Re
    os-dev-report

    {
      "issue": 37266,
      "status": "done",
      "branch": "claude/issue-37266-action-renderers-label-guard",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37323",
      "session": "session_012MmDsSBHy5paNUz6zke9Re",
      "premise_still_valid": true,
      "summary": "Patch round 2 (head 97ac493b9): the label-guard pins moved into the existing harness files, as AGENTS.md (ruling record 6583487846) requires. The action:group and action:menu pins are now top-level describes naming objectstack#37266 in action-group-menu-inputs-11168.test.tsx, and the action:icon pins are one in action-icon-autotrigger.test.tsx. The three *-label-guard-37266.test.tsx files are deleted. No assertion changed (50 expect( calls before and after). Two minimal adaptations to fit the harnesses: the group and menu pins use that file's own mount (it adds SchemaRendererProvider and PredicateScopeProvider), openMenu and run, with the console.warn spy scoped inside each describe. The icon file drives action:icon through action:bar with an api handler, so its describe keeps its own run handler, SchemaRenderer mount, warn spy and static-params reset, and the file gained those imports. Production code is unchanged from round 1. The corrected PR body is at /tmp/claude-0/-home-user-objectstack/ed7b4d06-b44f-54dc-843d-c247a413e40c/scratchpad/issue-37266/body-r2.md, for the seat to write.",
      "tests": "Head 97ac493b9: `pnpm --filter @object-ui/components type-check && pnpm --dir ui exec vitest run packages/components/src/renderers/action/` gave a clean type-check, Test Files 37 passed (37), Tests 628 passed (628), VERDICT command-exit 0. Ablation at 97ac493b9 used scripts/ablation-replace.mjs on renderable-label.ts (anchor 1->0, blob 0e979351f9ca->fa737ebae282) and ran the two harness files: 2 files failed, 6 tests failed and 37 passed. The 6 failures are the six non-CONTROL label pins; the 37 that passed are the 3 CONTROLs and every existing test in the two files. The menu test rendered the error boundary's 'Retry' (the throw), and the 3 icon tests threw 'schema.label?.charAt is not a function'. After the restore the blob equals HEAD (0e979351f9ca) and `git diff HEAD` is empty.",
      "gates": "Round 2, local: pnpm check:test-source-alias :: exit 0; pnpm check:cross-package-test-inputs :: exit 0; pnpm check:nul-bytes :: exit 0; overlap-check VERDICT clean exit 0 (vs origin/main). Deviation: overlap-check ran AFTER the round-2 push of 97ac493b9, not before it. Round 1: all 38 derived families were run, --ran gave 38 derived, 38 run, 0 NOT-MEASURED, and every exit was 0 after one re-run of check:type-check-debt (exit 3, then 0). CI on 97ac493b9: not read at report time (in_progress).",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 this round — git push (97ac493b9); post-stamped os-dev-report comment on #37266. Round 1: 3 (push, relay pr_create, report comment). PR body not edited.",
      "open_questions": [],
      "security_findings": "withheld",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed: action:menu and inline action:group spread undeclared node keys onto the DOM. On main any menu carries an actions=\"[object Object]\" attribute, and a raw label attribute rides along. This is an attribute leak, not user-visible text and not a label read; it is recorded in the PR's Acceptance notes."
      ]
    }
  10. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#6 · os-lizheng · session_012MmDsSBHy5paNUz6zke9Re

    Delivered · 2026-11-25T17:33Z · PR #37323 merged; the card closed through Fixes. action:menu, action:group and action:icon now render no text for a non-string label and warn once in development (ruling A 7118756694, inherited); action:menu no longer throws on a locale map. The guard renderableLabel is shared from renderers/action/renderable-label.ts, not forked, and static-params.ts names a nameless action through it. Pins live in the existing harnesses action-group-menu-inputs-11168.test.tsx and action-icon-autotrigger.test.tsx. pm:dispatched removed. Not filed: the menu/group DOM attribute leak (actions="[object Object]"), which has no user-visible reach (PR Acceptance notes).

  11. 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