Skip to content

Commit de3023f

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/issue-24065-ooo-notification-names
2 parents 26ca62a + 462d02f commit de3023f

3 files changed

Lines changed: 34 additions & 14 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
Clause-②: no
6+
7+
The `ActionParam` `options` docblock in `src/ui/action.zod.ts`, and the comment above that option
8+
shape's `guidance` table, no longer say that objectui's `normaliseOptions` rebuilds each option a
9+
field-backed param inherits as a bare `{ label, value }` pair. At the console pin (`.objectui-sha`
10+
`f8267df93aba`) it keeps every key of an inherited option by spread
11+
(`packages/fields/src/resolveActionParams.ts:515` in objectui). The comments now give the reason
12+
that remains for the `guidance` texts not telling an author to make a param field-backed and
13+
inherit `color`, `icon` or `disabled`: the keys survive, but no reader of them on that path is
14+
measured. No key, schema, export, accepted value or message text changes.

‎packages/spec/src/ui/action.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,8 +1754,9 @@ describe('action param option vocabulary — declared only where a renderer deli
17541754

17551755
// `color`: real one layer down, on the STORED-value display path. The
17561756
// sentence must no longer defer to #5016 as an open question — it is
1757-
// decided — and must not promise the field-backed inheritance route, which
1758-
// `normaliseOptions` still drops (ledger finding 18).
1757+
// decided — and must not promise the field-backed inheritance route:
1758+
// objectui's `normaliseOptions` keeps the key by spread, but no reader of
1759+
// it on that route is measured (ledger finding 18).
17591760
const color = messageFor({ label: 'A', value: 'a', color: 'red' });
17601761
expect(color).toContain('SelectOptionSchema');
17611762
expect(color).not.toContain('do not rely on it today');

‎packages/spec/src/ui/action.zod.ts‎

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -265,15 +265,18 @@ export const ActionParamSchema = lazySchema(() => strictObject(
265265
* `default` it would actively mislead, since a dialog param defaults
266266
* through `defaultValue` one level up.
267267
*
268-
* **What this does NOT fix**, deliberately, because it is objectui's and not
269-
* the spec's: a FIELD-BACKED param that inherits its list instead of declaring
270-
* one still loses the key. `resolveActionParam` reaches
271-
* `param.options ?? normaliseOptions(field.options, …)`, and `normaliseOptions`
272-
* rebuilds every inherited entry as `{ label, value }`. That drop predates
273-
* this change, is invisible to it (an authored `options` array wins over the
274-
* inherited one), and is tracked in objectui — so the guidance below still
275-
* refuses to prescribe "make it field-backed and inherit" (ledger finding 18:
276-
* a confidently wrong prescription is worse than none).
268+
* **A FIELD-BACKED param that inherits its list** instead of declaring one
269+
* takes objectui's path, not the spec's. At the console pin (`.objectui-sha`
270+
* `f8267df93aba`), objectui's `packages/fields/src/resolveActionParams.ts`
271+
* resolves it as `authoredOptions ?? normaliseOptions(field.options, …)`
272+
* (`:650`–`:651`), and `normaliseOptions` returns
273+
* `{ ...raw, label, value: raw.value }` per entry (`:515`), so every key of an
274+
* inherited entry survives the resolver. An authored `options` array still
275+
* wins over the inherited one. Surviving is not being read: no reader of
276+
* `color` / `icon` / `disabled` on an inherited option is measured from this
277+
* repo, so the guidance below still refuses to prescribe "make it
278+
* field-backed and inherit" (ledger finding 18: a confidently wrong
279+
* prescription is worse than none, and an unmeasured one is no cure for it).
277280
*
278281
* The aliases are anchored on `SelectOptionSchema`'s own curated table (the
279282
* same idea, one layer down) rather than on edit distance, and deliberately
@@ -307,9 +310,11 @@ export const ActionParamSchema = lazySchema(() => strictObject(
307310
// The per-option keys that are real one layer down but have no reader on
308311
// THIS path, plus the two that no spec shape declares at all. Each says
309312
// where the vocabulary lives and — critically — does NOT promise that a
310-
// field-backed param inherits it: `resolveActionParams`' `normaliseOptions`
311-
// rebuilds each inherited entry as `{ label, value }`, so that promise
312-
// would be false in exactly the way ledger finding 18 warns about.
313+
// field-backed param inherits it. objectui's `normaliseOptions` keeps an
314+
// inherited entry's keys by spread (the `options` docblock above cites the
315+
// pin and line), but no reader of them on the inherited path is measured
316+
// from this repo, so that promise would be an unmeasured one in exactly
317+
// the way ledger finding 18 warns about.
313318
//
314319
// `visibleWhen` is deliberately absent: it is a declared key now, and
315320
// `guidance` is consulted only from the `unrecognized_keys` path, so an

0 commit comments

Comments
 (0)