This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 6cf5999
fix(components): action:bar / action:group / action:menu members evaluate properties.params like a top-level action:button (objectui#10290) (#10786)
Fixes #10290
Clause-②: yes (widening)
## What changed
- `action:bar` evaluates an inline member's `properties` where it
composes the member for `action:button` / `action:icon`
(`withEvaluatedProperties` in `static-params.ts`). An overflow member
goes to the bar's `action:menu` as authored, and that renderer evaluates
it when it runs it, so no value is evaluated twice.
- `action:group` and `action:menu` read an item's `properties.params`,
evaluated with the same evaluator (`readMemberStaticParamValues`), and
forward it as `ActionDef.params`. An item that carries an
`ActionParam[]` list forwards both channels, as `action:button` does. A
node-level object `params` keeps its objectui#10462 handling: dropped
with one development warning; the `type: 'api'` window is unchanged when
the item carries no `properties.params`; when it carries both,
`properties.params` is forwarded and the node-level object is dropped
without a warning.
- `@object-ui/react`: the memo's per-key rule, its scope builder and its
`properties` loop move from the memo closure to module scope in
`SchemaRenderer.tsx` (`evaluateConfigValueWith`,
`configEvaluationScope`, `evaluateConfigBagWith`). The memo calls them;
its behaviour is unchanged. New exports: `useConfigBagEvaluator()`
(`hooks/useConfigBagEvaluator.ts`) and its plain half
`evaluateConfigBagInScope()` (`SchemaRenderer.tsx`). **File-surface
widening, declared:** the route needs these exports.
- Changeset `.changeset/10290-container-member-params-evaluated.md`:
`@object-ui/components` patch, `@object-ui/react` minor (Clause-②
widening: two new public exports; the fixed group releases at that
minor).
## H1: premise, measured on base `17b323e5ca`
Instrument: a one-off probe (not committed) that printed each handler's
`params`, then the committed pin file run at the base in a detached
control worktree. The page is a record page bound through
`RecordContextProvider` to `{ id: 'rec_1' }`. The member is authored
`properties.params: { objectName: 'account', recordId: '${record.id}'
}`, and the handler is `navigate_edit`.
| path | `params` the handler received | template evaluated |
|---|---|---|
| CONTROL: top-level `action:button` through `SchemaRenderer` | `{
objectName: 'account', recordId: 'rec_1' }` | yes |
| `action:bar` inline member | `{ objectName: 'account', recordId:
'${record.id}' }` | no, raw |
| `action:bar` member, `component: 'action:group'` | same raw object |
no, raw |
| `action:bar` member, `component: 'action:menu'` (overflow) |
`undefined` | values dropped |
| `action:bar` member spilled past `maxVisible` | `undefined` | values
dropped |
| `action:group`, inline display | `undefined` | values dropped |
| `action:group`, dropdown display | `undefined` | values dropped |
| `action:menu` | `undefined` | values dropped |
The `component: 'action:icon'` bar row was added to the pin after the
probe. It is red on base in the pin run below.
So PR objectui#10460 evaluates on none of the three containers, and the
premise holds. The overflow, group and menu paths did not read
`properties.params` at all.
## H2: the evaluator and the route
- **The evaluator.** Inside `SchemaRenderer`'s `evaluatedSchema` memo,
`evaluateConfigValue(key, value)` does the work. A `params` bag goes
through `mapParamsLeaves` (`utils/paramsBag.ts`) with a visitor that
calls `evaluator.evaluate` on each string leaf. Any other value goes
through `ExpressionEvaluator.evaluate` per value, with a CEL envelope
preserved and a data object passed through. `evaluator` is `new
ExpressionEvaluator(scope)` from `@object-ui/core`. Its scope is the
ambient predicate scope, plus `current_user` (an alias of `user`), plus
`record` (the RecordContext row, only when one is bound), plus `page`
(page variables). None of this was exported before this PR.
- **Route (a) taken:** each container calls that rule with that scope.
- **Route (b) not viable.** Dropdown items (the `action:group` dropdown,
`action:menu`, and the bar overflow) are `DropdownMenuItem` leaves, not
registry nodes, so `SchemaRenderer` cannot mount them. For inline
members, (b) would also run the `properties` hoist on each member, a
second run of the node visibility and enablement gate, and the
`data-obj-*` and style plumbing. That is a wider behaviour change than
the card asks for.
- **Scope each container has at hand.** Four sources: the host's `data`
row prop (what the members' `visible` / `disabled` predicates bind as
`record`), the RecordContext row, page variables and the ambient
predicate scope. The last three are the contexts `SchemaRenderer` reads,
and the containers render under the same providers.
`useConfigBagEvaluator` reads exactly the memo's three inputs. So a
member's templates bind the RecordContext row, as a top-level
`action:button`'s do. The `data` prop is not bound into the template
scope, and `SchemaRenderer` does not bind it either.
- **Why the hook lives in `hooks/` and not in `SchemaRenderer.tsx`.**
Measured: a hook declared in `SchemaRenderer.tsx` puts that file under
the React Compiler lint. The lint then reports three pre-existing
render-time `performance.now()` / `Date.now()` debug probes as
`react-hooks/purity` errors (0 without the hook, 3 with it).
## H3: `visible` / `disabled` on these paths
Measured on base with a one-off probe on the same 7 paths plus the
control. The predicates were `record.id == 'rec_1'` (true on the page),
`record.id == 'rec_2'` (false), `disabled: record.id == 'rec_1'`, and
the template form `${record.id == 'rec_1'}`.
- **With the host's `data` row passed** (as `DetailView` passes
`data={data}`): all 8 rows evaluate correctly. True renders, false is
absent, disabled-true is disabled, and the template form renders. This
is identical to the control. These gates are evaluated already, and
nothing was widened.
- **Without a `data` row** (RecordContext only): `record` is unbound on
the predicate tier, which binds `record` from the `data` prop through
`usePredicateRecordContext`. The predicates fault: fail-closed (absent)
on the `action:button` / `action:menu` leaves, fail-soft (shown) on the
`action:group` leaves. The control top-level `action:button` does the
same. This is not container-specific. It is recorded under Acceptance
notes, with no card.
## Pins and ablation
New file
`packages/components/src/renderers/action/__tests__/action-container-member-params-10290.test.tsx`,
17 tests:
- CONTROL: a top-level `action:button` through `SchemaRenderer` resolves
`${record.id}`. Green on base and head.
- 8 paths × "the handler receives `properties.params` with
`${record.id}` resolved". The paths are: bar inline, bar `action:icon`,
bar group-placed, bar menu-placed, bar spilled past `maxVisible`, group
inline, group dropdown, and menu.
- 8 paths × "a node-level `params` OBJECT is still not a values channel,
and says so once" (ruling A).
Red on base, green on head:
- base `17b323e5ca` (control worktree, same test file): `Tests 8 failed
| 9 passed (17)`. The 8 failures are exactly the 8 "resolved" rows. The
control and the 8 node-level rows are green.
- head `e8b96c0161`: `Tests 17 passed (17)`.
Ablation: one leg, through objectstack `scripts/ablation-replace.mjs` in
WRAP mode, on the committed head. In
`packages/react/src/hooks/useConfigBagEvaluator.ts`, the anchor
`evaluateConfigBagInScope(bag, predicateScope, boundRecord,
pageVariables);` became `bag; /* ABLATION-10290 */`, so the hook hands
the bag back unevaluated.
- Predicted: the 8 resolved rows go red, and the control and node-level
rows stay green.
- Observed: anchor 1 → 0, blob `8b01c529` → `f4c00a8f`, and `Tests 8
failed | 9 passed (17)`.
- Restore: blob == HEAD `8b01c529`, and `git diff HEAD` is empty.
- No build leg: the suite resolves `@object-ui/react` through the root
`vitest.config.mts` alias to `packages/react/src`, so the mutated source
is what ran.
## Gates
At head `e8b96c0161` unless noted.
- **vitest union** (repo root):
`packages/components/src/renderers/action/`, `packages/react/`, and the
scripts tests for check-action-forward-parity (plus its closing-keyword
test), check-doc-expression-carriage and check-component-surface-parity.
Result: `Test Files 130 passed (130)`, `Tests 1883 passed (1883)`, lock
`VERDICT command-exit 0`.
- **`type-check`** (`tsc --noEmit && tsc -p tsconfig.test.json`) for
`@object-ui/react` and `@object-ui/components`: Done / Done at
`a60555f057`, after `pnpm --filter @object-ui/react build`. The only
later commit is changeset text.
- The components test tsconfig includes the new pin file
(`--listFilesOnly` count 1).
- `dist/hooks/useConfigBagEvaluator.d.ts` is the only declaration of the
hook in `dist`, so the green components type-check read the rebuilt
`.d.ts`.
- **eslint** on the 8 changed `.ts` / `.tsx` files, with inline config
on (as `eslint .` runs per package): 0 errors, 48 warnings.
- Population: the root `eslint.config.js` has `files:
['**/*.{ts,tsx}']`, and there is no package-level config in
`packages/react` or `packages/components`.
- File count: 8, from `--format json`.
- No type-aware linting is configured (no `parserOptions.project` or
`projectService`), so this diff cannot move a verdict on an untouched
file.
- The same 5 pre-existing files at base: 0 errors, 49 warnings.
`SchemaRenderer.tsx` has 2 fewer `no-explicit-any` and 1 more
`react-refresh/only-export-components` (for the new plain export).
- **Green:**
- `check:action-forward-parity`, `check:new-line-citations` (0 new),
`check:control-bytes`, `check:handler-key-reads`, `check:self-import`.
- `check:unreferenced-sources`, `check:phantom-deps`,
`check:unused-deps`, `check:side-effects-array`,
`check:component-surface-parity` (report-only).
- `check:changeset-claims` (report-only). The four pending changesets it
names for `SchemaRenderer.tsx` were read, and none is falsified.
- `check:pending-changeset-literals`, `check:test-path-roots`,
`check:vi-mock-specifiers`, `check-changeset-presence.mjs`,
`check-changeset-no-major.mjs`, `check-doc-expression-carriage.mjs`.
- **NOT MEASURED:** `check:eager-closure`. Reason: exit 2, PREREQUISITE
NOT MET. There is no `apps/console/dist/eager-closure.json`, which needs
a console build. Declared to CI.
- **CI's runs:** repo-wide `pnpm lint` and the full `pnpm test`.
## Serial
- PR objectui#8941, head `bb7d5e71`, was fetched into a private ref.
`git merge-tree --write-tree` of HEAD against it exits 0 with no
conflicts. It touches `action-bar.tsx`, and the merge is clean.
- `origin/main` at `bf14b646` (5 commits past the base): merge-tree
exits 0. None of those commits touch this PR's files, so there is no
merge commit.
## Acceptance notes
- **Docs.** `content/docs/guide/record-edit-modes.md` teaches
`properties.params` on a top-level `action:button` only. The same
authoring now works on a container member. The guide was not edited,
because it is outside this order's file surface. If it is extended, it
needs one caveat: the development-build unevaluated-expression
diagnostic runs in the `SchemaRenderer` memo, so an unresolvable
template on a container member reaches the handler raw without that
report. Carrier: none named.
- **Boundary.** `element:button`'s inline `action` and `page:header`'s
actions still read no `properties.params`. They are objectui#10462
surfaces, not containers.
- **Boundary.** Take an `action:bar` member of `type: 'api'` with an
object `params`. The overflow `action:menu` reads it (the
objectstack#5777 window, entry semantics), and the inline path ignores
it (`action:button` semantics). This dates from objectui#10460 and
objectui#10462, and is not changed here.
- **Observation (H3).** The predicate tier binds `record` from the
host's `data` prop, and the template tier binds it from RecordContext.
On a host that provides RecordContext but no `data`, a `record.*`
predicate faults while a `record.*` template resolves. This predates
this PR and is identical on a top-level `action:button`. It was not
measured on a real host page.
- The two new `@object-ui/react` exports are declared `minor` (Clause-②
widening).
Session: `https://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN`
---
_Generated by [Claude
Code](https://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent fb336df commit 6cf5999
9 files changed
Lines changed: 509 additions & 43 deletions
File tree
- .changeset
- packages
- components/src/renderers/action
- __tests__
- react/src
- hooks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
| |||
327 | 331 | | |
328 | 332 | | |
329 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
330 | 342 | | |
331 | 343 | | |
332 | 344 | | |
| |||
335 | 347 | | |
336 | 348 | | |
337 | 349 | | |
338 | | - | |
| 350 | + | |
339 | 351 | | |
340 | 352 | | |
341 | 353 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
230 | 233 | | |
231 | 234 | | |
232 | 235 | | |
| |||
261 | 264 | | |
262 | 265 | | |
263 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
264 | 278 | | |
265 | | - | |
266 | | - | |
| 279 | + | |
| 280 | + | |
267 | 281 | | |
268 | 282 | | |
269 | 283 | | |
| |||
309 | 323 | | |
310 | 324 | | |
311 | 325 | | |
312 | | - | |
| 326 | + | |
313 | 327 | | |
314 | 328 | | |
315 | 329 | | |
| |||
0 commit comments