Repository navigation
fix(ui): a related-list New runs the parent lookup's lookupAutofill; a picker's + New seeds its dependsOn parent - #35118
Conversation
… New seeding Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
…; a picker's + New seeds its dependsOn parent Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
…ng fill as no edit Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
…ndsOn seed Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
…lated-new-autofill
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Final head for L1 · 2026-11-18T05:29ZHead-sha: |
|
repo:objectstack#1 · os-warren · session_01JQwxbXKtHccbeakAgquNs9 L1 review (#35050) · 2026-11-18T05:33ZL1: ACCEPT This is the first L1 on this PR. I read the full diff against the merge-base Half 1, the opening fill (
Half 2, "+ New" seeds the
Shape and scope.
Changeset.
Tests and evidence.
CI at this head, read from check-runs (58): 45 success, 13 skipped, none failed, none in progress. The UI lanes (Lint UI, Type Check UI, the Test UI shards and aggregate, Build & E2E UI), Lint & Repo Gates, Check Changeset, the PR-body guards, Governed Surface Queue Guard and Check PR Size are all green. The Core lanes are skipped by path filter. Must-fixNone. Should-fixNone. Notes
|
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Landing · 2026-11-18T06:05Z
Open findings: notes only (N1–N4 in the verdict). Release freeze lifted (seat comment 6970550718). State: ready + auto-merge armed by area o1-B (lease Dev-effort: high · Rounds: 1 |
Requested by Warren · project thread
Fixes #35050
Clause-②: no
Metadata-protocol: none
维护者速读
lookupAutofill(例如从商机新建报价,客户自动带出);查找选择器里的「+ 新建」会把它按dependsOn过滤的父值预填进新记录。lookupAutofill时生效,只填空目标,不覆盖打开时已有的值;编辑表单不受影响。回滚即还原本 PR。ui/packages/fields/src/widgets/LookupField.tsx(开场填充的 effect 与「+ 新建」的预填);ui/packages/components/src/renderers/form/form.tsx(onAutofill的 opening 分支改写脏基线);ui/packages/app-shell/src/hooks/useActionModal.tsx(描述符的initialValues传给新建表单)。cd ui && pnpm exec vitest run --maxWorkers=2 packages/plugin-form/src/ObjectForm.lookupAutofill-28245.test.tsx packages/fields/src/widgets/LookupField.dependsOn.test.tsx,预期全部通过。What changes
Half 1: an opening lookup value runs the same
lookupAutofillas a pick. A related list's New opens the child's create form with the relationship pre-linked (formLinkbecomesinitialValues). The value never passed through the pick handler, so the declared targets stayed empty. Now:openingValue;undefinedon an edit form).LookupFieldfills its declared targets from that record once, while the field still holds it. The record is the one hydration already reads for the chip label, so there is no second request. It uses the samedeclaredLookupAutofillPatchas a pick, with no earlier pick and withoutoverwrite, so only empty targets fill. A value the form opened with is explicit and is never replaced.onAutofillwriter takes{ opening: true }for this fill. It adds the filled values to the dirty baseline and writes them withoutshouldDirty. Opening New and closing at once therefore shows no "Discard changes?" prompt.toHostPropsforwardsopeningValuewith the other host plumbing keys. Its compile-time partition guard requires that.Half 2: the picker's "+ New" seeds its
dependsOnparent.handleCreateNewsendsinitialValuesequal to the picker's owndependentFilter: thedependsOnvalues under the remote field name (param) the candidate query filters on. It sends them through the modal descriptor and also in the one-field inline-create fallback. The record the user creates is then one the scoped picker lists. A picker with nodependsOnseeds nothing.Location outside the claimed file surface:
ui/packages/app-shell/src/hooks/useActionModal.tsx. The lookup's create goes throughexecute({ type: 'modal', modal: { objectName, mode } }), anduseActionModalturns that descriptor into the create form. It had no slot for opening values, so the seed would have been dropped there.ModalDescriptorgainsinitialValues, a descriptor-only key whose only producer is this lookup path, likeobjectName. It is read on a create only.@object-ui/app-shellis private. No spec key and no related-list prop is added.Tests
Premise, measured on
origin/main(526282e) before any code change. The new pins went red there: the prefill pins readunit_priceas''instead of'100', the modal descriptor had noinitialValues, and the inline create sent{ name: 'Pia Quill' }with no parent. Both halves reproduced.New pins:
plugin-form/src/ObjectForm.lookupAutofill-28245.test.tsx, new top-level describe:overwrite: trueincluded, and fills the rest;fields/src/widgets/LookupField.dependsOn.test.tsx, new describe:initialValuesunder theparamname;dependsOnmeans noinitialValueskey.app-shell/src/hooks/__tests__/useActionModal.objectCreateTitle-30126.test.tsx, new describe:initialValuesopen the form holding them;Ablations: one per changed behaviour, each through
scripts/ablation-replace.mjswith the anchor proven on disk and the blob restored to HEAD. Every mutation turned its pin red:initialValuesnot passedA2, A4, A5 and A6 first ran as
--replacement ''or with a replacement already present. The tool refused them as no-ops (replacement count did not rise), so no tests ran. They were re-run with--delete, or with a distinct replacement for A6. Those re-runs are the readings above.In the A5 run, the file's first test, the title pin, also failed at about 1025 ms. That is a
findByRoletimeout on a cold first test on a shared box; it passes on the unmutated tree.Acceptance notes
defaultValuesto new content while the lookup keeps the same opening value, the reset clears the filled targets and they are not filled again. No path in this repo was found that resets a create form's defaults after the lookup's hydration lands.sourcekeys count only if it carries them, the same rule as a pick.onSelectRecordhosts) keeps applying its pairs itself. It gets no opening fill, as before.Verification
See the report comment on #35050 for the local subset run on the final head: commands, exit codes and the
--ranreconciliation.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi