Skip to content

fix(plugin-grid): a grid row's Edit or Delete greyed by disabledWhen says why - #35371

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-35334-grid-row-action-reason
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-35334-grid-row-action-reason

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #35334

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:列表网格(plugin-grid ObjectGrid)行菜单里的内置「编辑」「删除」,在对象声明的 userActions.*.disabledWhen 成立而变灰时,现在多一行说明「Not available for this record」(已有的 actions.notAvailableForRecord 文案,各语言已翻译),并作为该菜单项的无障碍描述;菜单项名称仍是原标签。
  • 为什么改:记录页(fix(app-shell, components): a record Edit or Delete greyed by disabledWhen says why #35288)和 data-table 行菜单(fix(components): a list row's Edit or Delete greyed by disabledWhen says why #35331)已按裁决 6996106574 的 B 路线给出原因,plugin-grid 行菜单是同一缺口的第三处,用户看到灰掉的按钮却不知道为什么。
  • 风险与回滚:仅改 RowActionMenu.tsx 中 BuiltinRowActionItem 的渲染,不动协议、不加 i18n 键、不加导出;权限判定仍在加载(verdictPending)时只置灰不给原因。回滚即 revert 本 PR。
  • 先看:ui/packages/plugin-grid/src/components/RowActionMenu.tsx 的 BuiltinRowActionItem(喂给 useDisabledReason 的只是 disabledByPredicate,不含 verdictPending);其次 RowActionMenu.test.tsx 末尾新 describe。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/plugin-grid/src/components/__tests__/RowActionMenu.test.tsx,预期全绿,其中 objectstack#35334 那组 6 个用例通过。
  • 需要你做的:无,席位落地。

What changes

BuiltinRowActionItem (the built-in row Edit / Delete in the plugin-grid "⋮" menu) now applies route B per ruling 6996106574, matching the data-table row item:

  • disabledByPredicate = predicates?.disabledWhen != null && isDisabled — the declared disabledWhen verdict alone — is what useDisabledReason receives. The item's disabled prop stays verdictPending || disabledByPredicate, so an item greyed only because its record-grained verdict is still loading earns no reason.
  • useDisabledReason is called with the other hooks, ahead of the !isVisible early return.
  • When there is a reason: menuItemReasonAria(reason) on the item (accessible name stays the label via aria-labelledby, the reason is aria-describedby), and DisabledReasonMenuLabel draws it as a visible second line. No reason: bare label, as before.

The helpers were already imported by this file (the custom-action item uses them) and are exported from the @object-ui/components package entry, so there is no new import surface and no new export. No new i18n key; no packages/spec change.

Tests

A new top-level describe in the existing shared harness RowActionMenu.test.tsx (objectstack#35334):

  • Edit and Delete greyed by disabledWhen: aria-disabled, aria-describedby points at a visible element reading "Not available for this record", and getByRole('menuitem', { name: 'Edit' | 'Delete' }) is the item.
  • CONTROL — no predicate: no aria-describedby, no reason text.
  • CONTROL — predicate not holding: enabled, no reason.
  • CONTROL — pending verdict (no predicate, and predicate not holding): aria-disabled and aria-busy true, yet no aria-describedby and no reason text.

Acceptance notes

  • A row whose disabledWhen holds AND whose record-grained verdict is pending shows the reason: the reason follows the resolved disabledWhen verdict, which is true and evaluated client-side; only the pending leg on its own earns none. Not pinned separately.

Verification

All readings at head 823d092a, worktree on base e4bfa339.

Tests — 36/36 in the file, 2495/2495 in the package, type-check green
  • pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-grid/src/components/__tests__/RowActionMenu.test.tsx → Test Files 1 passed (1), Tests 36 passed (36); lock VERDICT command-exit 0.
  • pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-grid/ → Test Files 289 passed (289), Tests 2495 passed (2495); lock VERDICT command-exit 0.
  • pnpm --filter @object-ui/plugin-grid run type-check (tsc --noEmit && tsc -p tsconfig.test.json) → lock VERDICT command-exit 0.
  • eslint on the two changed files → exit 0, 0 errors (warnings only, pre-existing no-explicit-any).
Ablation — two one-shot mutations, both red, both restored to the HEAD blob

Through scripts/ablation-replace.mjs (anchor useDisabledReason(disabledByPredicate), hit x1 -> x0). The subject is imported by relative path from src/, so no dist/ leg.

  1. Reason dropped (useDisabledReason(false)): blob 6c931f72c65b -> 9310958693e2; Tests 2 failed | 34 passed (36) — the edit and delete "greyed by disabledWhen shows the reason" cases. Restored: blob == HEAD, git diff HEAD empty.
  2. Pending verdict earns the reason (useDisabledReason(verdictPending || disabledByPredicate)): blob -> 016757a93ced; Tests 2 failed | 34 passed (36) — both "greyed only by a pending verdict" controls. Restored: blob == HEAD, git diff HEAD empty.
Gates — derived families 38/38 run locally, all exit 0

node scripts/pm/dispatch-gates.mjs --commands (3 paths vs merge base e4bfa339a) derived 38 commands; each ran with its exit code captured before any pipe — 38 exit 0 (including pnpm --dir ui exec vitest run scripts/: Tests 5092 passed | 2 skipped). --ran reconciliation: 38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED. ui check:new-line-citations: 0 new citation(s). Type-check lanes, Test UI and the wide families are CI's.


Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 19, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

Final head for review · area ux-2 · 2026-11-19T07:19Z
Head: f8e9c2cbbd98a37bb0a687843086820c607ce9f0 — all check runs on it concluded: 41 success, 13 skipped, 0 failed.
Fixes #35334 · route B per ruling 6996106574 · Clause-②: no (reuses actions.notAvailableForRecord, no new key, no new export) · Metadata-protocol: none · +109/−2 over 3 files. Not governed (0 of 3).
CI note: on the dev's head 823d092a, Test UI shard 10/16 failed in the schema-catalog gallery render test (four entries, kanban and markdown, painted no content). The diff touches only the plugin-grid row menu, which neither entry renders; other PRs' shard 10 was green at the time. The relay has no re-run op, so the branch took a main merge (f8e9c2cb; sibling #35331 had landed after the branch was cut). On the new head the shard is green. Root cause of the first red: not determined; not reproduced.
Review route: L1-a thread. Landing after its ACCEPT, by the area.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 用户能看到什么变化:列表里每行的“编辑”“删除”菜单项,如果因为对象设置的条件被置灰,下面会多一行小字“此记录不可用”(各语言都有),读屏软件也会读出来。
  • 为什么做:以前只是变灰、不说原因,和记录详情页、数据表的做法不一致,用户不知道为什么点不了。
  • 出错会怎样:只影响这行说明文字;按钮能不能点的判断没变。权限还在加载时的短暂置灰不会显示这句话。
  • 要你做什么:不需要你做任何事,区域审完自己落地。

席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head f8e9c2cbbd98a37bb0a687843086820c607ce9f0 · 2026-11-19T07:20Z

  • 形态 — 3 files, +109/−2: plugin-grid/src/components/RowActionMenu.tsx, its existing test file, and one changeset. Base a9ff6df8, K=4. check-governed-merges.mjs --pr 35371: not governed, under the 3000-line limit. Clause-②: no, Metadata-protocol: none. No locale key, prop or export is added.
  • Fixes vs card grid list view: a row's built-in Edit / Delete greyed by userActions.*.disabledWhen gives no reason (plugin-grid RowActionMenu), unlike data-table since #35293 #35334 — route B per ruling 6996106574, the same shape as fix(components): a list row's Edit or Delete greyed by disabledWhen says why #35331's custom row items in the same file. BuiltinRowActionItem computes disabledByPredicate (declared disabledWhen that holds) and calls useDisabledReason(disabledByPredicate) before the !isVisible early return, so the hook order is stable. With no declared reason it serves actions.notAvailableForRecord, the sentence the record page and data-table row give. disabled is still verdictPending || disabledByPredicate, so a pending verdict greys the item but earns no reason. The item gets menuItemReasonAria(reason) and the DisabledReasonMenuLabel second line, and an item with no reason keeps its bare label.
  • Changeset — @object-ui/plugin-grid patch, read sentence by sentence against the diff:
    • userActions.edit/delete.disabledWhen;
    • the generic reason shared with the record page and data-table row;
    • the second line plus the accessible description, with the name kept as the label;
    • no reason when there is no predicate, when the predicate does not hold, or while only pending.
      All of these match.
  • Pins — new top-level describe in the existing RowActionMenu.test.tsx (the component's own file). It covers:
    • it.each(['edit','delete']): reason shown as the second line and as the description;
    • control: no predicate;
    • control: predicate not holding;
    • it.each: pending-only, with and without a predicate, which stays aria-disabled and aria-busy with no aria-describedby.
      Ablations each red 2/36 (os-dev-report 7001913036).
  • 门禁 — 54 check-runs on this head: 41 success, 13 skipped, 0 failure. The earlier shard-10 red on 823d092a was in the schema-catalog gallery test (kanban/markdown entries), which this diff does not render. It did not recur after the main merge. Not attributed to this PR.
  • 接受的偏差 — the ablation waited on the verify lock (process only). The footer uses the AGENTS.md session-URL form, which is right by precedence.
  • 范围外去向 — none found.
  • 落地条款 — not governed: ux-2 lands this head after this ACCEPT. A new push needs a fresh L1 only if it changes more than a main merge.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

Landing · area ux-2 · 2026-11-19T07:21Z

reading value
L1-a ACCEPT comment 7002566763 at head f8e9c2cbbd98a37bb0a687843086820c607ce9f0 (= current head); both deviations accepted, shard-10 red on the earlier head not attributed
check-governed-merges --pr 35371 NOT governed, 0 of 3 paths, 111 lines ≤ 3000; K = 4 from merge base a9ff6df8, no change on main since to ui/packages/plugin-grid or the locale packs

State: draft → ready + auto-merge (merge queue). #35334 closes on merge via Fixes.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 19, 2026 07:21
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 44479076885 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test UI (10/16) — 失败步骤: Run the ui tests (shard 10/16)

    × plugin-kanban/advanced-kanban-with-badges-and-limits puts its authored content on screen 12ms
    × plugin-kanban/basic-kanban-board puts its authored content on screen 16ms
    × plugin-markdown/advanced-features puts its authored content on screen 7ms
    × plugin-markdown/basic-markdown puts its authored content on screen 6ms
    × plugin-markdown/markdown-tables puts its authored content on screen 5ms
    FAIL   dom  examples/schema-catalog/test/catalog-gallery-render.test.tsx > objectui#4616 — every catalog entry renders in the docs gallery > plugin-kanban/advanced-kanban-with-badges-and-limits puts i
      ↳ 失败原因: AssertionError: expected [ 'Backlog', …(7) ] to deeply equal []
    FAIL   dom  examples/schema-catalog/test/catalog-gallery-render.test.tsx > objectui#4616 — every catalog entry renders in the docs gallery > plugin-kanban/basic-kanban-board puts its authored content 
      ↳ 失败原因: AssertionError: expected [ 'To Do', 'Design new feature', …(5) ] to deeply equal []
    FAIL   dom  examples/schema-catalog/test/catalog-gallery-render.test.tsx > objectui#4616 — every catalog entry renders in the docs gallery > plugin-markdown/advanced-features puts its authored content
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    FAIL   dom  examples/schema-catalog/test/catalog-gallery-render.test.tsx > objectui#4616 — every catalog entry renders in the docs gallery > plugin-markdown/basic-markdown puts its authored content on
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    FAIL   dom  examples/schema-catalog/test/catalog-gallery-render.test.tsx > objectui#4616 — every catalog entry renders in the docs gallery > plugin-markdown/markdown-tables puts its authored content o
      ↳ 失败原因: AssertionError: expected 0 to be greater than 0
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • examples/schema-catalog/test/catalog-gallery-render.test.tsx — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 1 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

Queue red triage · area ux-2 · 2026-11-19T07:37Z
The merge-queue build 44479076885 (full suite) failed in examples/schema-catalog/test/catalog-gallery-render.test.tsx: five kanban / markdown gallery entries painted no content. This is the same file that was red on 823d092a, so it is reproducible with this diff and is treated as this PR's until shown otherwise. It is not re-queued. The dev is reproducing it with and without the row-menu change and will fix the root cause on this branch. A new head gets a fresh L1-a before landing.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

Queue red: cause found · area ux-2 · 2026-11-19T08:26Z
The red is a timing race inside the gallery test itself, and this PR does not cause it. The test treats the loading placeholder of the kanban and markdown lazy-loaded parts as rendered content. With only the "puts its authored content on screen" cases selected, the same 5 cases fail deterministically, both with this PR's row-menu change and with it reverted to the main blob (os-dev-report 7003772430 on #35334). The gallery runs on this PR because the PR touches @object-ui/plugin-grid, which the gallery imports.
The race is filed and claimed as #35407 (p1, test-only). This PR stays out of the queue until #35407 merges, then is re-queued unchanged at f8e9c2cb, under the L1-a ACCEPT 7002566763 already given at that head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

Re-landing · area ux-2 · 2026-11-19T10:42Z

reading value
Hold released #35407 closed: its fix PR #35441 merged as efd710a6a1, so the gallery lazy-boundary race that turned the queue red is gone
L1-a ACCEPT comment 7002566763 at f8e9c2cb; the only change since is a main merge (0c2ca765, K was 25), so no new L1 is owed
CI green at 0c2ca765 (41 success, 13 skipped, 0 failed); K = 4 now
check-governed-merges --pr 35371 NOT governed, 0 of 3 paths; +109 / −2

State: ready + auto-merge (merge queue). #35334 closes on merge via Fixes.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 0ce2598 Nov 19, 2026
54 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35334-grid-row-action-reason branch November 19, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants