From 92c463a136b4484ed80adf3df99dc13cea465c13 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 11 Aug 2026 05:01:53 +0000 Subject: [PATCH] docs(showcase): correct RecalcSelectionAction TSDoc to the post-objectui#3142 placement rule (#7420) The TSDoc above RecalcSelectionAction narrated the pre-objectui#3142 rule as current fact: that a missing/empty `locations` is treated as "every location" by the action:bar renderer, so declaring `record_more` was an opt-out that kept the action off the list toolbar. objectui#3142 inverted that. It collapsed four disagreeing renderers onto one membership predicate (`actionRendersAt`), so an undeclared or empty `locations` now matches NO location. `packages/lint/src/validate-action-locations.ts`'s docblock states the current rule, and the whole `action-no-placement` warning exists because of it -- the lint package and this comment said opposite things about the same behavior. The declaration itself is correct either way and is unchanged: `record_more` is an explicit single-record placement (the endpoint's per-record branch, via `recordIdParam`), which incidentally also keeps the action off the toolbar -- not an opt-out of an everywhere-default. Comment lines only; the code is byte-identical after stripping comments. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GZKbx4xyF7U5WXj6ch49BM --- examples/app-showcase/src/ui/actions/index.ts | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/examples/app-showcase/src/ui/actions/index.ts b/examples/app-showcase/src/ui/actions/index.ts index 7072b37fd6..159764a8ef 100644 --- a/examples/app-showcase/src/ui/actions/index.ts +++ b/examples/app-showcase/src/ui/actions/index.ts @@ -138,14 +138,25 @@ export const RecalcEstimateAction = defineAction({ * shape, minus the zip). Contrast with RecalcEstimateAction above: same * endpoint, one POST per record. * - * `locations` still has to be declared, even though the selection bar entry - * comes from the view. Omitting it does NOT mean "nowhere": the action:bar - * renderer treats a missing/empty `locations` as "every location" - * (objectui `action-bar.tsx`), so a locations-less action also lands on the - * LIST TOOLBAR — where there is no selection, so the dispatch posts no - * `_selectedIds` and the endpoint rejects it. Declaring `record_more` keeps - * the single-record entry somewhere it works (the endpoint's per-record - * branch, via `recordIdParam`) and off the toolbar. See objectui#3142. + * `locations` is a SEPARATE declaration from that selection-bar entry, which + * the view owns. It is not redundant, and it is not an opt-out of anything: + * since objectui#3142 an action renders at a location only if it DECLARES + * that location. That release collapsed four disagreeing renderers onto one + * membership predicate (`actionRendersAt`, objectui + * `packages/types/src/ui-action.ts`), so a missing or EMPTY `locations` + * matches NO location at all — an action nobody placed has no UI surface, + * which is precisely the inert shape this repo's `action-no-placement` rule + * warns about (`packages/lint/src/validate-action-locations.ts`), and `[]` is + * that same nowhere said deliberately (see NewTaskAction). + * + * So `record_more` here is an explicit SINGLE-RECORD placement, not a way of + * dodging an everywhere-default: it puts the action in the record overflow + * menu, where the dispatch carries exactly one id and the recalc endpoint's + * per-record branch handles it (via `recordIdParam`). Placement being + * declared rather than inherited is also what keeps the action off the LIST + * TOOLBAR — a toolbar dispatch would carry neither a selection (no + * `_selectedIds`) nor a record id, and the endpoint would reject it — but + * that is a consequence of naming one location, not the reason for naming it. */ export const RecalcSelectionAction = defineAction({ name: 'showcase_recalc_selection',