Skip to content

plugin-grid's RowActionMenu mirrors all four hand-restated predicate shapes #4354 just collapsed in components — same derivation fix, same vacuous test case #4429

Description

@yinlianghui

Filed by the PM seat from PR #4423's risk list (the #4354 implementation), which flagged the mirror without re-filing — making it a card is the PM's call, and the call is yes: the fix pattern is proven and the surface is free.

Fact (from PR #4423's sweep — re-verify at branch point)

packages/plugin-grid/src/components/RowActionMenu.tsx carries the mirror of all four restatements #4354 collapsed in packages/components' data-table:

  • its own isBuiltinRowActionVisible with a hand-written { visibleWhen?: unknown } parameter
  • its own planRowActionMenu with hand-written editPredicates/deletePredicates
  • its item component with a hand-written full-pair predicates declaration
  • a local disabledWhen?: unknown (~line 65)

And its emptyGuard test has the same vacuous planner-level case (still counts an item that renders merely DISABLED, ~line 455) that asserts the planner's return while the planner never reads disabledWhen.

The fix — inherit PR #4423's proven pattern wholesale

  1. Derive all four from the authoring types the grid actually receives (measure whether the grid's predicates flow from DataTableSchema's twins or a grid-own schema key — derive from the TRUE source, per-key Pick for the planner, union alias for shared both-builtin consumers, exactly the two principled styles PR refactor(components): derive the row-menu predicate parameters from the authoring type (#4354) #4423 documented).
  2. The rider transfers: measure whether disabled-item counting is observably pinned at the GRID's table level; if not, add the DOM pin (trigger persists + aria-disabled item found on open) and rename the vacuous case to the verdict it actually decides.
  3. The RV method transfers too, including the built-.d.ts rebuild trap (rebuild the types dist before trusting a rename simulation).

Related: #4354 / PR #4423 (the pattern + all measurements), #3009 (the hand-copy family).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions