Skip to content

fix(fields): a pick leaves an amount in another currency empty and says why - #36351

Merged
os-zhuang merged 10 commits into
mainfrom
claude/project-thread-ztnojr
Nov 22, 2026
Merged

os-zhuang merged 10 commits into
mainfrom
claude/project-thread-ztnojr

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTM6Q7J3o7taPraVR2

Fixes #36249

Builds Done-when item 1 as ruled. Item 2 landed in PR #36293.

Clause-②: yes (narrowing) — a cross-currency price copy that happens today stops and the line is left empty with a stated reason (ruled B); widened: three new @object-ui/i18n lookup.autofill* keys in every locale pack, new @object-ui/fields exports from lookupAutofill.ts (planDeclaredLookupAutofill, crossCurrencyRefusal, amountCurrencyOf, pickedAmountCurrencyOf, withheldAutofillMessage, withLookupAutofillTargets, readLookupAutofillTargets, LOOKUP_AUTOFILL_TARGETS_KEY and their types), an optional second argument on onSelectRecord, an optional trailing currency parameter on declaredLookupAutofillPatch and lookupAutofillPatch, and the optional columnFields prop on GridField
Metadata-protocol: semantic
Skills-docs: follow-up #36349
Ruling-ref: 7075336705 (maintainer 「B 币种不同就不填并说明」, 2026-11-22T06:26Z, card #36249)

维护者速读

在外币发票(例如欧元发票)里选产品时,单价不再把本币价格原样抄成欧元,而是留空,并在该行下方写明产品原价和两种币种,由用户手动填写;本币发票照旧自动填。
这是多币种发票卡片的第一项,按你选的方案(币种不同就不填并说明)执行。
如果规则有误,外币明细的单价会多一步手填,本币单据不受影响;可以直接撤回这一个合并。
无

What changes

  • One rule, three fill paths. crossCurrencyRefusal in ui/packages/fields/src/widgets/lookupAutofill.ts decides whether a picked value may be copied into the field it fills. An amount is a currency field or a formula returning currency. Both in the home currency: copies, also with no home currency configured. Otherwise it copies only when both sides name the same known code (fixed, the record's code, or the master_detail parent's code; the home currency counts as its configured code). A number copies as before. A target following a record with no code yet is not filled. Nothing converts.
    • Grid same-named copy and grid declared pairs: planLookupAutofill (GridField.tsx). The picked value's currency is its field's on the referenced object, which the lookup cell already reads for its labels and now hands to onSelectRecord as a second argument. The cell's currency is the column's. columnCurrencies decides a line amount that follows its header. Any other currency column is judged by its child field, which the hosts (LineItemsPanel, MasterDetailForm) now hand the grid as columnFields (currencyFieldDefsOf). It reads amountCurrencyOf on the line, as the form does, so it gives a fixed code, a sibling code on the line, or the home currency.
    • Record form declared pairs, on a pick and on the opening fill: LookupField.tsx via planDeclaredLookupAutofill. Target definitions are stamped on the lookup's field by the record form (withLookupAutofillTargets, applied in recordFormStamp.ts, the one step every layout draws through). Each one carries the label the form draws for it (already translated), so the note names the field as the form does. A target following its parent's currency reads the parent's code with useFollowedParentRecord, as the amount box does. The opening fill waits for the referenced schema and the parent read.
  • The reason. A note under the line (grid) or under the lookup (form) names the field, the picked amount in its own currency and the field's currency, while the pick still stands and the field is still empty. Three new lookup.autofill* sentences in all 11 packs (zh-Hant generated) and in FIELD_DEFAULTS.
  • Contract text. The describes of FieldSchema.lookupAutofill and the grid column key autofill state the rule; the spec pin of the autofill describe follows; references regenerated. content/docs/data-modeling/fields.mdx gains a Currency rule bullet. Showcase comments say "when the currencies match"; seeds unchanged.
  • Not done, as ruled: no conversion, no per-currency price, no build-time refusal.

Read first, by risk: (1) crossCurrencyRefusal and amountCurrencyOf in lookupAutofill.ts; (2) the currency context and opening-fill wait in LookupField.tsx; (3) gridAutofillCurrency in GridField.tsx.

Two-minute check: pnpm --dir ui exec vitest run packages/fields/src/widgets/GridField.lookupAutofill-28245.test.tsx passes; in it, a EUR line's pick leaves the price null and shows the note naming $100.00 and EUR, and a USD line fills 100.

Tests

Local runs at 1e8a71d
  • Under os-verify-lock: pnpm --filter @object-ui/fields run type-check, pnpm --filter @object-ui/plugin-form run type-check, then pnpm exec vitest run --maxWorkers=1 (from ui/) on GridField.lookupAutofill-28245.test.tsx, GridField.test.tsx, ObjectForm.lookupAutofill-28245.test.tsx and every LookupField* test: Test Files 27 passed (27), Tests 288 passed (288), VERDICT command-exit 0.
  • New pins: the rule's truth table; an amount's currency per mode; same-named copy and declared pair on a EUR line (price withheld, description fills, reason listed) and a USD line (fills); a header with no code; through the grid (EUR line: price null, note names $100.00 and EUR; USD line fills 100); through ObjectForm (EUR quote: price empty, note; USD quote fills 100; the opening fill on a EUR quote fills no price).
  • Ablation (scripts/ablation-replace.mjs, lookupAutofill.ts, anchor if (!source || !target) return undefined; x1 to x0, mutation makes every pick copy): Tests 7 failed | 26 passed (33) over the two new-pin files. Restored blob 0ce4a7231bed equals HEAD, git diff HEAD empty. The tests import the source directly (vitest aliases @object-ui/* to src), so no dist sits between the mutation and the run.
  • Spec: pnpm --filter @objectstack/spec build && gen:schema && gen:docs && check:generated: all 14 generated artifacts up to date, VERDICT command-exit 0.

Acceptance notes

Verification

Gates
  • Derived sweep: dispatch-gates --commands derived 119 commands, all run. dispatch-gates --ran reconciles 119 derived, 119 run, 0 NOT-MEASURED, 0 UNRUN. The sweep ran at 1e8a71d. Head a78cca8 changes only the changeset's declaration lines, and the three changeset gates (check-adr-0087-registration, check-changeset-no-major, check-empty-changeset, each --base origin/main) were re-run at a78cca8, all exit 0.

  • Prerequisite reruns: four commands first exited 3 on missing prerequisites and were re-run after they were in place, all exit 0. check-plugin-teardown-shape --self-test needed the depth-1 fetch of its pinned commit. check:skill-examples, check:dual-build-cjs-loads and check:i18n-coverage needed a full pnpm build.

  • Dogfood battery (owed by the narrowing arm): os-verify-lock.sh -c 'pnpm build && pnpm --filter @objectstack/dogfood test', whole battery with no shard, at a78cca8: Test Files 484 passed | 3 skipped (487), Tests 4107 passed | 68 skipped (4175), VERDICT command-exit 0.

  • ui i18n: all-locales-key-parity, en-zh-key-parity, untranslated-identity-4376, count-families-11445 and product-neutral-renderer.ratchet: Test Files 5 passed (5), Tests 94 passed (94). check-i18n-en-drift.mjs: no en value changed.

  • PR-event gates: check-changeset-no-major, check-adr-0087-registration and check-closing-keyword-parity on this body's event, all exit 0. check-prior-rulings exit 0 cites 7075336705.

  • Overlap: overlap-check exit 1 against fix(fields): a person picked in a list cell shows their name at once; avatar initials are letters only #36324 in LookupField.tsx, limited to imports and two useCallback dependency arrays. Whichever lands second needs a trivial merge. The seat has been told.

  • CI at a78cca8: 61 success, 9 skipped, none failing.

  • Merge of main at 3b268ec (head a111a0a): fix(fields): a person picked in a list cell shows their name at once; avatar initials are letters only #36324 landed first and conflicted in LookupField.tsx, in the imports and the onSelectRecord call of the picker's single-pick path. Both sides are kept: main's rememberPickedRecords import and call, and this PR's currency imports and sourceFields argument. gen:zh-hant is current, and dispatch-gates --commands derives the same 119 commands. overlap-check at the new head: VERDICT clean exit 0.

  • Re-verification at a111a0a, under os-verify-lock, VERDICT command-exit 0: pnpm build exit 0, @object-ui/fields and @object-ui/plugin-form type-check exit 0. vitest over the fields lookup and grid suites, all of plugin-form/src, main's new inCellFaces-35688, userCell.pickedRecord-36046 and personDisplay tests, and the five i18n parity suites: Test Files 278 passed (278), Tests 3178 passed | 1 skipped (3179). check-i18n-en-drift reports no en value changed. The three changeset gates exit 0.

  • Dogfood battery at a111a0a (whole battery, no shard): Test Files 485 passed | 3 skipped (488), Tests 4108 passed | 68 skipped (4176).

  • CI at a111a0a: every job is success or skipped. One PR-body guards run was cancelled because the body edit superseded it, and its re-run is success. mergeable_state: clean.

  • Round 2 (L1-d 7077931050, L2 7077947187) at b6dafa6: M1, the grid judges each currency column by its own child field. It is pinned through the grid: a fixed EUR price into a fixed EUR column fills under a USD home and under no home, a home price into a fixed EUR column is withheld, and a home price onto a line whose own code is JPY is withheld. Ablation on the committed tree (const def = columnFields?.[c.name]; x1 to x0) gives Tests 4 failed | 19 passed (23), restored blob 10d8999bda5b == HEAD. L1-d 2, the form note uses the form's translated label: the zh test names 单价. Ablation (the labels argument dropped) gives Tests 1 failed | 14 passed (15), restored blob f688c4c31af4 == HEAD. Clause-② is respelled yes (narrowing) and names the widenings. The changeset no longer names planLookupAutofill as an export. The grid autofill describe names the column's own currency, and the references are regenerated (check:generated VERDICT command-exit 0). Re-verification at b6dafa6, under os-verify-lock (VERDICT command-exit 0): pnpm build exit 0, and the @object-ui/fields and @object-ui/plugin-form type-checks exit 0. vitest over every GridField* and LookupField* suite, all of plugin-form/src, main's three new field tests and the five i18n parity suites: Test Files 296 passed (296), Tests 3309 passed | 1 skipped (3310). check-i18n-en-drift reports no en value changed.

  • Dogfood battery at b6dafa6 (whole battery, no shard): Test Files 485 passed | 3 skipped (488), Tests 4108 passed | 68 skipped (4176).

  • Derived sweep at b6dafa6: dispatch-gates --commands now derives 120 commands; the new one is check:error-status-conformance. All 120 were run and all exit 0. dispatch-gates --ran reconciles 120 derived, 120 run, 0 NOT-MEASURED. overlap-check VERDICT clean exit 0 before the push. CI at b6dafa6: no suite failed.

  • Merge of main at bcdd021, after perf(fields): the line-item grid's body loads on first use, out of the console's eager chunk #36417: perf(fields): the line-item grid's body loads on first use, out of the console's eager chunk #36417 moved the grid body to widgets/grid-field/GridFieldWidget.tsx and its pure helpers to the eager face widgets/GridField.ts. This PR's grid hunks are re-applied there. gridAutofillCurrency, the withheld state and note row, columnFields, and the onSelectRecord second argument are in the body. planLookupAutofill, with lookupAutofillPatch as its wrapper, is in the face. index.tsx still exports lookupAutofillPatch alone from it. The test imports the body as GridFieldWidget as GridField.

  • Re-verification at bcdd021, under os-verify-lock (VERDICT command-exit 0): pnpm build exit 0, and the fields and plugin-form type-checks exit 0. vitest over all of packages/fields/ and packages/plugin-form/, plus the five i18n parity suites: Test Files 571 passed | 1 skipped (572), Tests 7707 passed | 8 skipped (7715). check-i18n-en-drift: no en value changed. Dogfood battery (whole, no shard): Test Files 485 passed | 3 skipped (488), Tests 4108 passed | 68 skipped (4176). The derived sweep is the same 120 commands; all exit 0, and --ran reconciles 120 run, 0 NOT-MEASURED. CI at bcdd021: no suite failed. overlap-check: feat: line-item table cells for people, multi-select, tags, check and rating (#36043) #36392 overlaps in GridFieldWidget.tsx, from the same move perf(fields): the line-item grid's body loads on first use, out of the console's eager chunk #36417 named.

  • Round 3 (L2 delta 7081121014) at 970da9c: M1 on the third host, RecordBodyTableEditor (the record page's line table): it now passes columnCurrencies (from followedColumnCurrencies over the line object's header-following fields) and columnFields (from currencyFieldDefsOf), as LineItemsPanel and MasterDetailForm already do. Pinned in RecordBodyTableEditor.crossCurrency-36249.test.tsx: a USD-home price onto a EUR invoice's line is withheld with a note naming $100.00 and EUR, onto a USD invoice it fills, a fixed EUR price into a fixed EUR column fills, and a home price into a fixed EUR column is withheld. Ablations on the committed tree: dropping columnFields gives 2 failed of 4, dropping columnCurrencies gives 2 failed of 4, each restored blob == HEAD. S6: a declared autofill target the grid does not draw is judged by its own child field through columnFields[target], pinned in the grid suite (an undrawn net_price fixed EUR target is withheld); mutating the fallback gives 1 failed of 24, restored blob == HEAD. N6: the changeset names the optional trailing currency parameter. S5 is carried by Cross-currency pick follow-ups: no note on a re-pick over a filled cell, an unbounded opening wait, record forms outside the gate, and a code-plus-amount pick #36412 as item 4 (comment 7081194132). Re-verification at 970da9c under os-verify-lock (VERDICT command-exit 0): pnpm build exit 0, the fields and plugin-form type-checks exit 0, vitest over all of packages/fields/ and packages/plugin-form/ plus the five i18n parity suites Test Files 572 passed | 1 skipped (573), Tests 7712 passed | 8 skipped (7720), check-i18n-en-drift no en value changed, dogfood battery (whole, no shard) Test Files 485 passed | 3 skipped (488), Tests 4108 passed | 68 skipped (4176). Derived sweep: the same 120 commands, all exit 0, --ran reconciles 120 run, 0 NOT-MEASURED. overlap-check VERDICT clean exit 0 before the push. CI: Test Core (9/10) is red outside this diff, explained in comment 7082279204: its eight non-cli packages pass locally at 970da9c (Tasks: 75 successful, 75 total); every other job is success or skipped.

  • Round 4 (L2 delta 7082866706, S7) at 9ac9c94: the record page's line table judges its followed columns against the record as the user has it in the open edit: RecordBodyTableEditor builds its header row as { ...data, ...draft } from useInlineEdit(), the reading rule InlineEditContext states, so a currency code staged in the edit and saved with the new lines in the same batch is the code the pick is judged by. Pinned through the host under an InlineEditProvider with the code staged before the pick: stored USD with EUR staged withholds the home price with a note naming $100.00 and EUR, and stored EUR with USD staged fills it. Ablation on the committed tree (the draft overlay dropped, () => savedRow) gives Tests 2 failed | 4 passed (6), restored blob bcb2b1569030 == HEAD. N8 (the note names an undrawn target by its API name) stands as an accepted deviation. Re-verification at 9ac9c94 under os-verify-lock (VERDICT command-exit 0): pnpm build exit 0, the fields and plugin-form type-checks exit 0, vitest over all of packages/fields/ and packages/plugin-form/ plus the five i18n parity suites Test Files 572 passed | 1 skipped (573), Tests 7714 passed | 8 skipped (7722), check-i18n-en-drift no en value changed, dogfood battery (whole, no shard) Test Files 485 passed | 3 skipped (488), Tests 4108 passed | 68 skipped (4176). Derived sweep: the same 120 commands, all exit 0, --ran reconciles 120 run, 0 NOT-MEASURED. overlap-check VERDICT clean exit 0 before the push. CI at 9ac9c94: check suite completed with nothing failed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jTM6Q7J3o7taPraVR2

@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation protocol:data tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec, touching 2 documentable anchor(s).

11 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-driven.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/data-modeling/external-datasources.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/data-modeling/field-types.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/data-modeling/validation-rules.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/deployment/troubleshooting.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/deployment/validating-metadata.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/getting-started/quick-reference.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/kernel/contracts/data-engine.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/protocol/backward-compatibility.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/protocol/objectql/types.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/protocol/objectui/concept.mdx (via FieldSchema (symbol, a top-level const))

⛔ 5 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/releases/v17/17-1.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/releases/v17/17-7.mdx (via InlineGridColumnSchema (symbol, a top-level const))
  • content/docs/releases/v18/18-3.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/releases/v18/18-4.mdx (via FieldSchema (symbol, a top-level const))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • the SDK route bridge reached 68 of 251 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 174 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 316f7571617e0f22b260c457ec87692f5fc1ff5e → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 37fb5da4e39f8fb58ece0af26cb11aaef7c329cc — the merge of head 9ac9c94cd2ecc1eba4e592ae318820003354d0ba into base 316f7571617e0f22b260c457ec87692f5fc1ff5e, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 37fb5da4e39f8fb58ece0af26cb11aaef7c329cc && git checkout 37fb5da4e39f8fb58ece0af26cb11aaef7c329cc
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 316f7571617e0f22b260c457ec87692f5fc1ff5e 9ac9c94cd2ecc1eba4e592ae318820003354d0ba && git checkout -B drift-repro 316f7571617e0f22b260c457ec87692f5fc1ff5e && git merge --no-ff 9ac9c94cd2ecc1eba4e592ae318820003354d0ba

node scripts/docs-audit/affected-docs.mjs --json 316f7571617e0f22b260c457ec87692f5fc1ff5e

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 316f7571617e0f22b260c457ec87692f5fc1ff5e → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 REWORK · head a111a0a7fc66a09922a5303687bc2ab4faa81427 · 2026-11-22T10:38Z

维护者速读

要改的(2 项)

  1. Clause-② 应为 yes (narrowing),不是 no (narrowing)。 这一行自己就写着「the new @object-ui/i18n keys widen the typed locale surface」,和 no 矛盾。本 PR 的公开面放宽了三处:

    加上已经声明的行为收窄,这一行按 fix(service-analytics)!: refuse an object of a disabled package with the data route's 404 OBJECT_PACKAGE_DISABLED #36319(7077687524、L2 7077630521)同样的读法写成 yes (narrowing)。请把 changeset 36249-cross-currency-pick.md 和 PR 正文的这一行都改成 Clause-②: yes (narrowing) — …,破折号后写清楚收窄的那一句,再加上上面三处放宽;Metadata-protocol: semantic 和 Skills-docs: carried by #36349 不用改。clause2-line.mjs#readClause2Line 读 yes (narrowing) 得到 {value:'yes', arm:'narrowing'},今天我在本机核过。席位那边窄面的 L2 已经在跑,这一行改了以后,声明面也要一起过 L2。

  2. 表单里的说明,字段名要和表单显示的一致。 LookupField.tsx 里的 withheldLabel 读的是表单盖上去的目标字段定义里的原始 label(autofillTargets[target].label,来源是 recordFormStamp.ts 拿到的 objectFields),只接受字符串,否则退回字段的 API 名。而表单自己给字段起名是 fieldLabel(schema.objectName, name, field.label …)(ObjectForm.tsx:994),会读对象的翻译包。所以如果对象带翻译,中文界面里表单写的是「单价」,说明里却会写「未填入Unit Price」;如果 label 是多语言对象,说明里写的就是 unit_price。请让这句说明用表单显示的那个名字,比如盖章时带上表单已经算好的名字,或者在组件里同样经 fieldLabel 读;再补一条用例钉住。表格那条路径没问题:它用的 c.label 和表头是同一个值(GridField.tsx:1428、:1980)。这一项是我读代码看出来的,没有在浏览器里量;现在 showcase 和 HotCRM 都没有声明 lookupAutofill 对,所以还没有用户碰到。

席位核对(本轮已读,增量时只核上面两项加 CI)

  • 形态:l1-face --pr 36351 标了两项。all-checks 那一项是 09:29 被取消的那次 PR-body guards;同名检查在 09:30 和 10:32 各重跑过一次,都是 success,所以我把这项标记清掉了。dogfood 那一项见下面。draft、base main、Fixes #36249;第 1 项在本 PR 交付,第 2 项已由 fix(components): the edit form's subtotal reads the record's currency, as the record page does #36293 合并,所以用 Fixes 是对的。29 个文件 +870 −54;check-governed-merges 判定 NOT governed,924 行。changeset 列了 spec、fields、i18n、plugin-form 四个包,都是 minor,和 Metadata-protocol: semantic 相符,!/BREAKING 写在正文。
  • 与裁决逐条核(7075336705 执行项 1–8):一条规则 crossCurrencyRefusal 管三条路径(表格同名复制、表格声明对、表单声明对),选中时和新建表单打开时的预填都管;两边都是本位币就照旧复制,没配本位币也一样;否则只在两边是同一个已知代码时复制,本位币按它配置的代码算;number 照旧复制;目标跟随的记录还没有币种时不填,说明写「尚未选择币种」;不换算、不做按币种的价格、不加构建期拒绝。说明写出两种币种和按原币种格式化的原价,11 个语言包都有。spec 两处 describe 都写了这条规则(语义变化,没有新键);showcase 的注释加了「币种一致时」,种子数据没动。
  • 实现读法:表格从选择器拿到所引用对象的字段表(onSelectRecord 的第二个参数),单元格的币种来自 columnCurrencies(明细跟随表头)或本位币;表单读盖在查找字段上的目标定义,跟随父记录的目标用 useFollowedParentRecord 读父记录的代码,和金额框一致;新建表单打开时的预填会等所引用对象的 schema 和父记录都读到了才判断,所以只判一次。所引用对象的 schema 读不到时,数字值算「币种未知」:能复制进本位币字段,进别的币种就拦下,正文已写明。
  • 一点提醒(不改判):crossCurrencyRefusal 在「目标是本位币但没配本位币、来源是固定代码」时回答 noTargetCurrency,说明会写「尚未选择币种,请先选择币种」,而那里其实没有可以选的币种。这是边角情况(没配本位币的组织,产品价格又是固定币种),规则本身按裁决第 2 条是对的,只是那句说明不太贴切,可以以后再改。另外表格的说明按行号记,删行或拖动排序后,只有在那一行仍是同一个产品、单价仍空时才显示,所以不会显示错位的说明。
  • 文本逐句核:changeset 正文各段与 diff 一致(第 1 项除外);content/docs/data-modeling/fields.mdx 新增的 Currency rule 一条与 crossCurrencyRefusal 一致;references/data/field.mdx、object.mdx、system/migration.mdx、ui/component.mdx 是从两处 describe 重新生成的,与 field.zod.ts 逐字相同。zh-Hans、ru 的三句我读过,占位符和 en 一致,没有用 {{count}}。
  • 测试证据:规则的真值表、各模式下金额的币种、欧元行(单价拦下、说明照填、原因列出)和美元行(照填)、表头没有币种;经过表格(欧元行单价为 null,说明写 $100.00 和 EUR;美元行填 100);经过 ObjectForm(欧元报价单价留空并有说明;美元报价填 100;欧元报价打开时的预填不填单价)。消融:让每次选择都复制,新用例 7 红 26 绿,恢复后 blob 一致。i18n 五个门禁 94 条全过。这些用例我没有在本地重跑,读的是报告和 CI。
  • dogfood(由我判断):(narrowing) 欠一轮完整测试电池,报告在 a111a0a 上全量跑了一轮:4176 条里 4108 过、68 跳过、0 失败,和 head 一致,所以这项满足。
  • Skills-docs:skills/objectstack-data: lookupAutofill copies a currency amount only when both sides share the currency (after #36249) #36349 是开着的卡,写的正是 skills/objectstack-data/rules/field-types.md 里 lookupAutofill 那一段要加这条规则,并 Blocked-by: #36249,属实。
  • 范围外:报告里的一条(不经 ObjectForm 的 SDUI 表单没有盖章,所以照旧复制)已写进正文的 Acceptance notes,目前没有立卡;要不要立卡由席位定。和 fix(fields): a person picked in a list cell shows their name at once; avatar initials are letters only #36324 在 LookupField.tsx 的重叠只在 import 和两个依赖数组,后合的那个做一次简单合并即可,席位已知。
  • 落地条款:收窄、非受管;两项改完、CI 全绿后做增量 L1,加上席位的 L2(窄面和声明面都要过);之后由区 ready + auto-merge。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: a111a0a7fc66a09922a5303687bc2ab4faa81427
Local-runs: none
Scope: packages/spec/src/data/field.zod.ts (the schema hit record-recognisers --paths returns on this file list), packages/spec/src/data/field-lookup-autofill.test.ts, ui/packages/fields/src/widgets/lookupAutofill.ts, ui/packages/fields/src/widgets/GridField.tsx, ui/packages/fields/src/widgets/LookupField.tsx, ui/packages/fields/src/widgets/types.ts, ui/packages/fields/src/widgets/useFieldTranslation.ts, ui/packages/plugin-form/src/recordFormStamp.ts, ui/packages/i18n/src/locales/*.ts (11 packs), the two *.lookupAutofill-28245.test.tsx files, examples/app-showcase/src/data/objects/invoice.object.ts, examples/app-showcase/src/data/seed/index.ts + read in the cited code, not reviewed: ui/packages/i18n/src/currency.ts (resolveFieldCurrency, recordCurrencyPath), ui/packages/fields/src/widgets/followedParentRow.ts, ui/packages/plugin-form/src/parentCurrencyColumns.ts, LineItemsPanel.tsx and MasterDetailForm.tsx (the two hosts that fill columnCurrencies), ui/packages/fields/src/index.tsx, scripts/check-changeset-no-major.mjs and scripts/check-adr-0087-registration.mjs (the Clause-②: reading), ui/packages/i18n/CHANGELOG.md (the locale-key convention). Not reviewed: the changeset as prose, the regenerated references under content/docs/references, content/docs/data-modeling/fields.mdx.

Inputs: card #36249 with all nine comments (ruling 7075336705 included), the PR body, the 29-file list, the net diff against merge base ed33f8a (main has not moved on any touched path since), and the check-runs on the head: 64 success, 13 skipped, 1 cancelled (PR-body guards, superseded by a body edit; its re-run is success). No check is red.

① Derived judgments

  • FieldSchema.lookupAutofill and InlineGridColumnSchema.autofill: the accept sets do not move. Only the two describes and one jsdoc block change; the pin in field-lookup-autofill.test.ts follows the autofill describe. Right.
  • Behaviour: an amount a pick copied yesterday into a field in another currency is no longer copied. This is the narrowing, and it is the one ruling 7075336705 (letter B) orders. Right in direction; wrong in one arm of the grid, see M1.
  • @object-ui/i18n: three keys (lookup.autofillCurrencyDiffers, lookup.autofillSourceNoCurrency, lookup.autofillNoCurrency) in all 11 packs, so the typed key set grows. A widening on this repo's convention. Right as a change, wrongly declared, see S1.
  • @object-ui/fields: index.tsx re-exports ./widgets/lookupAutofill.js whole, so the package gains planDeclaredLookupAutofill, crossCurrencyRefusal, amountCurrencyOf, pickedAmountCurrencyOf, withheldAutofillMessage, withLookupAutofillTargets, readLookupAutofillTargets, LOOKUP_AUTOFILL_TARGETS_KEY and five types. onSelectRecord gains an optional second argument; declaredLookupAutofillPatch and lookupAutofillPatch gain an optional trailing currency parameter. All additive: a second public-surface widening, named nowhere on the Clause-②: line.
  • @object-ui/plugin-form: the record form stamps lookupAutofillTargets on a lookup's field metadata in restamp. Runtime hand-off, no authorable key. Right.
  • Generated references (field.mdx, object.mdx, component.mdx, and migration.mdx, which embeds the FieldSchema row table under its add-field operation) repeat the describes. migration.mdx is touched as generated output, not as a migration prescription. Right.
  • Showcase: comments in invoice.object.ts and seed/index.ts gain "when the currencies match"; no field, no seed row changes. Ruling item 7 holds. Right.
  • Merge 3b268ec with fix(fields): a person picked in a list cell shows their name at once; avatar initials are letters only #36324: read as the combined diff. Main's rememberPickedRecords import and all three calls stand (single pick, multi pick, picker single-pick path); both onSelectRecord call sites pass sourceFields; handleSelect already lists refObjectSchema in its dependencies, so the second argument is not stale. Right.

② Semver level

  • Metadata-protocol: semantic is true: the meaning of two authorable keys changes, no key is removed, no value refused, no requirement tightened. Not narrowed, not none.
  • Level: minor on @objectstack/spec, @object-ui/fields, @object-ui/i18n, @object-ui/plugin-form. A kind other than none takes at least minor on a moved package; Check Changeset is success on the head. Right. The BREAKING banner is present, as the (narrowing) arm requires.
  • ADR-0087: the marker not-required (no-migration-prescription) is the right disposition. Nothing an author can write is removed or renamed and nothing stored is rewritten, so no FROM to TO mapping and no conversion exist to register; the remedy is a person entering a price. The registration gate ran green in the lint lane.
  • Clause-②: no (narrowing) — …; the new @object-ui/i18n keys widen the typed locale surface: the line does not truthfully cover both. The gate's own definition of no is "this PR widens no published accept set or public surface", and the tail of the same line states a widening. See S1.
  • Skills-docs: carried by #36349: true in substance. skills/objectstack-data: lookupAutofill copies a currency amount only when both sides share the currency (after #36249) #36349 is open, names skills/objectstack-data/rules/field-types.md, is parented on this card and blocked on it. skills/objectstack-ui/rules/actions.md and list-views.md were read and are not made false. Spelling, see N1.

③ Boundary flags

  • Dev open_questions: empty in both item-1 reports. The item-1 question of report 7074836167 is answered by ruling 7075336705.
  • Dev out-of-scope finding "a bare SDUI form carries no target stamp, so its lookup copies across currencies as before · noted, not filed": not answered by a note in the PR body. See S4.
  • Dev deviation "a form test for a quote with no currency yet was dropped": accepted; noTargetCurrency is pinned in the truth table and through the grid's no-code header case.
  • Acceptance note "schema unreadable: a numeric value counts as currency unknown": read in pickedAmountCurrencyOf and crossCurrencyRefusal. It fails closed onto a coded target and open onto a home target. Accepted as written.
  • SQL push-down (AGENTS.md Prime Directive 5): no finding. The diff adds no query, no id materialisation and no in-app join. The one read it reuses is useFollowedParentRecord: a single findOne by id projected to id and the code field.
  • Escalation, face: by the committed tree this is the schema face (packages/spec/src/data/field.zod.ts is a schema hit), which decides before the declaration; the brief was rendered for the narrowing face and its prose-face placeholders were left unfilled. Both faces map to CONTRACT_REVIEW_TIER, so the served tier stands, and this record covers both floors.

④ Design judgment

The narrowing itself is sound: the spec on main promises no conversion anywhere (ADR-0144 D5 refuses an implied rate of 1), so withholding a cross-currency copy makes the platform's own refusal real and takes no declared capability away. crossCurrencyRefusal is one predicate, its truth table matches ruling items 2 and 3, and the record-form path delivers it. The grid path does not.

M1 (must-fix) — the grid names a cell's currency for parent-following columns only, so on the grid the rule both under-refuses and newly over-refuses. gridAutofillCurrency.targetCurrency answers { kind: 'home' } for every currency column absent from columnCurrencies, and both hosts fill columnCurrencies from parentCurrencyFieldsOf alone, which admits only a field whose currencyField path runs through the grid's own relationship. A child field with a fixed code, or a record-mode field following a sibling code on the line, is therefore read as home currency. Two results, both against the describe this PR publishes for lookupAutofill ("both naming the same ISO 4217 code (a fixed code, or the code the record or its master_detail parent holds)", "read wherever this field is picked: the record form, and a line-item grid column over it") and against the ruled text "a pick between two amounts in the same currency behaves as it does today":
(a) regression: a fixed EUR price picked into a fixed EUR line column filled before this PR and is now withheld whenever the home currency is not EUR, with a false sentence ("… here is in USD. Enter it in USD"); with no home currency configured the same pick, USD to USD included, is withheld as "no currency is chosen here yet". The record form fills the same pair, so the two faces of one key disagree.
(b) not delivered: a home-currency price still copies silently into a fixed EUR column or onto a line whose own code is JPY, which is the card's defect in another shape.
Fix where the knowledge is: the hosts hold the child schema, so hand the grid each currency column's definition (or its resolved currency: a fixed code as that code, a sibling code read per row), judged by amountCurrencyOf as the form does. Pin both directions through the grid: fixed EUR to fixed EUR fills under a USD home and under no home; home to fixed EUR is withheld. A capability the describe declares is implemented, not written down to what the grid reads today.

S1 (should-fix) — respell the declaration Clause-②: yes (narrowing) — … on the PR body and in the changeset, and name every widening in its tail: the three @object-ui/i18n keys, the new @object-ui/fields exports and the optional second argument of onSelectRecord. yes (narrowing) is the repo's spelling for a diff that widens and narrows (the ADR-0087 gate's own fixture; reviewFace reads it as the narrowing face; ui/packages/i18n/CHANGELOG.md carries dozens of "new locale keys" entries declared yes). Commit a111a0a moved the line the wrong way; the claim on the card had it right. No gate reads the difference, the shipped CHANGELOG does. Rides with the M1 push.

S2 (should-fix) — a withheld value is said only while its target is empty. On a re-pick over a filled cell (the grid's same-named copy, or a pair declaring overwrite: true), the old product's price stays under the new product and no note shows, because withheldShown filters to empty targets in both GridField.tsx and LookupField.tsx. The describes say "the cell stays empty and the grid says why" and "the target is left as it is and the form says why". Say it while the pick stands, whatever the target holds. Carry on a follow-up card.

S3 (should-fix) — the opening fill waits without bound when the followed parent cannot be read. followedParentPending stays true when the parent findOne rejects, when the source has no findOne, or when no parent object is stamped; the effect then returns before openingFilledRef is set, so no pair fills on opening, a description included, and nothing is said. Before this PR the opening fill ran. Treat a settled read as answered and judge the copy then (a money target reads unset and is withheld with its note; the rest fill). Carry on a follow-up card.

S4 (should-fix) — a record form drawn outside the gateFormFields path carries no lookupAutofillTargets stamp, so currencyFor answers no context and the pick copies across currencies as before, while the describe says "the record form" without exception. The dev reported it "noted, not filed". File it. Carry on a follow-up card.

Nits, no effect on correctness or the contract:

  • N1: the template's spelling is Skills-docs: follow-up #36349; carried by #36349 reads as true and no recogniser refuses it. PR body only.
  • N2: the changeset names the grid's planLookupAutofill as part of @object-ui/fields; index.tsx exports lookupAutofillPatch alone from GridField.js.
  • N3: withheldFills is keyed by row index while the neighbouring pickedLookupRecords is keyed by id for exactly that reason; a reorder or a removed line drops the note (the pick-still-stands guard keeps it from landing on the wrong line).
  • N4: with a target in the home currency and no home currency configured, a coded source is withheld as noTargetCurrency, whose sentence tells the user to choose a currency the form offers no way to choose.
  • N5: in invoice.object.ts the "Catalog lookup" comment sits above position, eleven lines before product. It did so before this PR.
  • Observation, as ruled (item 2) and stated in the changeset: in an organization with no home currency configured, a home-currency price is withheld from a line that follows a header code, on every document.

Implemented-by: claude/project-thread-ztnojr
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: FAIL

…withheld target as the form shows it

The line hosts hand the grid each currency column's child field, so a
fixed code or a code on the line decides the column's currency as on the
record form. The record form stamps each target with the label it draws.
The narrowing declaration names the widenings it ships with.

Claude-Session: https://claude.ai/code/session_01QsR2jTM6Q7J3o7taPraVR2
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 ACCEPT(增量)· head bcdd0214f80203b38b53144f58cea75ed8f6ad31 · 2026-11-22T15:09Z

维护者速读

  • 用户能看到什么变化:在外币单据(例如欧元报价)上选产品时,如果产品的价格和这一格的币种不同,单价不再把原数字照抄进来,而是留空,并写明原价、它的币种和这里的币种,请用户手填。说明、数量等其他字段照常带入;同币种照旧;不做任何换算。这一轮起,明细表格里每一列的币种按这一列自己的字段定义判断(固定币种、行上的币种字段或本币),和表单一致。
  • 为什么做:卡 Showcase EUR invoice: a picked product copies its home-currency price into the line as euros; the edit form's subtotal shows no currency symbol #36249 第 1 项,按你选的 B「币种不同就不填并说明」(7075336705)执行。这一轮回应了我的 REWORK 7077931050 和席位 L2 7077947187 的 M1、S1。
  • 出错会怎样:最坏是外币明细多一步手填,或者说明文字不准;本币单据不受影响,不碰已存数据,可以整体撤回。
  • 要你做什么:无(这是声明了的收窄,席位两份评审都通过后会交给你)。
  • 席位意见:ACCEPT。

增量核对(a111a0a7 → bcdd0214:修复提交 b6dafa6c,13 个文件,再合入 main,跨过了 #36417 的 GridField 拆分)

  • 我上一轮的 2 项都已改:

    1. 正文和 changeset 的声明都改成了 Clause-②: yes (narrowing),尾部写明了放宽的几处:三个 lookup.autofill* 语言键、lookupAutofill.ts 的新导出、onSelectRecord 的可选第二个参数、GridField 的可选 columnFields。和 diff 一致。
    2. 表单说明里的字段名用的是表单画出来的、已经翻译过的标签:withLookupAutofillTargets 多了 labels 参数,recordFormStamp.ts 把表单的标签传进去,中文测试读到「单价」。消融去掉 labels 后 1 条变红,复原后 blob 等于 HEAD。
  • L2 M1(表格只对跟随父记录的列判断币种)已改。 parentCurrencyColumns.ts 新增 currencyFieldDefsOf,挑出子对象里的 currency 字段和返回 currency 的 formula 字段。两个宿主 LineItemsPanel、MasterDetailForm 都把它作为 columnFields 交给表格。gridAutofillCurrency 对交了定义的列,用表单同一个 amountCurrencyOf(def, line) 判断币种;没交定义的列仍按本币,和以前一样;columnCurrencies 写到的列仍由它决定。新用例:

    • 固定 EUR 的价格填进固定 EUR 的列,在本币 USD 和没有本币时都能填;
    • 本币价格填进固定 EUR 的列,不填;
    • 本币价格填进行上币种是 JPY 的列,不填。

    消融删掉 columnFields 那一行后 4 条变红,复原后 blob 等于 HEAD。

  • L2 S2–S4 已立后续卡 Cross-currency pick follow-ups: no note on a re-pick over a filled cell, an unbounded opening wait, record forms outside the gate, and a code-plus-amount pick #36412(open)。 三项是:重选覆盖已有值时不提示、读不到父记录时开头的自动填充一直等、gateFormFields 之外的表单不判断币种。S4 正文 Acceptance notes 里也写了。这是 L2 给的做法,接受。顺手可做:在正文里写上 Cross-currency pick follow-ups: no note on a re-pick over a filled cell, an unbounded opening wait, record forms outside the gate, and a code-plus-amount pick #36412 的卡号。

  • 合入 main(跨过 perf(fields): the line-item grid's body loads on first use, out of the console's eager chunk #36417 拆分)我核过。 表格主体已经移到 grid-field/GridFieldWidget.tsx:gridAutofillCurrency 的 columnFields 和 line 两个参数、columnFields prop 和它在依赖数组里的位置,都在主体里。纯函数 planLookupAutofill 和包装它的 lookupAutofillPatch 在急加载的 GridField.ts 里。GridField 的外壳接收的是 GridFieldWidgetProps,所以 columnFields 能透传。index 仍然只导出 lookupAutofillPatch,changeset 也不再把 planLookupAutofill 写成导出。合并后的测试从主体导入。

  • spec 与文档(逐句核):autofill 的 describe 改成「格子的币种是它子字段的币种:固定币种、行或表头上的币种,或本币」,和 M1 修好之后的代码一致。生成的 component.mdx 和 field.mdx 已重新生成。changeset 的 @object-ui/fields 和 @object-ui/plugin-form 两段,新加的句子也逐句核过,和 diff 一致。

  • 门禁读数都在本 head 上:

    • dogfood 整套(收窄声明要的)在 bcdd0214 上:485 个文件通过、3 个跳过;4108 条通过、68 条跳过;
    • packages/fields/ 和 packages/plugin-form/ 全部加上五个 i18n 对齐用例:7707 条通过;
    • 推导出的 120 条命令全部 exit 0,--ran 对得上:120 条都跑了,0 条没测到;
    • check-i18n-en-drift 报告没有英文值变动。
  • 重叠:和 feat: line-item table cells for people, multi-select, tags, check and rating (#36043) #36392 在 GridFieldWidget.tsx 有重叠,后落地的那个合入 main。

  • CI @ bcdd0214:63 success、11 skipped、0 failed;mergeable clean。

  • 落地:声明了的收窄(yes (narrowing))。席位增量 L2 通过后,由席位写 ACCEPT,交维护者。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: bcdd0214f80203b38b53144f58cea75ed8f6ad31
Local-runs: none
Scope: packages/spec/src/data/field.zod.ts (the schema hit), packages/spec/src/data/field-lookup-autofill.test.ts, ui/packages/fields/src/widgets/lookupAutofill.ts, ui/packages/fields/src/widgets/GridField.ts, ui/packages/fields/src/widgets/grid-field/GridFieldWidget.tsx, ui/packages/fields/src/widgets/LookupField.tsx, ui/packages/fields/src/widgets/types.ts, ui/packages/fields/src/widgets/useFieldTranslation.ts, ui/packages/plugin-form/src/LineItemsPanel.tsx, ui/packages/plugin-form/src/MasterDetailForm.tsx, ui/packages/plugin-form/src/parentCurrencyColumns.ts, ui/packages/plugin-form/src/recordFormStamp.ts, ui/packages/i18n/src/locales/*.ts (11 packs), the two *.lookupAutofill-28245.test.tsx files, examples/app-showcase/src/data/objects/invoice.object.ts, examples/app-showcase/src/data/seed/index.ts + read in the cited code, not reviewed: ui/packages/plugin-form/src/RecordBodyTableEditor.tsx (the third host of the line grid), ui/packages/app-shell/src/views/recordEditState.tsx (where that host is mounted), ui/packages/i18n/src/currency.ts (resolveFieldCurrency), ui/packages/fields/src/index.tsx and ui/packages/plugin-form/src/index.tsx (what each package exports). Not reviewed: the changeset as prose, the regenerated references under content/docs/references, content/docs/data-modeling/fields.mdx.

Delta review of the record at a111a0a7fc66a09922a5303687bc2ab4faa81427 (comment 7077947187, FAIL). Inputs: card #36249 with all ten comments (ruling 7075336705 and the round-2 dev report 7079157683 included), the PR body, the 33-file list, the dev commit b6dafa6, the merge bcdd021, the net diff against merge base 7ae5e07, follow-up card #36412, and the check-runs on the head: 62 success, 11 skipped, 1 in progress (Check Changeset, re-run by a PR-body edit at 15:06Z; its run of 13:07Z on this same head is success). No check is red.

① Derived judgments

  • Accept sets: unchanged from the earlier record. FieldSchema.lookupAutofill and InlineGridColumnSchema.autofill move in their describes only; the autofill describe now reads "its child field's: a fixed code, the code the line or its header holds, or the home currency", and its pin follows. Right as text; not yet true on every host, see M1.
  • @object-ui/fields: GridField gains the optional prop columnFields, and withLookupAutofillTargets gains an optional third argument labels. Both additive. Right, and columnFields is named on the Clause-②: line.
  • @object-ui/plugin-form: currencyFieldDefsOf is new in parentCurrencyColumns.ts, which index.tsx does not export, so the package surface does not move. stampRecordFormFields keeps its signature. Right.
  • Merge bcdd021 across perf(fields): the line-item grid's body loads on first use, out of the console's eager chunk #36417: the grid hunks are re-applied correctly. Compared line by line, this PR's added and removed lines in the old GridField.tsx at b6dafa6 equal those in GridField.ts plus grid-field/GridFieldWidget.tsx at the head, apart from import paths and one re-wrapped comment. planLookupAutofill and lookupAutofillPatch sit in the eager face, gridAutofillCurrency, the withheld state and its note row sit in the body, and index.tsx still exports lookupAutofillPatch alone from the face. The PR's hunks in LookupField.tsx, lookupAutofill.ts, types.ts, recordFormStamp.ts, both hosts and field.zod.ts are identical before and after the merge. The grid test imports the body directly. Right.

② Semver level

  • minor on @objectstack/spec, @object-ui/fields, @object-ui/i18n and @object-ui/plugin-form, Metadata-protocol: semantic, the BREAKING banner and the ADR-0087 marker not-required (no-migration-prescription): unchanged and right, as judged in the earlier record.
  • Clause-②: yes (narrowing) — … now reads the same on the PR body and in the changeset, names the narrowing, and names the widenings: the three lookup.autofill* keys, the new lookupAutofill.ts exports and their types, the optional second argument of onSelectRecord, and the optional columnFields prop. The line is truthful. See N6 for one omission.
  • Skills-docs: follow-up #36349 is the template's spelling, and skills/objectstack-data: lookupAutofill copies a currency amount only when both sides share the currency (after #36249) #36349 is open.

③ Boundary flags

④ Design judgment

The fix for the two hosts it reaches is right. LineItemsPanel and MasterDetailForm hand the grid each money field of the child (currencyFieldDefsOf), and gridAutofillCurrency reads that field with amountCurrencyOf on the line, the function the record form uses. columnCurrencies still decides a column that follows its header. The four new cases through the grid pin both directions: fixed EUR into fixed EUR fills under a USD home and under no home, a home price into a fixed EUR column is withheld, and a home price onto a line whose own code is JPY is withheld.

M1 (must-fix): still open on the third host of the line grid. ui/packages/plugin-form/src/RecordBodyTableEditor.tsx draws LineItemsField for a record page's body table in the page's edit state (mounted by recordEditState.tsx). It hands the grid lookupAutofill but neither columnCurrencies nor columnFields, so gridAutofillCurrency.targetCurrency answers home for every currency column there. The earlier record named two hosts and missed this one; the tree has three. Both halves of M1 stand on it:
(a) not delivered: on a EUR invoice opened on its record page and put in edit, picking a product copies the home price into the line as euros. The showcase line's unit_price follows invoice.currency_code, so this is the card's own fixture on the card's own defect.
(b) regression: a fixed EUR price picked into a fixed EUR line column filled there before this PR and is now withheld whenever the home currency is not EUR, with a sentence naming the home currency; with no home currency configured it is withheld as "no currency is chosen".
The describe this PR publishes says the rule is read on "a line-item grid column over it" without exception, and the changeset says "The line-item hosts hand their grid each currency column's child field". Hand this host the same two props the other two pass: columnFields from currencyFieldDefsOf, and columnCurrencies from parentCurrencyFieldsOf and followedColumnCurrencies over the record it already holds as contextRecord. Pin it through this host: a line following a EUR header withholds a home price, and a matching pair fills. Passing columnCurrencies also gives those columns the header's symbol in the edit state, which they do not show today.

S1: closed

S2: closed

S3: closed

S4: closed

S2, S3 and S4 are carried as items 1, 2 and 3 of the open card #36412, which is blocked on this PR. No code for them is in this head, as the earlier record allowed.

S5 (should-fix): a target's currency is read on the line or record as it stood before the pick, so a pick that fills the code and the amount together withholds the amount. Take a product with a currency_code field and a unit_price in record mode over it, and a line shaped the same way. On a fresh line the same-named copy writes currency_code and judges unit_price against a line that holds no code yet: the price is withheld and the note says no currency is chosen, beside a code the same pick just wrote. Before this PR both copied. gridAutofillCurrency receives the row before the patch, and currencyFor in LookupField.tsx reads the record being edited the same way for declared pairs. Judge an amount against the line with this pick's own writes to the code field applied. Carry on #36412 or a card of its own.

S6 (should-fix): in the grid, a declared pair whose target is not a drawn column is copied without the rule. targetCurrency answers nothing when columns.find finds no column, and planDeclaredLookupAutofill then writes the target into the row. The record form judges the same pair from its stamp whether or not the target is drawn. The grid now holds the answer: fall back to columnFields[target] when no column carries the name. One line; it can ride with the M1 push, or go to #36412.

N1: closed

N2: closed

N3: stands as an accepted deviation (the withheld note is keyed by row index).

N4: stands as an accepted deviation (the sentence for a home target with no home currency configured).

N5: stands as an accepted deviation (the comment position in invoice.object.ts).

N6 (nit): the Clause-②: tail does not name the optional trailing currency parameter that the existing exports declaredLookupAutofillPatch and lookupAutofillPatch gain. Additive; PR body and changeset only.

Implemented-by: claude/project-thread-ztnojr
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: FAIL

…urrency too

The body-table editor hands its grid the header-following currencies and
each money column's child field, as the other line hosts do. A declared
target that is not a drawn column is judged by its child field.

Claude-Session: https://claude.ai/code/session_01QsR2jTM6Q7J3o7taPraVR2
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 9ac9c94cd2ecc1eba4e592ae318820003354d0ba
Local-runs: none
Scope: packages/spec/src/data/field.zod.ts (the schema hit), packages/spec/src/data/field-lookup-autofill.test.ts, ui/packages/fields/src/widgets/lookupAutofill.ts, ui/packages/fields/src/widgets/GridField.ts, ui/packages/fields/src/widgets/grid-field/GridFieldWidget.tsx, ui/packages/fields/src/widgets/LookupField.tsx, ui/packages/fields/src/widgets/types.ts, ui/packages/fields/src/widgets/useFieldTranslation.ts, ui/packages/plugin-form/src/LineItemsPanel.tsx, ui/packages/plugin-form/src/MasterDetailForm.tsx, ui/packages/plugin-form/src/RecordBodyTableEditor.tsx, ui/packages/plugin-form/src/parentCurrencyColumns.ts, ui/packages/plugin-form/src/recordFormStamp.ts, ui/packages/i18n/src/locales/*.ts (11 packs), the two *.lookupAutofill-28245.test.tsx files, ui/packages/plugin-form/src/RecordBodyTableEditor.crossCurrency-36249.test.tsx, examples/app-showcase/src/data/objects/invoice.object.ts, examples/app-showcase/src/data/seed/index.ts + read in the cited code, not reviewed: ui/packages/react/src/context/InlineEditContext.tsx (the draft's reading rule, the provider's state and the no-provider answer of useInlineEdit), ui/packages/app-shell/src/views/recordEditState.tsx (where the editor is mounted, how the session is entered and ended), ui/packages/app-shell/src/views/RecordDetailView.tsx (the order of the record context and the provider, and what happens on a change of record), ui/packages/i18n/src/currency.ts (withFollowedParent, resolveFieldCurrency). Not reviewed: the changeset as prose, the regenerated references under content/docs/references, content/docs/data-modeling/fields.mdx.

Delta review of the record at 970da9c6eeb00029faf710fff5ba87d66a4a2e70 (comment 7082866706, PASS with S7 open). Inputs: card #36249 with all twelve comments (ruling 7075336705 and the round-4 dev report 7084228637 included), the PR body, the one commit since, 9ac9c94 (two files: RecordBodyTableEditor.tsx and RecordBodyTableEditor.crossCurrency-36249.test.tsx), the net diff against main, follow-up card #36412, and the 74 check-runs on the head: 63 success, 11 skipped, none red, none pending.

① Derived judgments

  • Accept sets: unchanged. The commit touches no schema file and no describe.
  • @object-ui/plugin-form: RecordBodyTableEditor keeps its props and its exports. It now also reads useInlineEdit() from @object-ui/react, a package it already imports from. No signature moves, no new export. Right.
  • @object-ui/fields, @object-ui/i18n, @objectstack/spec: not touched by this commit.
  • The behaviour this commit publishes: on the record page's edit state, a line column that follows the record's currency is judged, and drawn, in the code the open edit holds, not the stored one. With no staged change the header row is the stored record, the same object as before. Right.

② Semver level

  • minor on @objectstack/spec, @object-ui/fields, @object-ui/i18n and @object-ui/plugin-form, Metadata-protocol: semantic, the BREAKING banner and the ADR-0087 marker not-required (no-migration-prescription): unchanged, and still right. The changeset file is byte-identical to the one at 970da9c.
  • Clause-②: yes (narrowing) — … reads the same, character for character, on the PR body and in the changeset (compared by machine). This commit adds no public surface, so the line needs no new entry and is still complete for what the diff publishes.
  • Skills-docs: follow-up #36349 unchanged.

③ Boundary flags

④ Design judgment

S7: closed

Read in the tree, not from the dev's account. RecordBodyTableEditor.tsx now builds headerRow as { ...(savedRow ?? {}), ...draftRow } when the draft has any own key, and as savedRow itself when it has none or there is no provider. That is the rule InlineEditContext.tsx states for a live value, with nothing added:

  • A staged clear. An own draft key wins whatever its value, because the spread copies null, undefined and '' alike. A cleared currency_code reads as no code: resolveFieldCurrency answers undefined, followedColumnCurrencies keeps the column's key with that value, and the grid's targetCurrency answers unset. The home price is withheld and the note says no currency is chosen yet. The stored code is not read back.
  • A draft key that is not a field is one more key on the header row. Only the code field named by the column's path is read, and the row's id still comes from the stored record, so withFollowedParent still matches the line to this record.
  • A draft from another record. RecordDetailView is not remounted between records, so the provider is shared. The edit state is closed on a change of record (setRecordEditState(false) on objectName / pureRecordId), which unmounts the editor, and it is only entered through requestEnter, which ends any open inline session first (after a confirm when it holds changes). The editor therefore never mounts over a draft another record left. Every other reader of the draft on the page relies on the same thing.
  • Outside a provider useInlineEdit() answers null; draftRow is undefined and the header row is the stored record, as at the earlier head. Nothing throws.
  • A change after lines exist. The editor now subscribes to the inline context, headerRow is keyed on the draft object, and lineColumnCurrencies on headerRow; the grid's pick callback is keyed on columnCurrencies. A pick made after the code is changed is judged in the new code, and the followed columns redraw in it.

The two pins are real. Both mount the editor itself under a real InlineEditProvider and stage the code through the provider's own setField before the pick. With the overlay dropped, the first (stored USD, EUR staged) would copy 100 and fail where the test expects the price cell empty, and the second (stored EUR, USD staged) would withhold and fail where the test expects the price to be 100. The four earlier pins now run under the same provider with an empty draft; the path with no provider is no longer mounted by a test, but it is the one-line savedRow branch.

Observation, outside this card and not graded: a pick is judged once, at the pick. A price copied while the record was in USD stays on the line if the code is then changed to EUR in the same edit, and a withheld note keeps naming the code it was judged against. The same holds for a price typed by hand, and on MasterDetailForm and LineItemsPanel: it is what a change of the document currency does to lines not yet saved, not what a pick does. The seat may want a line for it on #36412. Likewise the grid's contextRecord (the parent a line's readonlyWhen / requiredWhen reads) is still the stored record; it was so before this PR and no currency is read from it.

N3: stands as an accepted deviation (the withheld note is keyed by row index).

N4: stands as an accepted deviation (the sentence for a home target with no home currency configured).

N5: stands as an accepted deviation (the comment position in invoice.object.ts).

N7: closed

Item 4 is now in the body of #36412, in "What happens" and in "To do", and the title names it.

N8: stands as an accepted deviation (the note names an undrawn target by its API name).

N9 (nit): the editor now re-renders on every keystroke in any field of the record, because the draft is a new object on each setField, and it hands the grid a new columnCurrencies object each time. InlineEditContext.tsx warns about this churn. Read, not measured; the result is correct either way. A narrower key (the code values the followed columns read) would keep the grid still while other fields are typed. Leave it as an accepted deviation or add it to #36412; a fix in code moves the head.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-ztnojr
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 ACCEPT(增量)· head 9ac9c94cd2ecc1eba4e592ae318820003354d0ba · 2026-11-22T19:30Z

维护者速读

  • 用户能看到什么变化:和上一轮一样。在外币单据上选产品时,产品价格和这一格的币种不同,单价就留空并写明原因,请用户手填;同币种照旧;不做换算。这一轮补上了记录页上直接编辑明细表(记录页正文里的明细表进入编辑状态)这一处,它现在也按同样的规则判断。
  • 为什么做:卡 Showcase EUR invoice: a picked product copies its home-currency price into the line as euros; the edit form's subtotal shows no currency symbol #36249 第 1 项,按你选的 B(7075336705)。这一轮回应席位增量 L2(7081121014)的 M1(第三个宿主)、S6,以及下一轮 L2(7082866706)的 S7。
  • 出错会怎样:和上一轮一样,最坏是外币明细多一步手填或说明不准,不碰已存数据,可以整体撤回。
  • 要你做什么:无(声明了的收窄,席位两份评审都通过后会交给你)。
  • 席位意见:ACCEPT。

增量核对(bcdd0214 → 9ac9c94c:970da9c6(5 个文件)和 9ac9c94c(2 个文件)两个提交)

  • M1 第三个宿主已补。 RecordBodyTableEditor 现在和另外两个宿主一样,交给表格两样东西:

    • columnCurrencies:followedColumnCurrencies(parentCurrencyFieldsOf(child fields, relationshipField), record.data, homeCurrency),也就是跟随这条记录币种的明细金额列;
    • columnFields:currencyFieldDefsOf(child fields)。

    这次我在本 head 上把所有交 lookupAutofill 给明细表格的宿主都 git grep 了一遍:只有 LineItemsPanel.tsx:928、MasterDetailForm.tsx:1266、RecordBodyTableEditor.tsx:364 三处,三处现在都传了 columnFields。另外,通用的 grid 字段(index.tsx:4837 注册的懒加载组件)没有宿主交 columnFields:它的列写在字段配置里,背后没有子对象定义,所以金额列按本币判断,和 describe 写的「宿主没交定义的列按本币」一致。上一轮我只核了两个宿主,这一处是我漏的。

  • 新的 RecordBodyTableEditor.crossCurrency-36249 有 4 条:跟随 EUR 发票的明细,本币价格不填并写明原因;固定 EUR 的明细价格,在本币 USD 下固定 EUR 的产品价格能填;同一列填本币价格时不填;跟随 USD 发票的明细照常填、没有说明。消融:去掉宿主的 columnFields 红 2 条;去掉 columnCurrencies 红 2 条。复原后 blob 都等于 HEAD。

  • S6(声明的目标不是画出来的列)已改。 gridAutofillCurrency.targetCurrency 不再在找不到列时直接返回「不是金额」。它先看 columnCurrencies[target],再看 columnFields[target] 并用 amountCurrencyOf 判断;两者都没有、又不是画出来的列时,才当作不是金额。画出来的非金额列照旧返回 undefined。和表单对没画出的目标的判断一致。表格的用例里加了一条,消融这一处退路后红 1 条,复原后 blob 等于 HEAD。TSDoc 也补了这一句。

  • changeset:Clause-② 那一行的放宽清单里补上了 declaredLookupAutofillPatch 和 lookupAutofillPatch 新加的可选尾参数 currency。我对过 GridField.ts 和 lookupAutofill.ts,两个函数都多了这个可选参数,写得对。

  • S5 已作为第 4 项挂到 Cross-currency pick follow-ups: no note on a re-pick over a filled cell, an unbounded opening wait, record forms outside the gate, and a code-plus-amount pick #36412(7081194132):pick 同时写币种字段和金额时,金额按 pick 之前的行判断。复现、位置、完成标准都写了。这是 L2 给的做法,接受。

  • S7(记录页明细表按已保存的记录判断币种)已改。 RecordBodyTableEditor 的表头行现在是 { ...record.data, ...draft },draft 取自 useInlineEdit()(不在 InlineEditProvider 里时为 null,退回已保存的数据)。编辑状态下改币种和新明细是一批保存的,所以草稿里的币种就是这些明细保存时的币种,这样读是对的。hook 在组件顶层、所有 effect 和 memo 之外调用,没有条件分支。新加两条宿主用例,都在 InlineEditProvider 下:存的是 USD、草稿改成 EUR 时,本币价格不填;存的是 EUR、草稿改成 USD 时,照常填、没有说明。消融去掉草稿覆盖后,6 条里红 2 条,复原后 blob 等于 HEAD。

  • 门禁读数都在本 head 上(报告 7084228637):推导出的 120 条命令全部 exit 0,--ran 对得上;dogfood 整套在 9ac9c94c:4108 条通过、68 条跳过,没有失败。

  • 其余各项沿用上一轮在 bcdd0214 上的核对。

  • CI @ 9ac9c94c:63 success、11 skipped、0 failed;mergeable clean。

  • 落地:声明了的收窄。席位增量 L2 通过后,由席位写 ACCEPT,交维护者。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Seat record (2026-11-22T19:33Z) on head 9ac9c94cd2ecc1eba4e592ae318820003354d0ba. This PR declares a narrowing (Clause-②: yes (narrowing)), so the merge queue's Governed Surface Queue Guard admits it only after the maintainer approves. The PR body's line "需要你做的:无" is superseded by this record: the approval below is the one action.

维护者速读

席位核对

ACCEPT · Tier H (a declared narrowing: Clause-②: yes (narrowing), Metadata-protocol: semantic)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Tier H hand-off (2026-11-22T19:34Z): this PR declares a narrowing (Clause-②: yes (narrowing)), so the queue guard admits it only after the maintainer approves. Head 9ac9c94cd2ecc1eba4e592ae318820003354d0ba. The seat record above carries the 维护者速读: seat ACCEPT, L1-d delta ACCEPT 7084462756, L2 delta PASS 7084283546. After an approving review, the seat runs the pre-landing checks and enqueues it.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 22, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 22, 2026 22:18
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 8da2b7e Nov 22, 2026
80 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-ztnojr branch November 22, 2026 22:55
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…e console's eager chunk (objectstack-ai#36417)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbUq2j5tRRVo3TVY3wcS1Fdg)_

repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ

Fixes objectstack-ai#36102

Clause-②: yes (widening)
Metadata-protocol: none
Ruling-ref: 7063116595 on objectstack-ai#36023 (option B, "a separate card follows to
take GridField out of the eager chunk, after which the ceiling can come
back down"); seat note 7064483594 on this card, on ruling 7063869131
(lower the ceiling and baseline by the bytes taken out, no more)

## 维护者速读

- 用户无感:控制台首次加载少下载约 6
KB(压缩后),明细表格改为第一次打开带明细的表单时才加载,新建与编辑发票时表格照常出现、输入不丢焦点。
- 这是上次为放行明细表格改动而临时抬高控制台首屏体积上限之后约定的后续工作,把那部分体积收回来。
-
出错时最坏:明细表格的代码要单独下载,如果连续两次下载失败,错误会交给表单的出错处理,整个带明细的表单(不只是明细表格)会换成出错提示;网络正常时只是第一次打开时明细区多停一会儿在「正在加载列」。整个改动可直接撤回。
- 要你做什么:无。

## What changes

The line-item grid's body (`GridField`, about 90 KB of source) sat in
the console's eager `ui-components` chunk. The package entry imported it
lazily but also exported it statically, so the lazy import did nothing.
It now loads the first time a grid is drawn, in a lazy `fields-grid`
chunk. No published export was removed or renamed.

- **`ui/packages/fields/src/widgets/GridField.ts`** (new, the published
face). It keeps the pure helpers (`evalArith`, `computeRow`,
`lookupAutofillPatch`, `columnHelpByField`, `UNTOUCHED_NEW_ROW`,
`isUntouchedNewRow` and the column types), which stay eager. It also
exports `GridField` and `LineItemsField` as a small lazy face with the
same props.
- Each mount decides once: a grid mounted after the body has loaded
renders it directly. A grid mounted before that renders it through
`Suspense`, with a busy placeholder (`grid-field-loading`).
- A load landing later therefore never remounts the body, and focus is
kept.
- New export: `preloadGridField()`. It starts the one shared load and
never rejects; a failed load is reported by the grid that needs it,
through the nearest error boundary.
- **`widgets/grid-field/GridFieldWidget.tsx`** is the body, moved from
`widgets/GridField.tsx` (git reads it as a rename, R081). Only
`loadGridFieldWidget`'s `import()` reaches it.
- **The record forms wait for it.**
- `MasterDetailForm` starts the load when it mounts. It draws a
collection's grid only once the body has settled; until then it shows
its existing "Loading columns…" copy. That holds on every path: derived
columns, columns authored in full, and authored-but-untyped columns
drawn while the derivation is in flight.
- The record page's line-item editor (`RecordBodyTableEditor`) waits for
the body together with the child schema.
  - `LineItemsPanel` starts the load when it mounts.
- **Console chunking:**
- `vite.config.ts` gains a `fields-grid` group (priority 82, ahead of
`ui-components`).
- `check-eager-closure-budget.mjs` gains its
`PER_CHUNK_MEMBERSHIP_CARVE_OUTS` row (`src/widgets/grid-field` →
`fields-grid`), following the `fields-date-picker` precedent
(objectui#12622).
- `vite-ineffective-dynamic-imports.ts` drops GridField from its
defeated-lazy list, because the import is now effective.
- **Budget:** the `ui-components` ceiling and its baseline come down by
the bytes removed (below). The objectstack-ai#36100 and objectstack-ai#36109 entries no longer call
this card a payback.
- **Tests:** about 30 fields test files import the body by its new path
(`GridFieldWidget as GridField`); the helpers stay on `./GridField`.
Three plugin-form test files await `preloadGridField()` at module scope.

### The bytes (in the budget file's "Raising it" style)

One container, one instrument: `CI=true pnpm exec turbo run build
--filter=@object-ui/console...`, reading
`apps/console/dist/eager-closure.json`, run twice on one tree. The first
build is `main` at `b3bcfefc` alone; the second is the same `main` plus
this change, at `3c422050`. Gzipped bytes:

| chunk | `b3bcfefc` | `3c422050` | delta |
|---|---:|---:|---:|
| `vendor-objectstack` | 674,662 | 674,662 | 0 |
| `i18n-locale-en` | 66,785 | 66,785 | 0 |
| `framework` | 88,559 | 88,559 | 0 |
| `ui-components` | 352,359 | 346,403 | −5,956 |
| ⇒ aggregate | 1,875,902 | 1,869,974 | −5,928 |

- The same 105 eager chunks appear by name in both builds. Total chunks
go from 2,577 to 2,578; the new one is `fields-grid`, which is lazy
(20,374 raw bytes).
- Apart from `ui-components`, no chunk moved by more than 31 bytes
(`index` +31).
- Raw minified `ui-components`: 1,309,110 → 1,289,869 (−19,241).
- Re-read on this PR's final head (`eb102830`, same instrument):
`ui-components` is still 346,403, and the aggregate is 1,869,971 (−3
bytes against `3c422050`, spread over `index`, `src`, `relativeTime` and
`useConsoleActionRuntime`).
- An intermediate read at `4ca78ed1` (before the face became a JSX-free
`.ts`) gave 346,399 (−5,960). The ceiling follows the final tree's
−5,956.

| constant | before | after | delta |
|---|---:|---:|---:|
| `PER_CHUNK_GZIP_CEILINGS['ui-components']` | 451,100 | 445,144 |
−5,956 |
| `PER_CHUNK_BASELINE['ui-components']` | 265,937 | 259,981 | −5,956 |

The gap between ceiling and baseline is unchanged (185,163). ⛔ Not
moved: `MAX_EAGER_CLOSURE_GZIP_BYTES`, `BASELINE`,
`REGRESSION_THIS_GATE_MUST_CATCH_BYTES` and the other per-chunk rows. No
exemption was added. `pnpm check:eager-closure` on the final build: `✅
chunk ui-components 338.3 KB measured / 434.7 KB ceiling`, plus the
membership line `its src/widgets/grid-field subtree 1 in fields-grid,
exactly`.

## Tests

<details><summary>The first-open pin (live e2e,
ui/e2e/live/master-detail.spec.ts)</summary>

The new describe is "the line-item grid on a form's first open
(objectstack#36102)". The spec is in the required `test:e2e:live:ci`
lane.

- An init script installs a `MutationObserver` before the document's
first byte. It counts every attach of the placeholder
(`grid-field-loading`) and of the grid (`line-items`). The grid count is
the observer's control.
- **Create:** the invoices list → New → the dialog's grid is visible →
add a line → type `first-open` into the Description cell. The cell must
still be focused after 300 ms and hold the text. Assertions: grid
attaches > 0, placeholder attaches = 0.
- **Edit:** `INV-1002`'s edit route. Its stored lines are drawn
(Description not empty), then the same typing and the same counts.

Local live stack: the workspace backend
(`ui/e2e/live/ci/start-backend.sh`) and `vite preview` of a root-base
console build, as the CI job runs them.

- **Red first.** At `e581a9a5`, before `MasterDetailForm` gated the
grid, the create case failed: `the grid never mounted on its loading
placeholder: Expected: 0, Received: 1`. A trace showed the placeholder
attached inside `md-collection` about 0.4 s before the grid, because the
collection drew authored-but-untyped columns while the derivation was in
flight.
- **Then green.** At `51af8021`: `--repeat-each 3 --retries 0` → `15
passed (1.1m)` (the whole spec, 5 tests × 3).

</details>

<details><summary>Unit: the lazy face, and its ablation</summary>

`GridField.test.tsx`, new describe "GridField — the lazy face the
package exports (objectstack#36102)", using `vi.resetModules()` and a
fresh import:

- A mount before the body loads shows the placeholder, then the grid. A
focused Description cell is still connected and still
`document.activeElement` after a re-render.
- After `await preloadGridField()`, `LineItemsField` renders with no
placeholder.
- `LineItemsField` is `GridField`, the same face.

**Ablation** (committed first, through `node
scripts/ablation-replace.mjs`): `const [loadedAtMount] =
React.useState(() => gridFieldWidgetModule);` was replaced by `const
loadedAtMount = gridFieldWidgetModule;`, so the decision is re-read on
every render.

- Anchor 1 → 0, blob `2e286b33ebdf → 1f484acf48d9`.
- Result: `× a mount before the body loads shows the placeholder, then
the grid, and a later render keeps the focused cell`, with `Tests 1
failed | 91 passed (92)`.
- Restored: blob == HEAD (`2e286b33ebdf`) and `git diff HEAD` empty.

</details>

<details><summary>Suites</summary>

- `pnpm exec vitest run packages/plugin-form/` (from `ui/`): `Test Files
244 passed (244)`, `Tests 2750 passed | 1 skipped`.
- `pnpm exec vitest run packages/fields/
scripts/__tests__/check-eager-closure-budget.test.ts
scripts/__tests__/vite-ineffective-dynamic-imports.test.ts
scripts/__tests__/vite-declared-lazy-views.test.ts`: `Test Files 323
passed | 1 skipped (324)`, `Tests 5064 passed | 7 skipped`.
- `pnpm --filter @object-ui/plugin-form run type-check` and `pnpm
--filter @object-ui/fields run type-check`: both exit 0, after a rebuilt
fields `dist`.
- `pnpm --dir ui exec vitest run scripts/`: exit 0 (part of the derived
gate list).

</details>

## Acceptance notes

- **Clause-② is `yes (widening)`, not the claim's `no`.** The new
published export `preloadGridField()` widens `@object-ui/fields`'s
surface; every existing export keeps its name and shape. It is needed so
a host can have the grid's body in its first render, as the record forms
do.
- **On a cold first open, a master-detail collection shows "Loading
columns…" until the child schema and the grid's body are both in.** The
body load starts on mount and overlaps the schema fetch. A form that
mounts after the body has settled draws its grid at first paint.
- Before this PR, a collection with authored, untyped columns drew those
columns at once and drew them again when the derivation landed.
- **`LineItemsPanel` (the record page's read panel) starts the load but
does not gate on it.** It draws its grid after its own fetches. The pin
covers the create and edit forms the card names.
- **Overlap:** two same-seat drafts conflict with the move of
`widgets/GridField.tsx` to `widgets/grid-field/GridFieldWidget.tsx`.
- objectstack-ai#36351 conflicts in `GridField.lookupAutofill-28245.test.tsx` and the
widget body.
  - objectstack-ai#36392 conflicts in `GridField.test.tsx` and the widget body.
- Whichever lands second re-applies its body hunks to
`grid-field/GridFieldWidget.tsx`. The landing order is the seat's call.
`origin/main` merges cleanly.
- **Outside the claim's file surface:**
`packages/spec/liveness/field.json`, whose evidence pointer moved to the
helper's new file (`check:liveness` exit 0).
- **Out of scope, for the seat to file (L1-d 7078535343):** `React.lazy`
caches a first load failure for the whole session, so a host that
renders `GridField` without `preloadGridField()` and hits one failed
chunk load never recovers until a reload.
- **Possible further carve-out, not done here:**
`widgets/gridCellPanels.tsx` is imported only by the body and could
follow it into `fields-grid` (about 2.5 KB gzip by estimate, not
measured).

## Verification

Read first, by risk:
1. `ui/packages/fields/src/widgets/GridField.ts`: the face, specifically
`GridField`'s `useState(() => gridFieldWidgetModule)` and
`loadGridFieldWidget`'s retry-on-failure.
2. `ui/packages/plugin-form/src/MasterDetailForm.tsx`:
`useGridBodySettled` and the `!d.columns?.length || !gridBodyReady` arm.
3. `ui/scripts/check-eager-closure-budget.mjs`: the LOWERED entry, the
baseline note and the carve-out row.

Two-minute check: `cd ui && pnpm exec vitest run
packages/fields/src/widgets/GridField.test.tsx`. Expect `Tests 92 passed
(92)`, including the three cases of the "lazy face" describe.

---

_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ)_

<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jV3scu6UYPb42n5okQ -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…ted (showOnCreate) (objectstack-ai#36449)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_

repo:objectstack#7 · zhuangjianguo · session_01QsR2jVMKrYARogu1S6PcHj

Part of objectstack-ai#36425 (PR 1 of 2: the field key and its save-time refusal. PR 2
retires the internal create and edit forms in the Console and Studio,
adds the readers of this key, the Studio switch and the lint notice. The
skills text is objectstack-ai#36455, a domain:skills card.)

Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up objectstack-ai#36455

## 维护者速读

-
用户能看到什么变化:这一步用户无感。对象的字段定义可以写「新建时显示」开关(默认开);给必填字段关掉它,保存定义时会被拒绝并说明原因。新建弹窗按这个开关隐藏字段,要等第二个改动。
-
为什么做:这是「内部新建和编辑表单作废」这张卡的前一半,先把字段上的开关定下来,后一半让新建弹窗、整页新建和动作弹出的新建窗口都按字段分组排,并读这个开关。
-
出错会怎样:最坏情况是某个应用包给必填字段关了这个开关,安装或保存时被拒绝,提示里写了两种改法;现有的定义里没有这个开关,不受影响,撤回本次合并即可。
- 要你做什么:无。

## What changes

`FieldSchema` (`packages/spec/src/data/field.zod.ts`) gains
**`showOnCreate`**, an optional boolean.

- **Meaning.** Absent or `true`: the field is asked for when a record is
created, as today. `false`: every create surface (the create dialog, the
full-page create, an action-opened create) leaves the field out;
editing, the record page and lists still show it. The key has no
default, so no field parsed today changes shape.
- **Name and admission (ADR-0085 §2).** Per the seat's reading on the
claim: the key is a field's creation-time intent (which fields this
business asks for when a record is born), not inferable from the schema,
and it binds every create surface rather than one page, so its name
names no page or dialog. The ADR note rides the week's ADR card after
this lands; `docs/adr/**` is untouched here.
- **The one refused pair.** `showOnCreate: false` on a `required: true`
field is refused in `FieldSchema`'s `superRefine`, at the field's
`showOnCreate` key, so every door that parses a field refuses it
(`defineStack`, `os validate`, the metadata save; the object door
locates it at `fields.NAME.showOnCreate`). The reason it gives is the
card's item 6, which makes no exception: a required field is always
asked for when a record is created, so the person creating it sees every
value the record must have. The message names both fixes (keep the field
on create, or drop `required`). A `defaultValue` makes no exception
either (the seat's ruling, card comment 7079131071 item 3): the insert
would resolve the default, so such a create could pass, but the field is
still asked for, with its default filled in. A `requiredWhen` field is
accepted: its gate is a predicate the parse cannot judge, and the write
door still refuses a create born inside it.
- **Liveness ledger.** `liveness/field.json` gains a `showOnCreate` row,
`planned`, evidence the parse-time refusal. Its readers are PR 2's
create surfaces, and the row flips to `live` in that PR, citing them.
- **Generated.** `authorable-surface/data.json`
(`data/Field:showOnCreate`), `liveness/state-counts/field.md`, and the
three reference pages that render `FieldSchema` (`data/field.mdx`,
`data/object.mdx`, `system/migration.mdx`), from `check:generated
--fix`.
- **Changeset.** `@objectstack/spec` minor; `@objectstack/driver-sql`
and `@objectstack/metadata-core` patch, since their every-field-key
ledgers (`FIELD_KEY_STORAGE_CLASS`, `FIELD_REFERENCE_POSITIONS`) now
classify the key.

### What this PR deliberately leaves to PR 2

The claim's lines (`Clause-②: yes (narrowing)`, `Metadata-protocol:
semantic`) describe the whole card. Their narrowing and semantic halves
belong to PR 2, where an internal form stops steering the create and
edit forms; the seat amends the claim when PR 2 opens. Two items move
there by the seat's ruling on this split, and the skills text goes to
its own card:

- the lint notice for a still-declared internal form (card item 8): its
sentence says the form is no longer loaded, which is false until PR 2
retires the readers;
- the Studio switch (card item 7: the `field.form.ts` row, the eleven
metadata-forms locale packs, the field inspector): a switch offered
before any create surface honours it is the shape ADR-0078 rules out;
- the skills text (card item 9) is objectstack-ai#36455 (domain:skills: skills text
lands only in a domain:skills PR), hence `Skills-docs: follow-up
objectstack-ai#36455`.

## Tests

- `packages/spec/src/data/field-show-on-create.test.ts` (new): the key
parses switched on and off and stays absent when not authored;
`showOnCreate: false` beside `required: true` is a full `safeParse`
failure located at `showOnCreate` with a `custom` issue whose message
opens with its first sentence; the same with a `defaultValue`; the
object door locates it at `fields.amount.showOnCreate`; four controls
are full `safeParse` successes (on + required, required alone, off + not
required, off + `requiredWhen`).
- Review round at `1c0012aa`: the refusal's comment, message, describe
and the changeset now give the card's reason instead of saying no create
could pass (L2 S1); the skills follow-up names objectstack-ai#36455 (L1-d). The new
test's message assertion follows the reworded first sentence; that file
and the reconciliation file ran green at `1c0012aa` (`Tests 81 passed`);
`check:generated` 14 of 14 up to date after regenerating the three
reference pages; `check:liveness`, `check-changeset-no-major` and
`check-nul-bytes` exit 0. The rest of the derived set ran at `197434e9`;
this round changed only prose, a test regex and regenerated references.
- CI round at `b86db2be`: Test Core at `1c0012aa` was red in three
shards, all field-key pins this key owes: `metadata-protocol`
`protocol.meta-types-degenerate-derivation.test.ts` (`field` serves 85
top-level properties, was 84), `driver-sql`
`builtin-column-collision.test.ts` ("classifies EVERY FieldSchema key":
`showOnCreate` is `presentation`, the DDL never reads it) and
`metadata-core` `object-schema-fls-references.test.ts` ("classifies
every FieldSchema key": `showOnCreate: keep`, a boolean facet that names
no field). Each of the three files ran green locally at `b86db2be` (18,
11 and 63 tests).
- L1-d round at `d8b82f70`: the changeset adds those two patch entries;
`check-changeset-no-major`, `check-empty-changeset` and
`check-changeset-fixed` exit 0 against `origin/main`. No code changed
since `b86db2be`, where all 74 checks finished green (62 success, 12
skipped).
- Reverse verification (one-off, committed fix first,
`scripts/ablation-replace.mjs`): replacing the refusal's condition with
`false` turned exactly the three refusal cases red and left the controls
green; the file was restored to its HEAD blob (`aebcfbd38223`, `git diff
HEAD` empty).

- Package suite at the head before the last commit: `pnpm --filter
@objectstack/spec test` (local project, under the verify lock) → `Test
Files 1 failed | 871 passed (872)`, `Tests 1 failed | 27913 passed | 1
todo`. The one red was `metadata-form-zod-reconciliation.test.ts`
("field: every top-level key the author may write is offered, or its
omission is recorded" named `showOnCreate`). The last commit records the
key as not yet offered (an `omit` row whose reason is the `planned`
grade; PR 2 deletes the row and offers the switch); that file and the
new test then ran green at `197434e9`: `Test Files 2 passed`, `Tests 81
passed`.
- `pnpm --filter @objectstack/spec typecheck` → exit 0.
`scripts/liveness/` (repo project) → `Test Files 2 passed`, `Tests 87
passed`.
- `test:repo` beyond `scripts/liveness/` is left to CI's Test Core: the
diff touches no repo-project test.

## Acceptance notes

- Overlap at push (`d8b82f70`, unchanged from `b86db2be`):
`overlap-check.mjs` reports clean merges with `origin/main` and objectstack-ai#36435,
objectstack-ai#36411, objectstack-ai#36386, objectstack-ai#36351. objectstack-ai#36392 conflicts only in the generated
`liveness/state-counts/field.md`; objectstack-ai#36399, which also adds a field key,
conflicts there and in the `field` property-count pin, which whichever
lands second raises by one and regenerates.
- The card's acceptance lines are UI readings (the create dialog, the
full-page create, the action modal, the Studio switch). They are PR 2's,
with live checks and screenshots there; this PR has no rendered surface.

## Verification

<details><summary>Derived gate families at 197434e: 115 derived, 114
run green, 1 NOT MEASURED</summary>

- `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack
--commands` derived 115 commands; each ran with its exit code recorded
before any pipe, and `--ran` reconciled: "115 derived famil(ies)
accounted for — 114 run, 1 NOT-MEASURED".
- Seven families first exited 3 (PREREQUISITE NOT MET: a
`packages/spec/dist` the loop's own siblings had rebuilt without
declarations, and the shallow clone missing the teardown fixture
commit). After `pnpm --filter @objectstack/spec build` and fetching the
fixture commit, all seven re-ran at exit 0: `check-plugin-teardown-shape
--self-test`, `check:api-surface`, `check:dual-source-exports`,
`check:entry-nameability`, `check:exported-any`, `check:generated` (it
had reported `api-surface/` stale against that same dist; 14 of 14 up to
date after the rebuild), `check:skill-examples`.
- NOT MEASURED: `pnpm check:dual-build-cjs-loads` (exit 3, prerequisite
not met in this container), left to CI.
- `node scripts/check-nul-bytes.mjs` → exit 0.

</details>

Two-minute check: `pnpm --filter @objectstack/spec exec vitest run
src/data/field-show-on-create.test.ts` → 5 passed.

First files to read: `packages/spec/src/data/field.zod.ts` (the
`showOnCreate` key beside `hidden`, and the new `superRefine` block
before `referenceVia`), `packages/spec/liveness/field.json` (the
`planned` row).

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj
<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jVMKrYARogu1S6PcHj -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…ctions only; Edit moves into the top bar's More (objectstack-ai#36478)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbVF7sWPNE4HmjkgyaVxQYif)_
repo:objectstack#7 · zhuangjianguo · session_01QsR2jRaJbQ4vqdv4J5peqA

Fixes objectstack-ai#36151

Clause-②: yes (widening)
Metadata-protocol: semantic
Skills-docs: none — no published skill under `skills/` names
`mobileMaxVisible`, the phone record page's bottom bar or its Edit
button (searched); the authoring change is one budget's meaning, taught
in the spec describe and `content/docs/ui/pages.mdx` here.

## 维护者速读

-
手机上打开记录页:底部按钮条只放这个对象自己的动作(最多两个,撑满一行);没有动作的对象不再出现底部条,内容一直到屏幕底部;「编辑」挪进右上角「更多」。电脑端不变。
- 手机记录页改版的一步:字段已能点一下直接改,底部那颗占位的「编辑」按钮不再需要,把底部留给真正的业务动作。
- 出错时,手机用户会找不到整页编辑的入口,或看到空白的底部条;把本次改动撤回即可恢复原样,不涉及数据。
- 无。

## What changes

On a phone (the console's record page, `phonePage`), per the card's five
ruled items:

1. **Edit leaves the bottom bar.** The record's Edit is forced into the
`⋯` on the phone (`component: 'action:menu'` on the host's `sys_edit`,
always, not only when Edit is off). A field's value is edited by one tap
on it (objectstack-ai#36147, PR objectstack-ai#36234); whole-record edit is ⋯ → Edit, which calls
the same `onEdit` handler the bar's Edit called (inline edit state on an
object without a form, the form route on one with a form).
2. **The bottom bar holds the object's own actions only**: the primary,
then the next one, budget unchanged (`PHONE_ACTION_BAR_BUTTONS` = 2, or
the authored `mobileMaxVisible`), filling the row (`flex-1`). The edit
state keeps its Cancel and Save there.
3. **No action, no bar.** With nothing to draw the toolbar returns
nothing and the host's bar hides itself (`:has(> [role=toolbar]:empty)`
/ no toolbar), so the body runs to the foot of the screen.
4. **Approval unchanged.** A record pending the reader's approval still
draws [Approve][Reject][⋯] from `RecordHeaderStateContext`'s state group
with its own `⋯`; the top bar draws no second `⋯` then (one `⋯` per
screen).
5. **Everything else is in the top bar's `⋯`**, at the right end of
`RecordTopBar` (its `frame` slot): actions past the budget, Refresh,
Edit (on or off with its reason), Share, Delete. The favorites entry is
not in it: since objectstack-ai#36246 (PR objectstack-ai#36456) the favorite star sits beside the
record's name, on the phone too.

Mechanism:

- `PageHeaderPhoneFace` (the `PageHeaderPhoneContext` value, a host
slot, never metadata) gains an optional `more: HTMLElement | null`.
`PageHeaderActions` in its bar face portals the `⋯` there when a host
hands it; a host that does not hand it keeps the `⋯` as the bar's last
button, byte-for-byte as before (the legacy pins in
`page-header-phone-bar-27058.test.tsx` are untouched and green).
- `RecordDetailView` hands a `span[data-record-phone-more]` it mounts in
the top bar's `frame`.
- Desktop: no change (the `face: 'row'` path is not touched).

Spec / docs: `page:header` `mobileMaxVisible` describe now says the
phone bar holds the page's own actions and Edit is in the top bar's `⋯`;
generated docs regenerated (`check:generated --fix`,
`gen-sdui-manifest-node.mjs`, `gen-sdui-reference.mjs`), hand-written
`content/docs/ui/pages.mdx` and the designer's config description
updated to match. Semantic change: an unset budget now shows two page
actions where it showed Edit + one, and an authored value counts the
page's actions alone.

Rulings carried (not reopened): the card's five items; the maintainer's
「可以,立卡」 on fig. 48; ruling 7066516044 item 2 (a single tap edits on the
phone). Linked rules this card reverses, as the claim names: objectstack-ai#34595 (the
bottom bar starts with Edit), and the Edit-counted half of objectstack-ai#35840 (two
visible by default: still two, now both page actions).

## Tests

Step 0 (owed before Edit leaves the bar): every field type the default
record page draws editable was checked at 375 px with touch emulation on
the live showcase Field Zoo record: one tap on the value opens its
editor, and the edit saves (a PATCH carrying that field's key). **All
pass; no type raised.**

| Result | Types |
|---|---|
| one tap opens, saves | textarea, email, url, phone, markdown, number,
currency, percent, date, datetime, time, boolean, toggle, select,
multiselect, radio, checkboxes, tags, lookup, lookups (multiple),
master_detail, tree, user, users, owner (current_user default),
location, address, code, json, color, rating, slider, signature, qrcode,
progress, the system Owner |
| not drawn editable (same on desktop, `INLINE_EXCLUDED_FIELD_TYPES` /
read-only by kind) | password, secret, html, richtext, formula,
autonumber |
| not drawn as a detail row | media, embedded and vector types |

Pins updated where they pinned the reversed behaviour:

- `RecordDetailView.phoneFace-27058.test.tsx` (the objectstack-ai#34595 pins): the bar
is [Convert Lead][Assign] with no `⋯`; the `⋯` is the top bar's last
control and holds Edit and Share; a third action folds into the top `⋯`
before Edit; one action fills the row; no action leaves an empty, hidden
bar and ⋯ → Edit calls `onEdit`; the approval control and the Edit-off
cases read the top `⋯`.
- `RecordDetailView.favoritesEntry-12427.test.tsx` (objectstack-ai#36246's pins,
merged in with origin/main): the phone case now opens the top bar's `⋯`
(the fixture object declares no action, so its bottom bar is drawn
empty); the CONTROL is that menu's Edit and Share, and the assertion
that the `⋯` holds no favorites entry is unchanged. Its mount helper
waits for the top bar's `⋯` on that case instead of a toolbar.
- `RecordDetailView.recordPageTiers-26678.test.tsx`: the phone branch
reads the empty bottom bar and the top bar's `⋯`.
- `page-header-phone-bar-27058.test.tsx`: new `the phone bar with the
host's top-bar ⋯ slot` describe (two actions fill the row and the `⋯`
sits in the slot; no page action draws an empty bar; slot not yet
mounted draws no `⋯`).
- `ui/e2e/record-flow-phone-targets.spec.ts`: the geometry fixture draws
the top bar's More (`h-11 w-11`) and an actions-only bar; 6 passed
locally.

Ablations (one-shot, not kept; both restored, blob == HEAD verified by
`scripts/ablation-replace.mjs`):

- `RecordDetailView`: Edit forced into the `⋯` only when off (the old
rule) ⇒ phoneFace suite 6 failed / 22 passed.
- `PageHeaderActions`: top-bar slot ignored (`moreInTopBar = barFace &&
false`) ⇒ 13 failed / 29 passed across the two suites.

Readings on head `a262ef3653` (origin/main merged in, carrying objectstack-ai#36456;
the spec reference regenerated on the merged tree; the favorites pin
moved to the top `⋯`; the changeset's `⋯` list drops Favorites): `vitest
--maxWorkers=1` on favoritesEntry-12427, phoneFace-27058,
recordPageTiers-26678, page-header-phone-bar-27058 and
headerMenuIcons-12529: Test Files 5 passed (5), Tests 65 passed (65),
exit 0; `@object-ui/app-shell` `type-check` VERDICT command-exit 0;
`pnpm --dir ui exec vitest run scripts/` 5127 passed, 2 skipped, exit 0;
`dispatch-gates --ran` 125 derived, 123 exit 0, 2 NOT MEASURED (the same
two exit-3 prerequisites below). The readings below were taken on code
head `ec741d2c08`, before the merge:

<details><summary>Unit suites, type-check, local gate subset</summary>

- `vitest run --maxWorkers=1` phoneFace-27058 + recordPageTiers-26678 +
page-header-phone-bar-27058 (under the verify lock): Test Files 3 passed
(3), Tests 52 passed (52), exit 0.
- `pnpm --dir ui exec vitest run scripts/` (a derived family): Test
Files 172 passed, 2 skipped (174); Tests 5127 passed, 2 skipped; exit 0.
- `@object-ui/components` and `@object-ui/app-shell` `type-check` (both
`tsc --noEmit` and `tsconfig.test.json`, so the edited tests are in):
VERDICT command-exit 0, after building the `@object-ui/app-shell^...`
closure (a stale `@object-ui/types` dist had first reported a
`DataTableSchema.onColumnHide` error outside this diff; rebuilt, gone).
- Earlier on this branch, before the last test-only commit:
RecordDetailView*, page-header*, record-top-bar* suites 133 files / 1144
tests, the one red being the tiers pin fixed in `ec741d2c08`; ESLint on
the changed files 0 errors.
- `dispatch-gates --ran`: 125 derived families accounted for, 123 run
with exit 0, 2 NOT MEASURED (exit 3, PREREQUISITE NOT MET:
`check:skill-examples` needs a built `@objectstack/client-react`,
`check:dual-build-cjs-loads` needs studio, client-react and other dists
outside this diff; both run in CI).
- `@objectstack/spec` `check:generated` green after `--fix`;
`check:sdui-reference` and `check-sdui-manifest` green.
- Not run locally, CI-owned: `test:repo`, the repo-wide lint, the
artifact-roster and wide families.

</details>

## Acceptance notes

- **The card's own example, the HotCRM lead, measured live at 375 px
(zh-CN).** HotCRM at origin/main `689166c` ran from a sister worktree
with its own setup (`objectstack dev`, published 18.6.0 server packages,
fresh seeded DB), and this branch's Console vite was proxied to it. The
record was a New lead (Noah Patel - Vertex Analytics), where 「确认线索」
(`qualify_lead`) is visible.
- Before (origin/main renderer): the bar was [编辑][确认线索][⋯]; the ⋯ held
刷新 / 转化线索 / 安排跟进 / 记录通话 / 记录会议 / 安排会议 / 添加到收藏 / 分享 / 删除 (main before
objectstack-ai#36456).
- After (this branch): the bar is [确认线索][转化线索], with no 编辑. The top
bar's ⋯ holds 刷新 / 安排跟进 / 记录通话 / 记录会议 / 安排会议 / **编辑** / 添加到收藏 / 分享 / 删除,
measured on `75f16a89de`, before objectstack-ai#36456 landed. Since objectstack-ai#36246 (PR objectstack-ai#36456)
添加到收藏 has left the ⋯ for the star beside the record's name, so on the
current head the top ⋯ holds the same list without it (pinned by
`RecordDetailView.favoritesEntry-12427.test.tsx`'s phone case).
- Why 转化线索 is in the bar too: ruled item 2 keeps the bar budget at its
current rule, at most 2 (「最多 2 个,沿用现在的规则」). The slot 编辑 gave up goes to
the lead's next action, `convert_lead`. The card's wording 「只有确认线索」
describes the old bar with 编辑 removed. To show 确认线索 alone, HotCRM sets
`mobileMaxVisible: 1` on the lead page's `page:header` (an app-side
authoring choice, not made here; raised to the seat in the report).
- For non-zh readers, the showcase Task shows the same thing: the bar
holds only the object's own actions ([Log Time][Archive]), there is no
Edit, and the top ⋯ holds Edit.
- Edit is in the top `⋯` on the phone in every state, including the
record's edit state (where the bar is Cancel/Save).
- A host button on the phone (the queue's Claim) still sits in the bar
ahead of the page actions and counts toward the budget, as before.
- Overlap: objectstack-ai#36357 also regenerates `scripts/sdui-manifest.record.json`
(a generated sha/date pair); whichever lands second regenerates it.
Clean against objectstack-ai#36438, objectstack-ai#36392, objectstack-ai#36351, objectstack-ai#36343 and origin/main.
- Out of scope, reported to the seat (not fixed here): in the lookup
picker on a phone, an option's preview carries a record chip link; a tap
on the chip navigates away mid-edit instead of selecting (Field Zoo,
Master-Detail → Project, tap the "Account: Fabrikam" chip ⇒ the account
page opens).

## Verification

Read first (by risk):

1. `PageHeaderActions` in
`ui/packages/components/src/renderers/layout/containers.tsx`: the
`moreInTopBar` branch (the portal into the host slot and the early
return that leaves the bar empty).
2. `RecordDetailView` in
`ui/packages/app-shell/src/views/RecordDetailView.tsx`: `sys_edit`'s
phone `component: 'action:menu'`, the top bar's `frame` slot and the
bar's empty-hide class.
3. `PageHeaderPhoneFace` in `page-header-phone-context.ts`: the new
optional `more`.

Two-minute check: open a New HotCRM lead at 375 px ⇒ [确认线索][转化线索] at the
foot, 编辑 in the top-right ⋯. Or open any record of an object with no
actions of its own (showcase Account) at 375 px wide ⇒ no bottom bar, a
`⋯` at the top bar's right end holding Refresh / Edit / Share / Delete,
and the favorite star beside the record's name. A showcase Task ⇒ [Log
Time][Archive] filling the bottom row.

Screenshots at 375 (live showcase, evidence branch
`claude/issue-36151-evidence`):

| State | Before | After (light) | After (dark) | After, `⋯` open |
|---|---|---|---|---|
| No action (Account) |
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/before-no-primary-light.png?raw=true)
|
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/after-no-primary-light.png?raw=true)
|
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/after-no-primary-dark.png?raw=true)
|
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/after-no-primary-light-menu.png?raw=true)
|
| Actions (Task) |
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/before-primary-light.png?raw=true)
|
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/after-primary-light.png?raw=true)
|
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/after-primary-dark.png?raw=true)
|
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/after-primary-light-menu.png?raw=true)
|
| HotCRM lead (zh-CN) |
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/before-hotcrm-lead-light.png?raw=true)
|
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/after-hotcrm-lead-light.png?raw=true)
| not taken |
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/after-hotcrm-lead-light-menu.png?raw=true)
|
| Approval (Project) |
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/before-approval-light.png?raw=true)
|
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/after-approval-light.png?raw=true)
|
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/after-approval-dark.png?raw=true)
|
![](https://github.com/objectstack-ai/objectstack/blob/claude/issue-36151-evidence/evidence/issue-36151/after-approval-light-menu.png?raw=true)
|

The screenshots were taken before objectstack-ai#36456 landed, so the open `⋯` shots
still show Add to favorites / 添加到收藏. Since objectstack-ai#36246 that entry has left
the `⋯` for the star beside the record's name.

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QsR2jRaJbQ4vqdv4J5peqA
<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jRaJbQ4vqdv4J5peqA -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…led locked chip (objectstack-ai#36529)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9GPJ8pmbK219Pay95x25Uno)_
Fixes objectstack-ai#36507
Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:在仪表盘或报表上按「客户行业」这类关联字段钻取后,弹出列表顶部那枚锁定的条件标签,从「所属客户:= [object
Object]」变成「所属客户的行业:科技」(英文界面为「Account › Industry: Technology」)。
- 为什么做:属于「报表与仪表盘」专题,补上钻取弹窗那张卡留下的另一半,让读者看懂这份名单是按什么筛出来的。
- 出错会怎样:只影响这枚标签的文字,列表里筛出的记录不变;读不到关联对象的定义时退回显示原始字段名,可直接撤回。
- 要你做什么:无。

## What changes

- `ui/packages/plugin-list/src/conditions/conditionModel.ts` —
`readViewConditions` reads the nested-relation form (a lookup whose
condition is one related field equal to one scalar), as written and as
lowered to the triple `[lookup, '=', { field: V }]`, into one locked
chip whose `field` is the path `lookup.field` and whose operator is
`equals`. A plain-object value in a triple is never printed any more: a
nested condition the chip cannot say as one equality (several fields, an
operator map, a deeper relation, a non-`=` operator) reads as the
field-less 「View filter」 chip, which the model's header already promised
for any shape it does not read. New module-internal helper
`relationPathOf` (not exported from the package barrel). The
plain-object test is `isPlainRecord` imported from
`@objectstack/spec/data`, not a local copy (`check:spec-symbols` refuses
a local declaration under a spec export's name).
- `ui/packages/plugin-list/src/conditions/ListConditionControls.tsx` —
`viewChipText` labels a path chip as `relationPath(lookup label, related
field label)` + the value through `describeConditionValue` on the
related field, so a select's option label shows. New hook
`useRelatedConditionFields` reads the related object's definition
(`getObjectSchema(referenceTo)`, one read per distinct target, only
while such a chip is on screen, keyed on the target names) and
translates the field and option labels with `useSafeFieldLabel`
(`fields.OBJECT.FIELD`, `fieldOptions.OBJECT.FIELD.VALUE`), falling back
to the declared label, then the raw name. No record-name read is made
for a path chip.
- `listConditions.chips.relationPath` added to the default translations
and to all eleven locale packs, each in its own word order (`{{lookup}}
› {{field}}` in en/de/es/fr/pt-BR, `{{lookup}}的{{field}}`
zh-Hans/zh-Hant, `{{lookup}}の{{field}}` ja, `{{lookup}}의 {{field}}` ko,
`{{field}} ({{lookup}})` ru/ar).
- `.changeset/36507-drill-relation-chip.md` — patch,
`@object-ui/plugin-list` and `@object-ui/i18n`.

No new public ListView prop, no objectql change, no change to the
filter's execution shape: the chip is locked, as the card rules.

**Request count:** a list whose view filter carries a relation-path
condition makes one more `getObjectSchema` call per related object (the
HotCRM drill: `crm_account`, once). The ObjectStack adapter serves it
from its `metadataCache`. Lists with no such condition make no new call
(pinned by the CONTROL case).

**Shape measured:** PR objectstack-ai#36461's `drillConditions.ts` (read at its head
`5af2f6e3`) keeps the nested relation part as the list's base `filter`
(`{ crm_account: { industry: V } }`). `ListViewBlock`'s
`ElementDataSourceGate` lowers it through `toFilterNode` →
`convertFiltersToAST`, whose nested-relation arm writes `[field, '=',
condition]`. So the list's `readViewConditions` receives the triple,
which matches the card's measured chip (`data-field=crm_account`,
「所属客户:= [object Object]」). Both that triple and the card's written form
are read.

## Tests

Pins live in the shared harness
`ui/packages/plugin-list/src/conditions/__tests__/listConditions.test.tsx`
as a new top-level `describe` (AGENTS.md: a new pin for a component that
already has a shared harness file goes into that file), not in new
per-card files:

- model: the triple, the written object, the array element; two
unreadable nested shapes read as the field-less chip; CONTROL
`['amount', '>=', 10]` unchanged.
- en: chip reads `Account › Industry: Technology`,
`data-field="crm_account.industry"`, one
`getObjectSchema('crm_account')`, no `find`.
- zh-CN (I18nProvider, app bundle with `fields.crm_account.industry` and
`fieldOptions.crm_account.industry.technology`): chip reads
`所属客户的行业:科技`, the aria-label too.
- fallbacks: lookup not among the list's fields ⇒ `crm_account ›
industry: equals technology`, no read; definition read rejects ⇒
`Account › industry: equals technology`.
- CONTROL: a same-object view condition reads `Amount: >= 10`,
`data-field="amount"`, and reads no definition.

Existing tests changed: none.

## Acceptance notes

- The fallback chip text when the related definition cannot be read
keeps the operator word (`equals technology`): that is
`describeConditionValue`'s existing wording for an unknown field, the
same a same-object chip on an unknown field gets.
- A relation-path condition inside an `and` AST node at the top (a drill
whose base filter keeps two or more parts, e.g. a nested relation plus
an `$or`) still reads as one 「View filter」 chip: the model reads `and`
nodes that way for every condition, and the card names only the single
nested form. Not changed here.
- Latin-script packs (de/es/fr/pt-BR) carry the same format string as
en; the non-Latin packs carry their own word order, which
`untranslated-identity-4376.test.ts` asks for.

## Verification

Two-minute check: `pnpm --dir ui exec vitest run
packages/plugin-list/src/conditions/__tests__/listConditions.test.tsx -t
"related record"` ⇒ 6 passed.

Read first: `conditionModel.ts` `tripleChip` (the plain-object arm),
`ListConditionControls.tsx` `useRelatedConditionFields`, then
`viewChipText`.

<details><summary>Test and gate readings</summary>

All readings at head `6db1538b` (base origin/main `316f7571`).

- Patch round: `Type Check UI` was red at `749ddb3e` on
`check:spec-symbols`: `conditionModel.ts` declared a local
`isPlainRecord`, a name `@objectstack/spec/data` exports. `6db1538b`
imports the spec's (same predicate) and deletes the local copy. That
job's script steps rerun locally at `6db1538b` after the spec closure
build: `check:phantom-deps`, `check:self-import`,
`check:unreferenced-sources`, `check:doc-example-readers`,
`check:handler-key-reads`, `check:metadata-write-doors`,
`check:published-tsconfig-exclude`, `check:side-effects-array`,
`check:element-data-source-declaration`, `check:esm-specifiers`,
`check:spec-symbols`, `check:action-forward-parity`,
`check:designer-field-key-parity`, `check:icon-record-names`,
`check:i18n-keys`, `check:i18n-drift` ⇒ every one exit 0. The job's
turbo type-check over all ui packages is left to CI; the two packages
this diff touches were type-checked below.
- Dependency closure: `pnpm --workspace-concurrency=2 --filter
'@object-ui/plugin-list^...' build` under the verify lock ⇒ `VERDICT
command-exit 0`.
- Package tests: `vitest run packages/plugin-list/ packages/i18n/` at
the first commit ⇒ 290/291 files, 1 failed:
`untranslated-identity-4376.test.ts` flagged the new key byte-identical
to en in zh/ja/ko/ru/ar. Fixed by giving those packs their own word
order (third commit). At `6db1538b`: `vitest run
packages/plugin-list/src/conditions/ packages/i18n/` ⇒ `Test Files 108
passed (108)`, `Tests 2046 passed | 13 skipped`, `VERDICT command-exit
0`.
- At `6db1538b`: `pnpm --filter @object-ui/plugin-list run type-check`
and `pnpm --filter @object-ui/i18n run type-check` ⇒ `VERDICT
command-exit 0` (the harness file is in `tsconfig.test.json`'s program,
`--listFilesOnly` count 1).
- Ablation (committed fix first; `scripts/ablation-replace.mjs`, anchor
x1 → x0, blob `cfa314f0` → `87ab0641`): the plain-object arm of
`tripleChip` removed ⇒ 5 of the 6 new cases red, the CONTROL green; the
zh-CN case received `所属客户:= [object Object]`, the card's measured chip.
Restored: blob == HEAD `cfa314f0`, `git diff HEAD` empty.
- Derived gates (`dispatch-gates.mjs --commands`, 41 families, same list
at `6db1538b` as at `749ddb3e`): every one run untimed, every one `exit
0`. `--ran` reconciliation: 41 derived, 41 run, 0 NOT-MEASURED (a
derived zero).
- `pnpm --dir ui exec vitest run scripts/` under the lock at `6db1538b`
⇒ `Test Files 172 passed | 2 skipped`, `VERDICT command-exit 0`.
- `node scripts/pm/overlap-check.mjs
--branch=claude/issue-36507-drill-relation-chip` at `6db1538b` ⇒
`VERDICT clean exit 0` (merges cleanly with origin/main and with objectstack-ai#36437,
objectstack-ai#36411, objectstack-ai#36351, which share the locale files).

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmRGDrq6JSytBsNFabU -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…, and object-grid singleClickEdit is retired (objectstack-ai#36357)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9Ubb2rJZB694pnkwLCMmCEJ3ev)_

Fixes objectstack-ai#36270

repo:objectstack#7 · zhuangjianguo · session_01QsR2jSHfkSrXZxbdWoQxnW

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — skills/ never names singleClickEdit,
keyboardNavigation or object-grid's editing gestures (git grep at the
head)

## 维护者速读

- 用户看到的变化:所有「可编辑」的表格(对象视图自己画的表格、页面里放的 object-grid
表格,和列表页一样)都改成「先选中、再编辑」:单击选中单元格,双击、回车、F2 或直接打字进入编辑,改完一格立刻保存;「全部保存 /
全部取消」那条保存栏不再出现。不可编辑的表格不变,单击仍然打开记录。元数据里的
`singleClickEdit`(单击即编辑)作废:写了会报错并提示删掉,`os migrate meta` 能自动删除。
- 为什么:按您的裁定 A「统一新编辑方式」。新方式里单击是「选中」,`singleClickEdit` 已经没有可切换的东西,按
ADR-0049「要么执行、要么删除」退役;`keyboardNavigation` 的说明也改成实际行为(可编辑表格上方向键导航始终开启)。
- 最坏情况:有人在页面元数据里写了
`singleClickEdit`,升级后该页面校验失败,需要删掉这个键(提示里写明了怎么做,迁移工具可自动删);或者某张可编辑表格的使用者习惯了单击就编辑,现在要多一次双击。本仓、hotcrm、gallery
中没有任何地方写过这个键。
- 需要您做的:无(L2 由席位在最终提交上做)。

## What changes

The ruling A on objectstack-ai#36270 (record 7076617499): one editing model. Every
grid that renders editable uses the list page's select-first cell model,
and the key that only made sense in the old model is retired.

- **`ui/packages/plugin-grid/src/ObjectGrid.tsx`** (the one behaviour
hunk): `hostCellSelection = cellSelectionProp ?? inlineEditable`. Absent
a host's `cellSelection`, a grid that renders editable (`editable` AND
the object's inline-edit verdict AND the reader's `update` grant) is
select-first; a read-only grid keeps click-to-open. A host's `true`
(`ListView`, the related tab) or `false` still wins. The data table is
handed `singleClickEdit: true` unconditionally: it is inert under
select-first, and it is the staged model's old default for a host that
passes `false`.
- **`@objectstack/spec`**:
`ComponentPropsMap['object-grid'].singleClickEdit` is a `retiredKey()`
tombstone; D2 conversion `object-grid-single-click-edit-removed` (strip,
whatever the value; order 83), D3
`object-grid-single-click-edit-retired`, `RETIRED_KEYS_BY_MAJOR[18]` row
`ui/ObjectGridProps:singleClickEdit`, a `STEP18_RATIONALE` fragment
(order 123), ledger `page.json` regions note [122] plus the narrowed
[43]. `keyboardNavigation`'s describe narrows to what is enforced:
always on for a grid that renders editable, `true` turns it on for a
read-only grid.
- **`@object-ui/types`**: `ObjectGridSchema.singleClickEdit?: never`
with a `retirementTombstone()` zod twin; the `object-view` `table` slot
inherits it (`TABLE_INHERITED_TOMBSTONES`, as `defaultSort`).
`DataTableSchema.singleClickEdit` (host-paired) is unchanged.
- **`@object-ui/plugin-view`**: `table.singleClickEdit` leaves
`OBJECT_VIEW_TABLE_RELAY_KEYS`. The earlier host-level `cellSelection`
spread is gone: `ObjectGrid`'s default covers the object-view grid,
authored nodes and react pages in one place.
- **`object-grid` inputs, `sdui.manifest.json`,
`content/docs/ui/components/*`**: the `singleClickEdit` input is gone
and the `editable` / `keyboardNavigation` descriptions say what the grid
does. Docs and READMEs (`plugin-grid.mdx`, `plugin-view.mdx`, both
packages' READMEs) describe select-first everywhere and the staged model
as a host's `cellSelection={false}`.
- BREAKING changeset
`.changeset/36270-object-grid-single-click-edit-retired.md`
(`@objectstack/spec` minor plus the three ui packages), with the FROM →
TO table and `<!-- adr-0087: registered … -->`.

## The card's Done-when: the five grid families

- **The object-view grid** (Studio view preview, a page placing an
`object-view`) and **the authored `object-grid` node**: changed here.
Pinned by `ObjectView.perCellSave-36270.test.tsx` and
`authoredGridPerCellSave-36270.test.tsx`, with the ablation below.
- **The related tab**: already select-first. `RelatedList.tsx` passes
`cellSelection: true`, pinned by `RelatedList.tab-35892.test.tsx`;
unchanged.
- **The record picker and the designer grids** (`RecordPickerDialog`,
`ObjectManager`, `FieldDesigner`): they render `ObjectGrid` without
`editable`, so they are read-only and unchanged.
- **Dashboard tables**: they are `data-table` / `object-data-table`
nodes, not `ObjectGrid`, and have no save path. The card's
dashboard-table pin therefore has no subject: there is no editable
dashboard grid to pin. A bare `data-table` that a host hands `editable`
still stages edits and draws its bar; that is the table primitive, which
no in-repo grid host reaches.
- So every grid that renders editable through `ObjectGrid` selects a
cell first, and no in-repo host passes `cellSelection={false}`.
- **The card's second Read-first question** (a child list inside a
parent form saved together, objectstack-ai#35590): no in-repo host draws such a list
through an editable `ObjectGrid`. The form's line items are the
`GridField` widget, which this PR does not touch, and no in-repo host
passes `cellSelection={false}` or its own `onBatchSave`. So no
saved-together list loses its staging here.
- **A React host's `onBatchSave`**: a host that passes `onBatchSave`
alone on an editable `ObjectGrid` now has it bypassed (each cell writes
through `onRowSave` or the grid's own `dataSource.update`). No in-repo
host passes it. The changeset carries a FROM → TO row for it and
`ObjectGridComponentProps.onBatchSave` is marked `@deprecated`.

## Tests

- New: `packages/spec/src/ui/object-grid-single-click-edit.pin.test.ts`
(tombstone at both channels for `true` / `false`, `editable` control,
the narrowed describe, the conversion's delete and its controls, the
step-18 wiring), `object-grid-single-click-edit-retirement.test.ts`
(tree-scoped absence, `repo` project),
`ui/packages/plugin-grid/src/__tests__/authoredGridPerCellSave-36270.test.tsx`
(an authored editable node saves one cell with no Save All; read-only
and host-`false` controls), and the earlier
`ObjectView.perCellSave-36270.test.tsx`.
- Migrated to the enforced contract:
`ObjectGrid.keyboardNavigation-11068.test.tsx` (editable grids read the
select-first pattern and `false` no longer turns it off; a host
`cellSelection={false}` control keeps the old roving-focus reading),
`ObjectGrid.cellSelection-35684.test.tsx`,
`rowContextMenu-28434.test.tsx`, the types slot/round-6 tests, the
ObjectView relay test.
- 25 plugin-grid inline-edit files that pin the staged path now pass
`cellSelection={false}` and no longer author `singleClickEdit`; two that
passed `cellSelection={x || undefined}` pass `cellSelection={x}` (under
the new default `undefined` means select-first).
- `retired-key-removal-version.pin.test.ts` joins the new conversion.

## Acceptance notes

- Select-first only where a grid renders editable, per the ruling;
read-only grids keep click-to-open (pinned by the controls above).
- `Clause-②: no (narrowing)`: the house spelling for a retirement; the
seat re-amended the claim to it (7077058264).
- Census of authored `singleClickEdit` in this repository's examples,
hotcrm and gallery: zero, so the conversion is for stored rows and
outside authors.
- `check-governed-merges --pr 36357`: NOT governed (0 of 60 paths),
1,355 changed lines, under the 3,000 human-merge threshold.
- With objectstack-ai#36332 (seat delta review 7077725274): once both land, a touch
never edits in place on any editable grid. The one exception is a host
that passes `cellSelection={false}`, which keeps the staged
click-to-edit, so there a touch edits in place. Whichever of the two
lands second re-runs overlap-check against the other's head.
- objectstack-ai#35827 (retire `onBatchSave`) is unblocked by this: no authored or
ObjectView grid reaches the batch save any more; only a host's explicit
`cellSelection={false}` does.

## Verification

Two-minute check: author `{ "type": "object-grid", "properties": {
"objectName": "<any>", "editable": true } }` on a page; click a cell (it
is selected, nothing opens), press Enter, type, press Enter: the value
saves at once and no "Save All" bar appears. Add `"singleClickEdit":
true`: the page refuses it with the prescription.

Files to read first, by risk:
`ui/packages/plugin-grid/src/ObjectGrid.tsx` (two hunks),
`packages/spec/src/ui/component.zod.ts`,
`packages/spec/src/conversions/entries/18/object-grid-single-click-edit-removed.ts`,
`ui/packages/types/src/zod/objectql.zod.ts`.

<details><summary>Local runs (final head 493b6a0)</summary>

Final head `493b6a01` = `2bd02429` plus a merge of main `0b2118f4` after
objectstack-ai#36478 landed (`719e8674`: main's side of
`scripts/sdui-manifest.record.json`, and `component.mdx` regenerated
with main's new `mobileMaxVisible` describe), then the regenerated
manifest record (`493b6a01`, one `sha256` line). No rebase.

- Dogfood battery on head 493b6a0: os-verify-lock `VERDICT command-exit
0` · `Test Files 485 passed | 3 skipped (488) · Tests 4108 passed | 68
skipped (4176)`, no failures.
- Derived gate families on 493b6a0: 132 run, 0 NOT-MEASURED, every exit
0. `check-sdui-manifest` intact; `check-regen-pending` clear.
- `overlap-check` on 493b6a0: clean against main `43916f3a` and every
open PR sharing files.
- CI at 493b6a0: 61 success, 9 skipped, 0 failed.

Runs at 2bd0242:

Final head `2bd02429` = a merge of `67fe4551` and main `dda5e74f`, made
after the merge queue dropped the PR on a conflict in the generated
`content/docs/references/ui/component.mdx`. The merge's only own change
is that file, regenerated (main's new `showStar` describe). The code
auto-merged, and `check-regen-pending` reports every deferred artifact
current.

- Dogfood battery on 2bd0242 (superseded by the run on 493b6a0 above):
os-verify-lock `VERDICT command-exit 0` · `Test Files 485 passed | 3
skipped (488) · Tests 4108 passed | 68 skipped (4176)`, no failures.
- Derived gate families on 2bd0242: 132 run, 0 NOT-MEASURED, every exit
0.
- `overlap-check` on 2bd0242: clean against main `70194ffc`; the known
conflict with draft objectstack-ai#36478 on `scripts/sdui-manifest.record.json`
stands.

Runs at 67fe455:

Final head `67fe4551` = `4e94a273` plus the S4 changeset fix (the touch
sentence, and one comment's wording). That commit changes only the
changeset and that comment.

- Dogfood battery on head 67fe455 (`pnpm --filter @objectstack/dogfood
test`, closure built under the lock): os-verify-lock `VERDICT
command-exit 0` · `Test Files 485 passed | 3 skipped (488) · Tests 4108
passed | 68 skipped (4176)`, no failures.
- Derived gate families on 67fe455: 132 derived; `--ran` reconciles 132
run, 0 NOT-MEASURED, every exit 0.
- `overlap-check` on 67fe455: clean against main; one conflict with
draft objectstack-ai#36478 in `scripts/sdui-manifest.record.json` (the regenerated
manifest record both PRs carry): whichever lands second merges main and
regenerates it.

`4e94a273` = the review rework (`3894ea44`: TSDoc and comments,
`onBatchSave` `@deprecated`, changeset rows, docs) plus a merge of main
after objectstack-ai#36332 landed (no rebase, no conflicts).

- Dogfood battery on 4e94a27 (superseded by the run on 67fe455 above)
(`pnpm --filter @objectstack/dogfood test`, closure built under the
lock): os-verify-lock `VERDICT command-exit 0` · `Test Files 485 passed
| 3 skipped (488) · Tests 4108 passed | 68 skipped (4176)`, no failures.
- Derived gate families on 4e94a27: 132 derived; `--ran` reconciles 132
run, 0 NOT-MEASURED, every exit 0 (also 132/132 exit 0 on `3894ea44`
before the merge).
- After the merge: `@object-ui/plugin-grid` `Test Files 305 passed ·
Tests 2705 passed`; `@object-ui/plugin-view` `Test Files 67 passed ·
Tests 732 passed`. `type-check` for `@object-ui/types` and
`@object-ui/plugin-grid` exit 0 on `3894ea44`.
- `overlap-check --exclude-pr=36357` on 4e94a27: clean against main and
the eight open PRs sharing files (objectstack-ai#36439, objectstack-ai#36438, objectstack-ai#36435, objectstack-ai#36411,
objectstack-ai#36392, objectstack-ai#36351, objectstack-ai#36343, objectstack-ai#36316). objectstack-ai#36332 is merged and is in this head.

Earlier runs (head 579f99a; suites on 1c2a16b):

- `@object-ui/plugin-grid` whole package: `Test Files 298 passed | 3
failed (301) · Tests 2676 passed | 6 failed`; the 6 (keyboardNavigation
×4, cellSelection ×1, rowContextMenu ×1) were fixed and those three
files re-run green (8 + 28 + 18).
- `@object-ui/plugin-view` whole package: `Test Files 67 passed (67) ·
Tests 732 passed (732)`. `@object-ui/types`: `Test Files 389 passed ·
Tests 10498 passed`.
- `type-check` for `@object-ui/types`, `@object-ui/plugin-grid`,
`@object-ui/plugin-view`: exit 0.
- `@objectstack/spec` test under the verify lock: 1 failed of 27,924
(`retired-key-removal-version.pin`, the JOIN row this PR then added;
that file re-run 63 passed). `test:repo`: `Test Files 93 passed · Tests
1564 passed`.
- Derived gate families (`dispatch-gates --commands`): 132 derived;
`--ran` reconciles 132 run, 0 NOT-MEASURED. Six first read exit 3 on a
stale spec dist and `check:generated` exit 1 on the same stamp; after
`pnpm --filter @objectstack/spec build` all seven re-ran exit 0.
`check-plugin-teardown-shape --self-test` needed its pinned fixture
commit fetched into the shallow clone, then exit 0.
- `node scripts/gen-sdui-manifest-node.mjs` under the lock, then
`gen-sdui-reference.mjs`; `check-doc-component-types.mjs` green.
- `overlap-check --exclude-pr=36357`: clean against main and the six
open PRs sharing files (objectstack-ai#36392, objectstack-ai#36380, objectstack-ai#36351, objectstack-ai#36343, objectstack-ai#36332, objectstack-ai#36316).
- Earlier dogfood battery on 1c2a16b (superseded by the run on 4e94a27
above): `Test Files 484 passed | 3 skipped (487) · Tests 4107 passed |
68 skipped (4175)`. The one commit after it (579f99a) touches two docs
snippets only.
- `pnpm --dir ui check:doc-snippets` after a scoped build: 544 of 544
blocks judged, 0 failed (the Lint UI red on 1c2a16b was the new
staged-model snippet missing its import, fixed in 579f99a).

</details>

<details><summary>Ablation (`scripts/ablation-replace.mjs`, restored to
the HEAD blob, `git diff HEAD` empty)</summary>

- `cellSelectionProp ?? inlineEditable` → `cellSelectionProp` (the
base's behaviour): 3 failed of 6 — the object-view `table.editable` and
named-view `inlineEdit` per-cell saves and the authored-node per-cell
save; the three controls (read-only object-view, read-only node, host
`false`) stay green.

</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jSHfkSrXZxbdWoQxnW)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QsR2jSHfkSrXZxbdWoQxnW

<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jSHfkSrXZxbdWoQxnW -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…ck-ai#36363) (objectstack-ai#36437)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_

repo:objectstack#7 · zhuangjianguo · session_01QsR2jSr8sNCnJrK6Q9kEF5

Fixes objectstack-ai#36363

Clause-②: yes (widening)
Metadata-protocol: none

## 维护者速读

-
用户能看到什么变化:管理员进入设计模式后,左侧菜单变成可编辑:每个分组底部有「添加菜单项」,点了先在那个位置占一行虚线框,再弹出选择面板(搜索框,按对象、视图、仪表盘、报表、页面、链接分类,只列已经存在、还不在菜单里的);每一项鼠标移上去右边有「⋮」:上移、下移、移到分组、在前面或后面加一项、改名和图标、从菜单移除;也可以直接拖动。改动都等设计模式的「保存」一起写入并发布,所有成员都能看到;「取消」全部丢掉。安装来的应用(只读包)现在也能进入设计模式,改动存为本环境的定制。保存写的是应用存储的菜单,不是当前用户看到的那份:中文界面下保存不会把中文名写进菜单,管理员看不到的条目也原样保留,只改动管理员动过的那几项。改名只在部署的默认语言下开放(且该项显示名就是存储名),其他语言下名称框禁用并提示「菜单名称需在应用的源语言下修改」;新增、移动、图标在任何语言下都能改。其他包追加进菜单的条目(例如
HotCRM
收入模块的报价、产品)在这里不能移动、改名或移除,「⋮」里会说明要到那个包里改。有未保存的菜单改动时,切到别的应用、关闭或刷新页面会先弹出外壳原有的未保存提示(留在这里
/ 放弃并离开),选「留在这里」改动还在;没有改动时照常直接切换。
- 为什么做:维护者要求菜单在运行界面里直接改,不再去 Studio;这是设计模式这条线的第二张卡。
- 出错会怎样:最坏情况是保存后菜单顺序或条目不是管理员想要的,再进设计模式改回即可;「移除」只是不在菜单显示,东西本身不删;若同一应用在
Studio 里有未发布的草稿,保存会拒绝并说明原因,不会覆盖别人的草稿。
- 要你做什么:无。翻译名称的写入(在非默认语言下改名)和服务端声明应用源语言是后续卡 objectstack-ai#36504,本 PR 不做。一处与 ADR-0146
D5 不同的地方已由席位记入修订卡:安装来的应用,管理员页头的入口从「在 Studio 中查看」变成「编辑应用」(进入设计模式),这是本卡第 7
条的要求。这只是过渡:按你新定的 objectstack-ai#36485,设计模式入口会移到左上角应用名菜单,页头这两个按钮会去掉,由那张卡来做;本 PR
只改了现有按钮的一个判断,没有新做按钮。

## What changes

While the design mode (objectstack-ai#36362) is on, the sidebar draws the app's menu
with its editor (`layout/DesignModeMenu.tsx`), instead of the plain
menu.

- **Add menu item.** Each group, and the menu's top level, ends with
「Add menu item」. Pressing it holds a dashed row 「Choose a menu item…」 at
that place and opens a picker: a search box over every kind, then the
kinds Objects, Views, Dashboards, Reports, Pages and Link. A kind lists
what exists and is not in the menu yet (`designModeMenu.ts`
`targetKeyFor` / `entryForTarget`, one key per thing the menu opens); a
record page is never offered. Picking one puts it in the held row.
- **The entry's 「⋮」 menu**: move up, move down, move to group (a submenu
of the other groups and the top level), add an item before or after,
rename and icon, remove from the menu. Removing takes the entry off the
menu only; the picker offers it again.
- **Rename only in the source language** (seat ruling (4) on review
7081226692). The name field of 「Rename and icon」 is open when the
session language is the deployment's default (`GET
/api/v1/i18n/locales`, the descriptor marked `isDefault`; compared
case-insensitively, `en` matching `en-US`) and the entry's shown label
equals its stored label. Otherwise it is disabled with the hint 「Menu
names are changed in the app's source language」, and only the icon is
written. Adding, moving and the icon stay open in every language. The
stored labels are taken to be in the default language because the server
states no source language of its own: `/i18n/locales` exposes
`isDefault` only, not `i18n.sourceLocale`. That gap, and the console's
write path for a translation, are follow-up objectstack-ai#36504.
- **Another package's entry** (its manifest's `navigationContributions`,
appended to the app when it is served, found live on HotCRM) is not in
the app's stored menu. Its 「⋮」 says 「Another package adds this item. It
is moved, renamed or removed there.」, its move, rename and remove items
are disabled, and it is not dragged; adding an item before or after it
stays open. No entry is moved past it either: 「Move up」 or 「Move down」
into its place is off, and a drop onto it does nothing (its place is
that package's). Such entries close their group when the app is served,
so an own entry added or moved at or past them is stored and served
before them; the editor draws it there too: the group's 「Add menu item」,
「Add an item after」 on such an entry, 「Move to group」 and a drop on the
group's end land before them (L1-e review 7083961269 item 1). This holds
once the editor's stored-menu read has landed, in a group the app's own
menu holds; a group another package adds (N9) and the moment before that
read (N10) are on follow-up objectstack-ai#36538. The click a drag ends with opens
nothing (item 2, and review 7084606001): once a pointer drag is active,
dnd-kit stops that click in the document's capture phase without
cancelling it, so after a drop the editor refuses (onto another
package's entry, which leaves the dragged link under the pointer) the
link's default ran as a full page load and the mode was lost. The editor
cancels that click on the window in the capture phase, which runs before
dnd-kit's listener. An entry's link is also not natively draggable. The
drag's end is also stamped from the pointer's own release on the window,
and a new press clears it, because dnd-kit reports an end only after the
start has rendered and a fast flick could otherwise leave every link
shut (review 7085270448 S3). The save holds the same rule on its own, so
it stands when the editor's stored read failed. Without this, a moved
contributed entry would have been written into the app's menu and then
served twice (the contribution is appended again, with no
de-duplication), and a removed one would silently stay.
- **Drag** moves an entry within its group or to another group (dnd-kit,
pointer and keyboard). In the mode, Enter or Space on a focused entry
picks it up for a keyboard move (dnd-kit's keyboard sensor) rather than
opening its page; a click opens it.
- **Staged with the mode.** Every edit is staged under one key
(`app-menu:<app>`); 「Save」 writes it, 「Cancel」 drops it. The picker
tells what is already in the menu by one key per thing it opens, spelled
`kind/name` (`object/crm_lead`, `view/…`); they are compared only with
each other and are no cache key.
- **The save writes the stored menu, never the served one** (review
7081226692). The served app is translated for the reader
(`translateApp`) and pruned of entries the reader may not open
(`filterNav`), so writing it back would store the reader's language on
every label and drop what the reader was not shown. The save reads the
app as stored (the layered read, `/layers?package=…`, which serves a
caller who may write the app its stored version, unpruned and
untranslated: `effective ?? code`) and replays the edits on its
navigation by entry id (`designModeMenu.ts` `rebaseMenuEdits`): an entry
removed is removed; an entry added is put after the entry before it in
the edited menu; an entry moved (to another group, or out of the order
its group's other entries kept, found as the longest common run per
group, so a removal beside an entry does not move it) is taken out and
put back after the entry before it; an entry whose own keys changed has
only those keys written. Every other stored entry, an entry the reader
was never shown included, is the same object. A stored entry is matched
to its served copy by id only when both name the same thing (type and
target); otherwise, and for a stored entry without an id, by its group,
type and target, in order (the editor gives served entries without an id
the first free `nav_item_<n>` of what the reader was shown, which a
stored entry pruned from the reader can already hold). Nothing the
stored menu does not hold is ever written from its served copy: an entry
another package contributes, or one that has left the stored menu since
it was read, is not moved, patched or written, and takes no part in the
order comparison; only an entry the served menu does not hold is an
addition, and one whose id a stored entry holds is written under a fresh
`nav_item_<n>` (the picker also mints ids against the stored menu). An
entry naming no target is left out (`navPayloadOf`, as Studio's nav
save).
- **Where the save** (`designModeMenuSave.ts`) writes the app with its
new `navigation` is where Studio's menu editing writes it
(objectstack#30059, ADR-0146 D2/D3): the app's own package when the
server lists it writable, else its paired customization package (asked
of the ensure door, which creates it on first use), the body declaring
the override at the base's listed version. The base's version is checked
before the ensure door is asked, and a pair the server answers not
writable is refused before anything is written to it. It is written by
the runtime's confirmed-save rule: a draft with the first-write pin (a
draft already pending, from Studio say, is refused and said, never
overwritten nor published), then publish; a refused publish discards the
draft this save wrote. A landed publish refreshes the console's
metadata, so the menu re-reads.
- **Installed apps enter the mode** (`ShellPageActions.tsx`): in the
read-only (`view`) posture, 「Edit app」 now enters the mode where the
customization door takes the caller; where it is walled off (a walled
deployment, caller not the platform operator) the eye 「Open APP in
Studio」 stays. This is kept, and kept minimal: one condition on the
existing header button (about 10 lines), with no new button. The
maintainer has since moved the mode's entry to the app-name menu and
retired the header's 「Edit app」 and 「Open in Studio」 under objectstack-ai#36485 (card
comment 7080271489). That later PR owns the installed-app path through
the new entry; this PR lands first, so an installed app can enter the
mode until then.
- **Leaving with unsaved menu changes asks first** (the card's added
requirement, comment 7079728193). Switching app from the app menu, a
link out of the app, a reload or a tab close asks first while a menu
change is staged; with nothing staged, nothing asks. This is the shell's
one unsaved-changes prompt (`chrome/unsavedEdits.ts`:
`confirmUnsavedLeave` and the `beforeunload` hold), which the design
mode registers for every staged change since objectstack-ai#36362. The menu editor
stages through the mode, so no code change was needed; the new tests pin
it for the menu. That prompt offers two choices: stay, or leave and drop
the changes. It has no 「Save」. The comment asks for the shell's prompt
where one exists, so no three-button dialog was added.
- **Outside the mode** the menu is as before: no 「Add menu item」, no
editor 「⋮」.
- An app whose menu is split in areas keeps its menu unedited in the
mode (the picker and the moves work on one menu tree).
- New i18n keys under `designMode.menu` in every hand-written locale,
zh-Hant generated.

Read first, by risk:
1. `ui/packages/app-shell/src/layout/designModeMenu.ts`
`rebaseMenuEdits` / `staysInOrder` / `storedKeyer`: the edits replayed
on the stored menu.
2. `ui/packages/app-shell/src/layout/designModeMenuSave.ts`: the stored
read, the check order, where the write goes, and the pending-draft
refusal.
3. `ui/packages/app-shell/src/layout/DesignModeMenu.tsx` `nameOpen` /
`contributed`: the rename rule and another package's entries.
4. `ui/packages/app-shell/src/layout/ShellPageActions.tsx`: the
read-only posture entering the mode, and the wall.

## Tests

- New `layout/__tests__/designModeMenu-36363.test.ts`: move up/down stop
at the group's ends; move to a group appends, never into itself; a drop
lands before/after by direction; insert clamps; rename and icon patch;
one key per thing; ids are unique. Added for the review: a view named
without its object is keyed as that object's view (S1); no edit returns
the stored menu itself; a removal beside an entry does not move it; a
move to another group takes the stored entry there; a group the stored
menu lacks puts the entry at the top level's end; an id-less stored
entry is matched by its target. Added for review 7082970423: a move
beside another package's entry (down past it, it up past one, it to the
top) returns the stored menu itself (M1); an entry moved after it left
the stored menu is not written back (M1); an added entry whose id a
hidden stored entry holds is written under a fresh id, the hidden one
kept (S2); a served entry given the id a hidden stored entry holds is
matched by its target, so removing it removes it and not the hidden one
(S2). All five were red against the previous `designModeMenu.ts`.
- New `layout/__tests__/designModeMenuSave-36363.test.ts`: writable
package saved and published; read-only package saved into its
customization package declaring the override at the base's version; a
base with no version refused before writing; an unlisted package
refused; a pending draft not overwritten nor published; a refused
publish discards the draft. Added for the review: a base with no version
is refused before the ensure door is called (the calls are the layered
read alone) (N1); a pair answered not writable is refused before
anything is written to it; a move under a zh-CN-translated menu writes
the stored English labels and the untouched entries as the same objects;
an entry pruned from the reader stays where it was stored; a rename
writes the one key it changed; id-less stored entries are matched and
written without an id; an entry naming no target is left out (N3); the
session language against the default one. Added for review 7082970423: a
move beside another package's entry writes none of that package's
entries (M1).
- New `layout/__tests__/DesignModeMenu-36363.test.tsx`: 「Add menu item」
per group and the top level, 「⋮」 per entry; 「Move up」 staged and saved;
「Move to group」; the held row and a picker offering only what exists and
is not in the menu; search over every kind, no record page; remove and
offer again; rename; 「Cancel」 after three edits leaves the menu and
writes nothing. Added for comment 7079728193: a moved entry not yet
saved makes the app switch ask, staying keeps the move, and leaving goes
on and writes nothing; a reload or a tab close is held while the move is
unsaved, and released once it is saved; with nothing changed, switching
asks nothing. Without the mode's registration, the first two go red.
Added for the review: under zh-CN with English the default, the rename's
name field is disabled with the hint, and the icon alone is saved, the
stored English label kept; in the default language, an entry shown under
a label other than its stored one is not renamed; adding and moving stay
open under zh-CN; another package's entry says where it is changed and
its move, rename and remove are disabled; dropping an entry on another
group's end moves it there, dropped on an entry elsewhere it takes that
place, and the save writes the result (N4, through `DndContext`'s
`onDragEnd`). Added for review 7082970423: 「Move down」 above another
package's entry is off and a drop on it does nothing; when the editor's
stored read failed on entry (so another package's entry looked movable),
moving it still writes none of it (M1). Added for review 7083961269:
「Add menu item」 at the end of a group that ends with another package's
entry holds the row, and puts the pick, before it, and the save stores
it there; 「Add an item after」 on that entry and 「Move to group」 into its
group land before it; a drop on that group's end lands before it; an
entry's link has `draggable="false"`, the browser's own drag of it is
refused (`dragstart` default prevented), and after a drag refused on
another package's entry the click it ends with leaves the address as it
was, while a plain click still opens the entry's page. All four were red
against the previous `DesignModeMenu.tsx`. Added for review 7084606001,
on the real event order through dnd-kit's own pointer sensor:
pointerdown on the link, moves past the 5 px activation distance,
pointerup, then a click on the link; the click is stopped in the
document (as in the browser) and its default is cancelled. It was red
against d1522bf's `DesignModeMenu.tsx`, whose React click handler that
click never reached. Its closing plain click now asserts that the
entry's page opens (N11). Added for review 7085270448 S3: a drag whose
end dnd-kit never reports, then the pointer's release, leaves the links
open; red against effe780.
- `ShellPageActions-36111.test.tsx`: a read-only package enters the
mode; under the wall it keeps the eye; a writable package under the wall
still enters.
- `UnifiedSidebar.favoritesMenu-12427.test.tsx`: outside the mode no
「Add menu item」 and no editor 「⋮」.

<details><summary>Readings at 71c8835</summary>

- The touched test files and the objectstack-ai#36362 pins beside them: 78/78 passed.
- Related-test sweep (every test file naming `UnifiedSidebar`,
`ShellPageActions`, `DesignModeMenu`, `designModeMenu` or
`useAppStudioEntry`, 84 files): 715 passed, 1 red:
`sidebarGroupLabel.callSites-12795` wants every `SidebarGroupLabel` call
site to declare the icon-mode hiding constant. Fixed in this PR (the
editor's group label declares and passes it); the file re-run: 7/7.
- `type-check` for `@object-ui/app-shell` and `@object-ui/i18n`: exit 0
(one `new Error(message, { cause })` under the package's ES2020 lib
fixed first).
- `dispatch-gates.mjs --commands` derived 41 gates (the same 41 at this
head). 40 exit 0 at 4bc9854d3, this tree less three fixes in `ui/`.
`pnpm --dir ui exec vitest run scripts/` was killed for memory on its
first run; run alone it found 7 reds in three gates, all fixed here: a
menu-kind i18n key built from a template (`check-i18n-call-site-keys`,
`check-i18n-dead-keys`; now each key written whole) and a test mock
binding the gate could not read as inheriting (`check-vi-mock-inherit`).
The three files re-run: 381/381. The whole gate re-run at this head with
two workers: 5,127 passed, 2 skipped, exit 0. `--ran` reconciliation: 41
derived, 41 run, 0 not measured, every line with its exit code.
- `overlap-check.mjs`: origin/main and 10 open PRs sharing files (objectstack-ai#36391
shares `UnifiedSidebar.tsx`; the rest share locale files) all merge
cleanly.

At 6516005 (the follow-up fix): the i18n pack pins counted the new
keys. The German icon hint quotes its example with „“
(`de-quote-pairing-3876`), the Korean picker's 로딩 중… is the pack's one
rendering, and the Loading group counts `designMode.menu.loading`
(`ellipsis-glyph-3878`).

At 02d1fe6 (origin/main merged in, the PR was `dirty`): one conflict,
the de quote-pair counts. Main's objectstack-ai#36286 took 124, so the menu editor's
icon hint is the 125th pair. In the i18n package at the merge, 1,625
tests ran and all passed, the count pins included. 18 files could not
load in the side worktree, because workspace packages were not linked
there; CI runs them. `overlap-check.mjs` at the merge: origin/main and 7
open PRs sharing files all merge cleanly.

At 1c271b1 (comment 7079728193, the leave prompt):
`DesignModeMenu-36363.test.tsx` gains three cases: a moved entry asks
when the app is left (stay keeps the move, leave goes on), the browser's
reload or close is held while unsaved, and an untouched menu asks
nothing. Each was checked red against its mutation (the registration
taken out) before it went green.

At def2f64 (CI red, `viewCacheInvalidation.guard`): the guard forbids
a `view:`-prefixed template anywhere in app-shell. The menu editor's
target keys, which are only an identity for "this entry is already in
the menu" and no cache key, are now spelled `kind/name`. The four
touched test files, the guard included: 33/33 passed.
`dispatch-gates.mjs --commands` at this head derives the same 41 gates.
`--ran`: 41 derived, 41 run, 0 not measured. 40 exit 0. One exits 1:
`pnpm --dir ui exec vitest run scripts/` (two workers; the default run
is killed for memory in this container), with 2 failures, both in
`date-only-zone-pins-10183`. The child's case "control: an instant
formats in the viewer's zone, 2026-09-01 03:00 here" in
`FormulaFunctions.dateOnlyZone-10866` read 11:00, the Asia/Shanghai
hour. That file run alone in the forked child passes 39/39. The child's
node project runs with `isolate: false`, the pins set `process.env.TZ`
and never put it back, and the suite-zone case passes no zone, so it
reads whichever zone an earlier pin file in the same worker left. This
PR touches no date, formula or zone code; it is an order dependence
among the pins, filed as objectstack-ai#36492, not this change. `overlap-check.mjs`:
origin/main and 5 of 6 open PRs sharing files merge cleanly; objectstack-ai#36411
conflicts only on the de quote-pair count line (both add a pair), which
whichever lands second recounts.

At aed9f08 (the rework for reviews 7081226692 and 7081253549, and
ruling (4)): `type-check` for `@object-ui/app-shell`: exit 0 (after the
workspace's dependency dists were rebuilt, `turbo run build
--filter=@object-ui/app-shell^...`, 68 tasks). The three menu test
files: 49 passed. `packages/i18n/` and `packages/app-shell/src/layout/`
together: 261 files, 3,191 passed, 13 skipped. `dispatch-gates.mjs
--commands` derives the same 41 gates. `--ran`: 41 derived, 41 run, 0
not measured. 40 exit 0. `pnpm --dir ui exec vitest run scripts/` (run
as derived, default workers, completed this time) exits 1 with the same
2 failures in `date-only-zone-pins-10183` (objectstack-ai#36492, the TZ order
dependence), and nothing else: 5,125 passed. The two changeset gates and
`check:closed-ceremony-text` were run again after the changeset text
changed: exit 0. `overlap-check.mjs`: origin/main merges cleanly; objectstack-ai#36351
merges cleanly; objectstack-ai#36411 conflicts only on the de quote-pair count line,
as before.

At 11b0e58 (CI's Type Check UI red at aed9f08):
`designModeMenu-36363.test.ts(161,49) TS7053`. A new pin indexed
`STORED[3].children`, which the test project types as `{}`. Only the
package's main tsconfig had been run locally. The pin now casts it to
`Menu`, as its siblings do. The package's whole `pnpm run type-check`
(main and test tsconfigs) exits 0, and the file passes 29/29. The 41
derived gates were re-run at this head: `--ran` shows 41 of 41 accounted
for, 40 exit 0, and `vitest run scripts/` exits 1 on objectstack-ai#36492 only. All 16
Test UI shards were green at aed9f08. `overlap-check.mjs` is
unchanged.

At 5279122 (review 7082970423, M1 and S2): the three menu test files
pass 56/56. The five new pure and save cases were run against the
previous `designModeMenu.ts` first, and all five were red.
`packages/app-shell/src/layout/` passes: 155 files, 1,219 tests. The
package's whole `pnpm run type-check` (main and test tsconfigs) exits 0.
`dispatch-gates.mjs --commands` derives the same 41 gates. `--ran`: 41
of 41 accounted for, 40 exit 0, and `vitest run scripts/` exits 1 on
objectstack-ai#36492 only. `overlap-check.mjs`: origin/main, objectstack-ai#36529, objectstack-ai#36525 and objectstack-ai#36351
all merge cleanly; objectstack-ai#36411 conflicts on the de quote-pair count line
only, as before.

At d1522bf (L1-e review 7083961269, items 1 and 2):
`DesignModeMenu-36363.test.tsx` passes 22/22; the four new cases were
run against the previous `DesignModeMenu.tsx` first, and all four were
red. `packages/app-shell/src/layout/` passes: 155 files, 1,224 tests.
The package's whole `pnpm run type-check` exits 0. `dispatch-gates.mjs
--commands` derives the same 41 gates. `--ran`: 41 of 41 accounted for,
40 exit 0, and `vitest run scripts/` exits 1 on objectstack-ai#36492 only (2 failures
in `date-only-zone-pins-10183`, 5,125 passed). `overlap-check.mjs`:
origin/main, objectstack-ai#36525 and objectstack-ai#36351 merge cleanly; objectstack-ai#36411 conflicts on the de
quote-pair count line only, as before.

At effe780 (L1-e review 7084606001 item 2, and the changeset sentence
from review 7084744396): `DesignModeMenu-36363.test.tsx` passes 23/23;
the new real-event-order case was red against d1522bf's
`DesignModeMenu.tsx`. `packages/app-shell/src/layout/` passes: 155
files, 1,225 tests. The package's whole `pnpm run type-check` exits 0.
`dispatch-gates.mjs --commands` derives the same 41 gates. `--ran`: 41
of 41 accounted for, 40 exit 0, and `vitest run scripts/` exits 1 on
objectstack-ai#36492 only (2 failures in `date-only-zone-pins-10183`, 5,125 passed).
`overlap-check.mjs`: origin/main, objectstack-ai#36525 and objectstack-ai#36351 merge cleanly;
objectstack-ai#36411 conflicts on the de quote-pair count line only, as before.

At f68c14b (review 7085270448 S3 and N11):
`DesignModeMenu-36363.test.tsx` passes 24/24; the new flick case was red
against effe780's `DesignModeMenu.tsx`.
`packages/app-shell/src/layout/` passes: 155 files, 1,226 tests. The
package's whole `pnpm run type-check` exits 0. `dispatch-gates.mjs
--commands` derives the same 41 gates. `--ran`: 41 of 41 accounted for,
40 exit 0, and `vitest run scripts/` exits 1 on objectstack-ai#36492 only (2 failures
in `date-only-zone-pins-10183`, 5,125 passed). `overlap-check.mjs`:
origin/main, objectstack-ai#36525 and objectstack-ai#36351 merge cleanly; objectstack-ai#36411 conflicts on the de
quote-pair count line only, as before.

At c0eb5d6 (CI's Lint UI red at f68c14b,
`object-ui/no-synthetic-event-trigger`, ADR-0054 C1): the three new
`dispatchEvent(new MouseEvent(...))` lines of
`DesignModeMenu-36363.test.tsx` are `fireEvent.click` and
`fireEvent.pointerUp(window)`, asserting the same. Only that test file
changed. `eslint` over the PR's ui files: 0 errors (warnings as on
main). The menu tests pass 24/24, and the flick case is still red
against effe780's `DesignModeMenu.tsx`. The package's whole `pnpm run
type-check` exits 0. The derived gate sweep was not re-run: no source
file changed since f68c14b's sweep; it does not include ESLint, which
is why it missed this red.

</details>

## Acceptance notes

- **ADR-0146 D5.** D5 draws the app → Studio bridge for a read-only
package as a browse entry (the eye). For a caller the customization door
takes, an installed app's 「Edit app」 now enters the design mode instead,
as the card's item 7 asks (an installed app's menu is edited as this
environment's customization). The seat records the D5 row on the ADR
revision card objectstack-ai#36086. A member, and a caller behind the wall, see what
they saw before.
- **Card item 7 (installed apps enter the mode): this PR delivers it.**
On main, HotCRM still shows 「Open in Studio」 because this PR is not
merged yet. Once it merges, an installed app such as HotCRM shows 「Edit
app」 to a caller the customization door takes, and pressing it enters
the mode. Verified live on HotCRM in zh-CN (see Verification).
- **Renames in another language are not offered** (seat ruling (4)). The
rule takes the deployment's default language as the app's source
language, because the server does not expose `i18n.sourceLocale`. A
deployment whose default language differs from the language its apps are
authored in would see the name field closed in every language until
objectstack-ai#36504 adds `sourceLocale` to `/i18n/locales` and a console write path
for a translation.
- **Another package's menu entries are read-only here.** Moving or
removing them belongs to the contributing package (or a later card for
an override of a contribution).
- **Left as they are, from reviews 7082970423 and 7083821939; follow-up
objectstack-ai#36538.** The seat collected N6 through N10 on follow-up card objectstack-ai#36538
(N10, from review 7084744396: before the editor's stored-menu read
lands, an entry added at a group's end is drawn after another package's
entries). N7 (two id-less stored entries naming the same target), N8 (a
layered read answering neither `effective` nor `code`) and N9 (another
package's group listed in 「Move to group」) are the nits of review
7083821939 and are not changed here. N6: nothing pins the stored version
between the save's layered read and its draft write, so a publish by
someone else that lands in that window (the length of one request) is
overwritten; the first-write pin refuses only a pending draft. N2's
other half: while the tenancy posture is still being read, a walled
deployment can briefly show 「Edit app」 to a tenant administrator; the
posture hook answers `undefined` both while reading and on a deployment
that reports none, so closing it there would also close the mode where
no wall exists, and the server refuses the save behind a wall either
way. N5 (a link's typed label stored as its base label in any language)
is on objectstack-ai#36504.
- **Where it is saved** is the same document Studio's menu editing
saves, so a menu edited here shows in Studio, and the reverse.
- An app whose menu is split in areas is not edited in the mode (its
menu is drawn unedited); no such app is in the showcase or HotCRM.
- Not in this PR, as the card says: new dashboard or report (objectstack-ai#36364),
adding, removing or renaming groups, visibility conditions, personal
favorites.
- **The chain stops at this card, with one exception.** The maintainer
ruled at 2026-11-22 13:52Z that only the current stage is finished, so
objectstack-ai#36364 is not started from this chain. At 14:08Z the maintainer approved
resuming objectstack-ai#36366, as its own PR after this one lands; no branch or PR is
open for it yet.
- No docs page describes the runtime menu editing, so no docs change.

## Verification

**HotCRM, zh-CN, at this head** (review 7081226692 item (3)). HotCRM
6.5.0 (`pnpm dev`, a fresh database, `pnpm demo:staff`) on port 4001,
this branch's console (Vite) proxied to it, a Chromium context in
`zh-CN`, signed in as the seeded admin. `GET /api/v1/i18n/locales` marks
`en` default. HotCRM's package `app.objectstack.hotcrm` is listed
read-only.

- The design mode drew the zh-CN menu (首页, 销售主页, 销售 › 线索, 客户, …, 35
entries). 「⋮ → 改名和图标」 on 线索: the name field disabled, the hint
「菜单名称需在应用的源语言下修改」. 「⋮」 on 报价 (the revenue module's contribution):
「此菜单项由另一个包添加,请在那个包中移动、改名或移除。」
- Edits: 「⋮ → 上移」 on 客户 (above 线索); 「添加菜单项」 under 数据洞察, 对象, picked 活动参与者
(`crm_event_attendee`). Saved; the bar went.
- Network, in order: `GET /api/v1/i18n/locales` 200; `GET
/api/v1/meta/app/crm_enterprise/layers?package=app.objectstack.hotcrm`
200 (on mount, and again in the save); `POST
/api/v1/packages/app.objectstack.hotcrm/ensure-customization` 201; `PUT
/api/v1/meta/app/crm_enterprise?mode=draft&package=app.objectstack.hotcrm.custom`
200; `POST
/api/v1/meta/app/crm_enterprise/publish?package=app.objectstack.hotcrm.custom`
200. Every request carried `Accept-Language: zh-CN`.
- The PUT body: `overrides: {package: app.objectstack.hotcrm, basedOn:
6.5.0}`; its `navigation` holds no CJK character; 34 stored entries plus
the one added; none of the 8 contributed entries (报价, 产品, 价格表, 产品目录,
知识库, 回款节点, 收入手册, 订单与回款手册) written; no entry's own keys differ from the
stored one; 销售 reads `nav_account, nav_lead, …` and 数据洞察 ends with `{id:
nav_item_1, type: object, objectName: crm_event_attendee}`.
- The stored menu after the save (layered read) equals the PUT body,
and, with the two edits undone, equals the stored menu before, byte for
byte.
- An English reader (admin, `Accept-Language: en`): the served menu
after the save, with the two edits undone, equals the served menu
before, byte for byte. Labels read Accounts, Leads, Contacts, …
- A member (`na.rep@objectos.ai`, demo staff): served in English and in
zh-CN, 销售 starts with 客户 / Accounts then 线索 / Leads, and 数据洞察 ends with
the added entry. Screenshot `hotcrm-06-member-zh-CN.png` shows the moved
order in the member's sidebar.

Files in the project files at `repo-objectstack-7/shots/36363/`:
`hotcrm-01-design-mode-zh.png`, `hotcrm-02-rename-closed-zh.png`,
`hotcrm-03-contributed-zh.png`, `hotcrm-04-edited-zh.png`,
`hotcrm-05-saved-zh.png`, `hotcrm-06-member-en-US.png`,
`hotcrm-06-member-zh-CN.png`, and the recorded requests
`hotcrm-network.json`.

**Earlier, on the showcase** (before the review):

Live run against a fresh local backend and the console (Vite), signed in
as the seeded admin, on the showcase app (an installed, read-only
package), at 1440 px:

- 「Edit app」 was shown (no eye) and entered the mode; the menu drew each
entry with 「⋮」 and 9 「Add menu item」 rows.
- 「⋮」 on an entry opened the menu with 「Move to group」's submenu; 「Add
menu item」 held the dashed row and opened the picker; 「Objects」 offered
11 objects not in the menu (Announcement, Client Brief, Expense Line,
…); picking Announcement put it in the row.
- 「⋮ → Move up」 on Page Authoring moved it above Capability Map; 「Save」
was on, saved, and the bar went.
- After a reload the menu read Page Authoring, Capability Map, My Work,
Approvals, New Project (Wizard), Settings, Announcement, Projects: both
edits kept, written into the showcase's customization package.

- Added for comment 7079728193, on the same setup: entering the mode and
「⋮ → Move down」 on Capability Map, without saving, moved it below Page
Authoring. Picking Setup from the app menu raised the browser's prompt
「Leave design mode? Your unsaved changes will be lost.」. Choosing to
stay kept the address, the bar and the moved menu (Page Authoring,
Capability Map, My Work, …). 「Cancel」 then left the mode. The run was on
this branch's head with objectstack-ai#36366's commits stacked on it in the same tree;
the leave prompt has not changed since objectstack-ai#36362. Screenshot
`leave-app-menu.png` shows the app menu with the change staged. The
browser's own prompt does not appear in a page screenshot.

Screenshots are in the project files at
`repo-objectstack-7/shots/36363/`: `m-design.png` (the editor),
`m-actions.png` (the entry menu), `m-picker-kinds.png` and
`m-picker-objects.png` (the picker), `m-staged.png`,
`m-after-reload.png`. The card's 「PR 正文附截图」 is met by those files: a
cloud container cannot upload images to the PR.

Two minutes: as a workspace admin, open HotCRM, press 「Edit app」; under
a group press 「Add menu item」, pick an object, press 「Save」; reload: the
entry is there. Enter again, 「⋮ → Move up」 on an entry, then pick
another app from the app menu: the prompt asks; stay, and the move is
still there. 「Cancel」: the menu is as it was.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jSr8sNCnJrK6Q9kEF5 -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…ds in a form host, four specs read the product as merged (objectstack-ai#36578)

<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ88Tcs1L1zT2fWqjj2xTzFXM)_

Fixes objectstack-ai#36321
Clause-②: no

repo:objectstack#1 dispatch · os-warren ·
session_01JQwxbanvK21nJKgGjvE9XL

## 维护者速读

-
用户可见变化:新建发票时,本币发票在填过表头后选产品,单价会照常自动带出;之前一律留空并提示「还没选币种」,而表头明明显示着美元。其余改动只是夜间测试的写法,用户无感。
- 为什么做:夜间浏览器测试在 main 上连红多日,卡片要求找出回归并修好,不许跳过或删测试。
- 出错会怎样:只影响新建主从单据里币种选择框被表单读取的方式;不对可以直接撤回这一个合并。
- 要你做什么:无。

## What changes

The nightly `live` tier's two showcase files were red on main for four
reasons. One is a product regression, three are specs that pinned a
surface a merged pull request moved.

**Product: the currency code picker is readable by a form host that
reads the DOM** (`@object-ui/components`, `CurrencyCodePicker`).
The master-detail form reads its header's live values off the header's
named elements (`scrapeHeaderRecord`) on each bubbling `input` /
`change`. The picker's only element in the form is its trigger button,
which carries the field's `name`, and a button's `value` was the empty
string. Since objectstack-ai#36351 (merged 2026-11-22 22:18Z) the line grid withholds
a picked amount from a line whose currency it cannot tell, so on a New
Invoice whose Currency shows "USD — US Dollar", picking Widget A left
Unit Price empty with "Unit Price was not filled: the picked amount is
$29.99, but no currency is chosen here yet." The trigger now carries the
selected code as its `value`, and a changed code bubbles one `change`
event from the trigger, as a native select does (Radix Select's hidden
select does the same). Opening on a code announces nothing.

**Specs that read the product as merged** (no test renamed, skipped or
deleted; every assertion still pins what it pinned):

- `ui/e2e/live/phone-nav-drawer-back-29131.spec.ts`, desktop CONTROL:
since objectstack-ai#36297 a 1280 px window starts with the sidebar expanded, and the
collapsed sidebar's own button stays in the DOM, off screen. `.first()`
on the shared trigger selector clicked it and timed out "element is
outside of the viewport". The two presses are now the collapse button,
then the page header's expand button, each by its test id, with the
visible state checked between.
- `ui/e2e/live/inline-edit-polish-2572.spec.ts`: the shared inline-edit
session it pins is entered by a double-click on the record page's
sectioned face, titled "Double-click to edit". At 1280 px with the
sidebar expanded that is the face drawn (measured); the "Click to edit"
field-list face now edits one field in place with no session and no save
bar (objectstack-ai#36475), which is not what this file pins.
- `examples/app-showcase/e2e/detail-shapes.spec.ts` (related-heavy): the
meta footer is now a "System information" section that starts collapsed
(objectstack-ai#36147), so the case opens it before reading "Created"; and the summary
rail is retired in every tier (objectstack-ai#35890), so Contoso's contacts are read
from the Contacts tab instead of the rail's card. The vacuous
right-column count (no right column exists) is dropped with the rail.

Already repaired on main before this branch, so not touched: the `New`
button's name (objectstack-ai#36303) and the retired "Keep sidebar open" toggle in
`detail-shapes` (objectstack-ai#36297).

## Tests

- New
`ui/packages/components/src/__tests__/currency-code-picker-form-read-36321.test.tsx`
(3 cases): the named trigger's value is the code; with no code it is
empty; a pick bubbles one `change` from the trigger, read after the new
code is on it, and opening on a code announces nothing.
- Ablation on the committed tree, each leg by
`scripts/ablation-replace.mjs` and restored to the HEAD blob
`a5fe02c11426` with `git diff HEAD` empty: the trigger's `value` removed
gives `Tests 2 failed | 1 passed (3)`; the `dispatchEvent` removed gives
`Tests 1 failed | 2 passed (3)`.

## Acceptance notes

- A line picked BEFORE any header edit on a New Invoice still withholds
the price with the same note: the form's create feed opens on the
caller's initial record, not on the schema defaults the header seeds, so
the seeded home currency reaches the grid only with the first header
event. Withholding is the safe direction (no cross-currency copy). Same
family as the objectstack-ai#36351 follow-ups on objectstack-ai#36412.

## Verification

<details><summary>The two nightly files, whole, at b37d813</summary>

`os-verify-lock.sh -c 'pnpm console:build && cd examples/app-showcase &&
OS_TEST_TIERS=nightly pnpm exec vitest run
test/showcase-smoke.live.test.ts test/console-live-specs.live.test.ts'`:
smoke `56 passed (2.7m)`, Console live specs `28 passed (2.0m)`, `Test
Files 2 passed (2)`, `Tests 2 passed (2)`, VERDICT command-exit 0.

Control at main d463c46 (same command): `Test Files 2 failed (2)`;
Console live `3 of 28` failed (form-view-subforms,
inline-edit-polish-2572, phone-nav CONTROL), smoke `1 of 56` failed
(detail-shapes related-heavy).

</details>

<details><summary>Gates</summary>

All at b37d813.

- `dispatch-gates --commands` derived 56 families; 53 lock-free ones run
one by one, each exit 0. `dispatch-gates --ran` with every exit
recorded: `56 derived, 56 run, 0 NOT-MEASURED, 0 UNRUN`.
- Under `os-verify-lock` (one hold, parts sequenced, each part's own
exit read): `pnpm --filter @object-ui/components run type-check` exit 0;
`vitest run packages/components/` (from `ui/`) `Test Files 506 passed |
1 skipped (507)`, `Tests 4936 passed | 24 skipped (4960)`; `pnpm
check:type-check-debt` exit 0; `vitest run scripts/` (from `ui/`) `Test
Files 172 passed | 2 skipped (174)`, `Tests 5127 passed | 2 skipped
(5129)`; `pnpm check:dual-build-cjs-loads` exit 0.
- The acceptance note measured in the browser (backend + Console preview
at the head): a New Invoice opens with the trigger `value=USD`; an Add
line and a Widget A pick with no header edit leaves Unit Price `""` with
the note.
- Declared to CI: `test:repo` and the full lint farm.

</details>

## Two-minute check

`pnpm --dir ui exec vitest run
packages/components/src/__tests__/currency-code-picker-form-read-36321.test.tsx`:
3 passed. In the Console, New Invoice, type a name, Add line, pick
Widget A: Unit Price reads 29.99.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbanvK21nJKgGjvE9XL)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01JQwxbanvK21nJKgGjvE9XL

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue protocol:data size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Showcase EUR invoice: a picked product copies its home-currency price into the line as euros; the edit form's subtotal shows no currency symbol

3 participants