Repository navigation
Commit 3fa1938
docs(plugin-form): object-master-detail-form's fields description says it bounds what is drawn; Save also writes seeded initialValues (objectui#11114) (#11149)
Fixes #11114
Clause-②: no
The `object-master-detail-form` registration called its `fields` input
"the submitted set". Save writes more than that: a parent value seeded
through `initialValues` (or `initialData`) that `fields` does not list
is written too. The triage ruling on the card (comment 5893817922) keeps
the behaviour and corrects the text, so that is what this PR does. ⛔ No
behaviour changes; the parent leg is not filtered to `fields`.
## What changed
- `packages/plugin-form/src/index.tsx`: the `fields` input's
description. Only the clause "this key is also the parent pool for
values, create defaults and the submitted set" is replaced; the rest of
the sentence is byte-identical. It now says `fields` bounds what the
form DRAWS and edits, and that on a create the submitted set is the
drawn fields plus any parent value seeded through `initialValues` (or
its alternate spelling `initialData`), drawn or not. It adds one
qualifier the probes below measured: a seed for an undeclared,
server-owned, computed or read-only field is still stripped, as on any
save.
-
`packages/plugin-form/src/__tests__/topLevelFieldsWarnCoverage-8847.test.tsx`:
the pin 「the key bounds what is DRAWN, not what the parent leg WRITES」
keeps its direction, its title and its assertion. Its header bullet and
the inline comment above the assertion now cite the ruled behaviour
instead of describing it as "handed back".
- `packages/plugin-form/src/ObjectForm.tsx`: comment only, see the
surface note below.
- `.changeset/11114-master-detail-fields-text.md`:
`@object-ui/plugin-form` patch.
## Measured at `385ebc5c6` (the dispatch's mechanism assumptions)
1. Premise holds: the clause and the pin were both present as the card
says.
2. Real `MasterDetailForm` mounted in create mode, `fields: ['status']`,
the create Save clicked, the batch's parent leg read from
`dataSource.batchTransaction` (throwaway probe file, deleted; not
committed):
- `initialValues: { status, note }` gives a parent leg carrying `note`,
which is not drawn. Same with `initialData` as the seed.
- A seed for a key the object does not declare is dropped. Seeds for a
`readonly` field, a `formula` field and `owner_id` are dropped.
- `details[].totalField` writes its rollup onto the parent whatever
`fields` lists (`total: 0` in the probe).
- An object field `memo` with a static `defaultValue` that `fields` does
not list, and that nobody seeded, is written (`memo: 'object-default'`).
This is the dispatch's "different defect" question; it is reported on
the card, not changed or described here.
3. Published: `object-master-detail-form` is in the public block tier,
and `manifestFromConfigs` copies each input's `description` verbatim. A
throwaway probe over the real registry read the plugin-form manifest
entry after this change: the new sentence present, the old clause
absent, and an unchanged phrase of the same description ("the two
INTERSECT") present as the positive control. No generated file in this
repo carries the text (`git grep` for the description's opening words
finds `index.tsx` only), so nothing here is regenerated. The pinned
`sdui.manifest.json` copy that objectstack holds follows at its own
sync.
## Surface note
The claimed file surface was `index.tsx`, the 8847 pin and a changeset.
One file is beyond it: the comment in `ObjectForm.tsx` beside the
sections/fields intersection said `fields` is "the parent field pool for
values, create defaults and the submitted set". That is the same false
claim in the implementation, and the description's own wording derives
from it. It is corrected in place under the bounded exemption, with all
four conditions checked: same defect class; a mechanical comment
rewording; no open PR touches `ObjectForm.tsx` (the open PR list's file
sets were read); no gate family beyond this PR's. The surface is
supplemented here rather than in a new claim.
## Not touched (Acceptance notes)
- `apps/console/src/__tests__/registry-inputs-spec-parity.test.ts`: the
ledger row `pins:` for `object-master-detail-form.fields` still says
"the registration calls this key the parent pool for 'the submitted
set'", which is now stale, and so does the historical slice-18 docblock.
Left alone because open PR objectui#11086 holds that file. Both belong
to whoever next edits it.
- `sectionEntryOverrides-10475.test.tsx` quotes the earlier card wording
"values, create defaults and the submitted set stay pool-driven" inside
a quotation; not edited.
- Pending changeset `8738-object-form-fields-description.md` names
`ObjectForm.tsx` (flagged by `check-changeset-claims`, report-only);
read, still true.
- The `initialValues` input's own description ("Values to prefill on the
PARENT record in `create` mode.") is unchanged; the `fields` description
now carries the fact.
## Verification
- `pnpm exec vitest run` on the 8847 pin plus the three sibling
master-detail member files: 4 files, 29 tests passed.
- `pnpm exec vitest run` on the console's registry consumers
(`registry-inputs-spec-parity`, `masterDetailFormTypeManifest`,
`masterDetailFormI18nLabelManifest`, `public-contract`,
`public-block-binding-reach`): 5 files, 257 tests passed.
- `pnpm --filter @object-ui/plugin-form type-check` after `pnpm
--workspace-concurrency=2 --filter '@object-ui/plugin-form^...' build`
(the dependency closure): exit 0.
- `pnpm exec eslint --no-inline-config` on the three changed source
files: 3 files linted, 0 errors, 86 warnings, none on a changed line.
- `check-changeset-presence`, `check-control-bytes`,
`check:new-line-citations`, `changeset:check`: exit 0 each, re-run at
`813b8826f` for the first three.
- No reverse verification or ablation: the change is text only and no
behaviour moved, so there is nothing that could turn red.
---
_Generated by [Claude
Code](https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3f61eef commit 3fa1938
4 files changed
Lines changed: 24 additions & 12 deletions
File tree
- .changeset
- packages/plugin-form/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1650 | 1650 | | |
1651 | 1651 | | |
1652 | 1652 | | |
1653 | | - | |
1654 | | - | |
1655 | | - | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
1656 | 1658 | | |
1657 | 1659 | | |
1658 | 1660 | | |
| |||
Lines changed: 9 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
275 | 276 | | |
276 | 277 | | |
277 | 278 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
| 482 | + | |
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
| |||
0 commit comments