Repository navigation
fix(plugin-grid): a grid row's Edit or Delete greyed by disabledWhen says why - #35371
Conversation
…says why Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ Co-authored-by: Claude <noreply@anthropic.com>
…id-row-action-reason
|
repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ Final head for review · area ux-2 · 2026-11-19T07:19Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head
|
|
repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ Landing · area ux-2 · 2026-11-19T07:21Z
State: draft → ready + auto-merge (merge queue). #35334 closes on merge via |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 44479076885 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ Queue red triage · area ux-2 · 2026-11-19T07:37Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ Queue red: cause found · area ux-2 · 2026-11-19T08:26Z |
…e re-queue) Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
|
repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ Re-landing · area ux-2 · 2026-11-19T10:42Z
State: ready + auto-merge (merge queue). #35334 closes on merge via |
Fixes #35334
Clause-②: no
Metadata-protocol: none
维护者速读
userActions.*.disabledWhen成立而变灰时,现在多一行说明「Not available for this record」(已有的actions.notAvailableForRecord文案,各语言已翻译),并作为该菜单项的无障碍描述;菜单项名称仍是原标签。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 declareddisabledWhenverdict alone — is whatuseDisabledReasonreceives. The item'sdisabledprop staysverdictPending || disabledByPredicate, so an item greyed only because its record-grained verdict is still loading earns no reason.useDisabledReasonis called with the other hooks, ahead of the!isVisibleearly return.menuItemReasonAria(reason)on the item (accessible name stays the label viaaria-labelledby, the reason isaria-describedby), andDisabledReasonMenuLabeldraws 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/componentspackage entry, so there is no new import surface and no new export. No new i18n key; nopackages/specchange.Tests
A new top-level
describein the existing shared harnessRowActionMenu.test.tsx(objectstack#35334):disabledWhen:aria-disabled,aria-describedbypoints at a visible element reading "Not available for this record", andgetByRole('menuitem', { name: 'Edit' | 'Delete' })is the item.aria-describedby, no reason text.aria-disabledandaria-busytrue, yet noaria-describedbyand no reason text.Acceptance notes
disabledWhenholds AND whose record-grained verdict is pending shows the reason: the reason follows the resolveddisabledWhenverdict, 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 basee4bfa339.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.no-explicit-any).Ablation — two one-shot mutations, both red, both restored to the HEAD blob
Through
scripts/ablation-replace.mjs(anchoruseDisabledReason(disabledByPredicate), hit x1 -> x0). The subject is imported by relative path fromsrc/, so nodist/leg.useDisabledReason(false)): blob6c931f72c65b->9310958693e2;Tests 2 failed | 34 passed (36)— the edit and delete "greyed by disabledWhen shows the reason" cases. Restored: blob == HEAD,git diff HEADempty.useDisabledReason(verdictPending || disabledByPredicate)): blob ->016757a93ced;Tests 2 failed | 34 passed (36)— both "greyed only by a pending verdict" controls. Restored: blob == HEAD,git diff HEADempty.Gates — derived families 38/38 run locally, all exit 0
node scripts/pm/dispatch-gates.mjs --commands(3 paths vs merge basee4bfa339a) derived 38 commands; each ran with its exit code captured before any pipe — 38 exit 0 (includingpnpm --dir ui exec vitest run scripts/:Tests 5092 passed | 2 skipped).--ranreconciliation:38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED.uicheck:new-line-citations:0 new citation(s). Type-check lanes, Test UI and the wide families are CI's.Generated by Claude Code