Repository navigation
fix(components): a list row's Edit or Delete greyed by disabledWhen says why - #35331
Conversation
…ays why Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
|
repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ Final head for review · area ux-2 · 2026-11-19T05:34Z |
|
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-19T05:36Z
State: draft → ready + auto-merge (merge queue). #35293 closes on merge via |
Requested by Bill · project thread
Fixes #35293
repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ
Clause-②: no
Metadata-protocol: none
维护者速读
userActions.edit.disabledWhen(或delete.disabledWhen)且条件成立而变灰时,现在在菜单项标签下方显示第二行原因「对此记录不可用」(已有通用句,11 种语言已有翻译),读屏也能读到;与 fix(app-shell, components): a record Edit or Delete greyed by disabledWhen says why #35288 给记录页「···」菜单的样子一致。ui/packages/components/src/renderers/complex/data-table.tsx的DataTableBuiltinRowActionItem(原因只在声明的disabledWhen成立时给,且在提前返回之前调用钩子);data-table-builtin-row-action-predicates.test.tsx新增的 describe。pnpm --dir ui exec vitest run packages/components/src/renderers/complex/__tests__/data-table-builtin-row-action-predicates.test.tsx,预期 9 条全绿,其中「a disabledWhen-greyed item says why」4 条通过。What changes
DataTableBuiltinRowActionItem(the data-table row menu's built-in Edit / Delete) now hands itsdisabledWhenverdict to the existinguseDisabledReasonhook, the oneDataTableRowActionItemin the same file already uses for custom row actions. When the declareddisabledWhenholds, the item shows the genericactions.notAvailableForRecordsentence as a visible second line under its label (DisabledReasonMenuLabel) and as its accessible description (menuItemReasonAria); its accessible name stays the label. That is the overflow-entry face fix(app-shell, components): a record Edit or Delete greyed by disabledWhen says why #35288 gave the record page.userActionsdeclares no reason key, so the sentence is always the generic one (ruling 6996106574, route B).packages/spec/**change, no new i18n key, no new exported prop or type.Tests
Local runs, head 2170bf0
data-table-builtin-row-action-predicates.test.tsx: Edit and Delete greyed bydisabledWhenshow the reason as a visible second line and description, and are still found by rolemenuitemwith the label as name; controls: no predicate gives no reason, a predicate that does not hold gives no reason.pnpm --dir ui exec vitest runon the 4 data-table row-action files:Test Files 4 passed (4),Tests 48 passed (48), lockVERDICT command-exit 0.data-table*.test.tsxfiles in@object-ui/componentsplus the 7 ui test files outside it that render built-in row predicates (plugin-detail, plugin-designer, plugin-view, app-shell):Test Files 42 passed (42),Tests 262 passed (262), lockVERDICT command-exit 0. plugin-grid has its own row item and is not touched.pnpm --filter @object-ui/components run type-check(bothtsc --noEmitandtsc -p tsconfig.test.json): lockVERDICT command-exit 0.scripts/ablation-replace.mjs:useDisabledReason(disabled)replaced withuseDisabledReason(false)(anchor 1 to 0, blobd0f38ee7to07aaebe3). Result:Tests 2 failed | 7 passed (9); the two red are the two positive pins (edit, delete), every control stayed green. Restored by the tool: blob back tod0f38ee7= HEAD blob,git diff HEADempty. No dist step: the test imports the component from source by relative path.Acceptance notes
data-table.tsx): plugin-grid'sBuiltinRowActionIteminui/packages/plugin-grid/src/components/RowActionMenu.tsx, the row menuObjectGriddraws for an object's list view, greys the built-in Edit / Delete underdisabledWhenwith the same silence (DropdownMenuItem disabledplus label, no reason). Named producer: the showcaseinvoiceobject declaresuserActions.edit.disabledWhenonrecord.status == 'paid'. Reported to the seat for the family.Verification
Gate families derived for this diff
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat 2170bf0 derived 38 families; all 38 ran locally and exit 0 (--ranreconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN, a derived zero with every exit code recorded).pnpm --dir ui exec vitest run scripts/:Test Files 171 passed | 2 skipped (173).pnpm check:new-line-citations:0 new citation(s).test:repo, repo-wide scans and the remaining CI families are CI's.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ