Skip to content

perf(fields): the line-item grid's body loads on first use, out of the console's eager chunk - #36417

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-36102-gridfield-carve-out
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-36102-gridfield-carve-out

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_01QsR2jV3scu6UYPb42n5okQ

Fixes #36102

Clause-②: yes (widening)
Metadata-protocol: none
Ruling-ref: 7063116595 on #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 chore(ui): raise the eager ui-components ceiling by 8,000 bytes on maintainer ruling #36100 and chore(ui): raise the eager ui-components ceiling x1.30 to 451,100 on maintainer ruling #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

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

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).
Unit: the lazy face, and its ablation

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.
Suites
  • 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).

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.
  • 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

…-components chunk

GridField / LineItemsField keep their names and props; the package entry now
exports a small lazy face whose body (widgets/grid-field/GridFieldWidget.tsx)
is reached only through one import(). The pure helpers the entry exports stay
eager. The console gets a fields-grid chunk group and a carve-out row; the
record forms that draw line items preload the body on mount.

Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ
Co-Authored-By: Claude <noreply@anthropic.com>
… for its body

preloadGridField resolves once the body has loaded and never rejects, so the
forms can drop it and a test at module scope can await it. MasterDetailForm and
RecordBodyTableEditor land the derived columns together with the body. A live
e2e watches both first-open forms for the loading placeholder.

Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ
Co-Authored-By: Claude <noreply@anthropic.com>
…960 bytes GridField took out

Two console builds of one tree (b3bcfef vs 4ca78ed): ui-components
352,359 -> 346,399 gzipped, aggregate -5,880, the same 105 eager chunks.
The two entries that called this card a payback now call it a follow-up.

Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ
Co-Authored-By: Claude <noreply@anthropic.com>
…eads as a move

The widget body that was widgets/GridField.tsx now shows as a rename into
grid-field/GridFieldWidget.tsx; the face and the pure helpers are a JSX-free
GridField.ts that every import of ./GridField.js still reaches. Path notes and
the liveness evidence for lookupAutofillPatch follow it.

Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ
Co-Authored-By: Claude <noreply@anthropic.com>
…56) and pin the ceiling to it

Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ
Co-Authored-By: Claude <noreply@anthropic.com>
…the grid's body is here

The live pin caught it: the New Invoice form drew its grid on the loading
placeholder for about 0.4 s, because a collection with authored but untyped
columns renders them while the derivation is still in flight. The lines now
stay on "Loading columns…" until the body has settled, on every path; the
derive effect no longer waits for it on its own. The edit-form pin types at
the end of a stored line's text.

Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ
Co-Authored-By: Claude <noreply@anthropic.com>
Re-read on the branch's final head, the chunk is still 346,403 and the
aggregate is within 3 bytes; the note no longer says no eager byte moved.

Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation 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

⚠️ 1 changed file(s) yielded no anchor (packages/spec/liveness/field.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/spec/liveness/field.json) — pages documenting those are invisible to this run
  • 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 761220c6ad6101576e4ce41c2aa5e0a721a50589 → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ

Final head for L1 + L2 · area f7-shell · 2026-11-22T11:28Z
Head-sha: eb10283083a14bed026d9ad123c8cd9745f02a25

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 REWORK · head eb10283083a14bed026d9ad123c8cd9745f02a25 · 2026-11-22T11:34Z

维护者速读

  • 用户能看到什么变化:几乎看不出来。控制台首次加载少下载约 6 KB(压缩后);明细表格改到第一次打开带明细的表单时才加载,新建和编辑表单里的表格照常出现,输入不丢焦点。
  • 为什么做:卡 Console eager chunk: GridField sits in ui-components although it is dynamically imported (static export + sideEffects); carve it out and lower the ceiling #36102。这是裁定 7063116595 约定的后续工作:先临时抬高首屏体积上限,再把这部分体积收回来。
  • 出错会怎样:最坏情况是带明细的表单第一次打开时,明细区在「正在加载列」多停一会儿,或者明细表格报加载失败。可以整体撤回。
  • 要你做什么:无。
  • 席位意见:REWORK,共 2 项,都只改 changeset,不动代码。实现、体积账和测试我读下来是对的,见下面。

要改的(2 项)

  1. changeset 缺两个包的条目。 l1-face 标了这一项,我按两个包各自的 files[] 核过,两处改动都会发布出去:

    • @objectstack/spec:files 里有 liveness,所以 packages/spec/liveness/field.json 的证据路径改动会随包发布。
    • @object-ui/console:不是 private,files 发布的是 dist,而 ui/apps/console/vite.config.ts 新加的 fields-grid 组决定了 dist 的分块。先例是 .changeset/34211-console-load-layers.md。

    两个都是 patch(Metadata-protocol: none),各配一句话:spec 那句说 ledger 的证据路径指向了 helper 的新文件,console 那句说明细表格进了按需加载的 fields-grid 分块,首屏少了约 6 KB。这和 feat(record-page): the side preview drops the comments icon and panel; a record's comments are on its full page #36406 的先例一样:改动的文件会发布,就要有 changeset 条目;CI 的 Check Changeset 是绿的,但它不判断发布内容。

  2. changeset 的第一条有一句和测试钉住的不一样。 原句是「a grid that showed the placeholder keeps its rows and the focused cell when the body arrives」。可是主体到达之前没有单元格可以聚焦。单测和消融钉住的是另一件事:主体到达之后,之后的重渲染不会重新挂载主体,所以已经聚焦的单元格还在(把 useState 换成每次渲染重读,就挂 1 条)。请改成这个意思,例如「a grid that showed the placeholder draws the body once it arrives and never remounts it on a later render, so its rows and focused cell stay」。changeset 会作为 CHANGELOG 发布,所以要改。

席位核对(本轮已读,增量时不重读)

  • 形态:draft、base main、Fixes #36102;NOT governed;51 个文件,改动 1,275 行,主体是 widgets/GridField.tsx → widgets/grid-field/GridFieldWidget.tsx 的改名(R081)。dogfood:没有 !,也没有 (narrowing),所以不欠。Fixes 能成立:卡上三步(量体积、移出首屏分块并加 carve-out、上限和基线一起下调)都做了;两条验收(ui-components 降了量到的字节数,上限跟着下调;新建和编辑表单首次打开不空白、不丢焦点,有 e2e 钉住)也都有。
  • 声明:Clause-②: yes (widening) 属实。包根唯一的新导出是 preloadGridField。loadGridFieldWidget 只从 widgets/GridField.ts 导出,包根没有导出它。根导出原来的 9 个名字都在,形状不变。原来是 GridFieldProps 的属性类型改名成了 GridFieldWidgetProps,两个都不是根导出。Metadata-protocol: none 属实,fields 和 plugin-form 都是 patch。
  • 首屏分块:GridField.ts 只用 import type 引用主体,所以首屏图里没有指向主体的静态边。index.tsx 里的 grid 字段 loader 改为走同一个 loadGridFieldWidget。主体反向静态引用 face 里的 helper,这个方向没问题。vite 的 fields-grid 组(priority 82,includeDependenciesRecursively: false)和 PER_CHUNK_MEMBERSHIP_CARVE_OUTS 那一行都照 fields-date-picker 的先例写;DEFEATED_LAZY_FIELD_WIDGETS 去掉了 GridField。
  • 体积账:两次构建用的是同一棵树、同一个工具。ui-components 降了 5,956(从 352,359 到 346,403),上限 451,100 → 445,144,基线 265,937 → 259,981,差值仍是 185,163。在 head 上复读,还是 346,403。注释也写明了这个基线「不再是某一次构建的读数」,是实话。MAX_EAGER_CLOSURE_GZIP_BYTES 等没动。chore(ui): raise the eager ui-components ceiling by 8,000 bytes on maintainer ruling #36100 和 chore(ui): raise the eager ui-components ceiling x1.30 to 451,100 on maintainer ruling #36109 两处注释不再把本卡叫作 payback,这和 seat note 7064483594 的说法一致。
  • face(GridField.ts):每次挂载只在 useState 里决定一次走哪条路径,load 晚到也不会把 Suspense 换成直出,所以不会重挂载、不丢焦点。消融证明这一点是钉住的。preloadGridField 不会 reject,丢掉返回值也不会产生未处理的拒绝。TSDoc 逐句读过,都与代码一致。
  • 表单:MasterDetailForm 用 useGridBodySettled 加 !d.columns?.length || !gridBodyReady 那一支,三条取列路径都等主体到齐;load 失败也会 settle,错误交给错误边界。RecordBodyTableEditor 用 Promise.all 把子对象 schema 和主体一起等;preloadGridField 不 reject,所以 catch 仍只接 schema 的失败。LineItemsPanel 只预加载、不等,正文写明了。e2e 用 MutationObserver 计挂载次数,先红后绿(e581a9a5 红,51af8021 绿,--repeat-each 3 下 15 条全过),本 head 上 Live E2E UI success。
  • nit,不改判:preloadGridField() 在三个组件的渲染函数体里调用,也就是每次渲染都调。它是幂等的,所以无害,但这算是渲染中的副作用。另有一个范围外候选:React.lazy 会永久缓存第一次失败。一个自己画 GridField、又不调用 preload 的宿主,在一次加载失败之后,本次会话里不会再恢复;每次失败后换一个新的 lazy 就能修。三个表单每次渲染都会 preload,能自己恢复。gridCellPanels.tsx 跟进 fields-grid 的建议正文已经记下了。
  • CI @ eb102830:59 success · 10 expected skip · 0 failed · 0 pending;mergeable_state clean。
  • 落地条款:非受管,不到 3,000 行。两项改完后我做增量 L1,只核 changeset 和 CI;之后加上席位的 TIER_DEFAULT L2,由区 ready + auto-merge。按席位定的顺序,本 PR 先落地,fix(fields): a pick leaves an amount in another currency empty and says why #36351 和 feat: line-item table cells for people, multi-select, tags, check and rating (#36043) #36392 再把各自的 GridField 改动搬到新路径。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: TIER_DEFAULT
Head-sha: eb10283083a14bed026d9ad123c8cd9745f02a25
Local-runs: none

Read: card #36102 (body, triage, seat note 7064483594, the claim with its Clause-② amendment, dev report 7078442412), PR #36417 (body, file list, comments), the net diff against its merge base b3bcfefc, and the 69 check-runs on this head (59 success, 10 skipped, 0 failed). Nothing was built, run or re-run. Job logs of Build & E2E UI, Live E2E UI and Build Core were read as check-run output.

① Derived judgments

  1. Published names of @object-ui/fields: right. The entry's named export list keeps every name it had (evalArith, lookupAutofillPatch, computeRow, GridField, LineItemsField, UNTOUCHED_NEW_ROW, isUntouchedNewRow, columnHelpByField, and the types ColumnCurrencies, ColumnHelp, GridColumn). It adds one: preloadGridField. Nothing is removed or renamed.
  2. Props of GridField and LineItemsField: right. The body's props type is renamed GridFieldProps to GridFieldWidgetProps and is now exported from the body file. Its declaration lines are otherwise identical. The face takes the same props and returns a React element. LineItemsField is still the same function as GridField.
  3. No published path is removed: right. The package exports map holds only . and ./style.css, so widgets/GridField was never a published subpath. At this head no file outside ui/packages/fields/src imports widgets/GridField by path. The entry's specifier ./widgets/GridField.js still resolves, now to the new GridField.ts face. The move is not a narrowing.
  4. The helpers move verbatim: right. Every code line the rename removes from the body reappears in widgets/GridField.ts, except the import lines and the three lines that rename the props type and the component. The body adds only path-adjusted imports and one import back from ../GridField.js.
  5. Budget numbers: right. PER_CHUNK_GZIP_CEILINGS['ui-components'] goes from 451,100 to 445,144. PER_CHUNK_BASELINE['ui-components'] goes from 265,937 to 259,981. Both move by exactly 5,956, the measured drop (352,359 to 346,403). The gap stays 185,163. No other constant moves and no exemption is added. The two entries for chore(ui): raise the eager ui-components ceiling by 8,000 bytes on maintainer ruling #36100 and chore(ui): raise the eager ui-components ceiling x1.30 to 451,100 on maintainer ruling #36109 are reworded to "follow-up, not a payback", as seat note 7064483594 asks. On this head, CI's Build & E2E UI (merge ref b6be0539) prints 338.0 KB / 434.7 KB ceiling for ui-components. It also prints the membership line its src/widgets/grid-field subtree 1 in fields-grid, exactly.
  6. Chunking: right. The new fields-grid group in vite.config.ts (priority 82) matches the new PER_CHUNK_MEMBERSHIP_CARVE_OUTS row. It follows the fields-date-picker precedent. GridField leaves DEFEATED_LAZY_FIELD_WIDGETS, because its dynamic import now takes effect. The test pins move with both lists.
  7. The forms wait for the grid body: right. MasterDetailForm draws a collection's grid only when useGridBodySettled() is true, and shows "Loading columns" until then. RecordBodyTableEditor sets its child schema only after Promise.all with preloadGridField(), which never rejects. LineItemsPanel only starts the load, as the PR body says. The save buttons are not gated on the body. That is not a gap. The rows live in form state (setRows, and the editor's snapshotRef), and the body writes no row when it mounts: its effects only focus a cell, report retired keys and listen for Escape. So a save in that window posts the rows the form already holds. The existing gate on derived entries is unchanged. Live E2E UI on this head ran both new cases green: the create form and the edit form each draw the grid with no placeholder mount, and a typed cell keeps focus.
  8. packages/spec/liveness/field.json: right, evidence only. One line changes, the evidence string of lookupAutofill. Its pointer moves from widgets/GridField.tsx#lookupAutofillPatch to widgets/GridField.ts#lookupAutofillPatch, where that function now lives. status stays live. verifiedAt, evidenceScope and note are unchanged, and no other key moves. Spec property liveness is green on this head.
  9. SQL push-down: no finding. The diff adds no query, no id materialisation and no in-app join. The Promise.all in RecordBodyTableEditor pairs one existing schema read with a bundle load.

② Semver level

  • The changeset bumps @object-ui/fields (patch) and @object-ui/plugin-form (patch). Those are the two packages whose shipped code changes.
  • Clause-②: yes (widening) is right. One export is added and none is removed (① 1 to 3). Metadata-protocol: none is right too: no metadata key, value or default changes. AGENTS.md says a non-protocol widening ships patch, so both levels are right.
  • The two declaration lines appear in both the PR body and the changeset body. Check Changeset is green.
  • @objectstack/spec ships its liveness directory, but this diff changes only an in-repo evidence pointer there. No reader outside the repo's liveness gate depends on it. No spec changeset is owed.
  • ui/apps/console changes only its build config. Its changes ride with the packages above.

③ Boundary flags

  • Open question 1 (keep Clause-② yes and route to L2, or drop the export): answered, A. plugin-form is a separate package, and fields publishes only its root entry. So any preload the forms can reach must be a root export, which is itself a widening. This record is the default-tier L2.
  • Open question 2 (landing order against fix(fields): a pick leaves an amount in another currency empty and says why #36351 and feat: line-item table cells for people, multi-select, tags, check and rating (#36043) #36392): answered for the contract, the order stays the seat's call. Under A, their hunks land in the lazy fields-grid chunk. The measured 5,956 and the lowered ceiling stay true. Under B, their body growth would land in ui-components first, and the drop would have to be measured again. A is the order that keeps this record's numbers valid.
  • Deviation, the Clause-② amendment from no to yes: verified against the diff (② above). The claim comment carries the amendment.
  • Deviation, field.json outside the claimed surface: verified as an evidence-path change only (① 8).
  • Deviation, the useGridBodySettled gate: it is inside MasterDetailForm.tsx, one of the line-item consumers the claim names, and the live pin covers it (① 7).
  • Deviation, the gate list derived 23 commits behind origin/main: CI ran on the merge ref and is green. The two gates the dev could not measure locally are covered or out of reach: check:dual-build-cjs-loads ran green in Build Core on this head and reads only packages/**, and the teardown-shape self-test concerns plugin teardown, which this diff does not touch.
  • Out-of-scope note, gridCellPanels.tsx (about 2.5 KB gzip, estimated): it has no contract effect here. Filing it as a card is the seat's call.
  • Observation, not graded: the PR's maintainer summary says the worst case of a failed load is the line grid reporting the failure. In fact a second failed load is thrown to the nearest error boundary, which for a master-detail form is the schema node's SchemaErrorBoundary. That boundary replaces the whole form. The fields-date-picker precedent behaves the same way, and the grid mounts on first open, before much input exists. So this changes no contract.

No must-fix, no should-fix.

Implemented-by: claude/issue-36102-gridfield-carve-out
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

… face pins

The console's dist is shaped by the new fields-grid group and the spec ships
the liveness ledger whose evidence path moved, so both take a patch entry.
The face sentence now says what the tests pin: a grid that showed the
placeholder never remounts the body on a later render.

Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ
Co-Authored-By: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ

Final head for delta L1 + delta L2 · area f7-shell · 2026-11-22T12:20Z
Head-sha: 20b27d25997318ffac26ea46d7e1452c9e977b13

  • One changeset-only commit over eb10283 for L1-d REWORK 7078535343: (1) @objectstack/spec: patch (liveness evidence path) and @object-ui/console: patch (the fields-grid chunk) added, after the 34211-console-load-layers / feat(record-page): the side preview drops the comments icon and panel; a record's comments are on its full page #36406 precedent; (2) the focus sentence now says what the tests pin: a grid that showed the placeholder never remounts its body on a later render.
  • PR body (no head move): the 维护者速读 worst case now says a second failed load of the grid's code reaches the form's error boundary and replaces the whole master-detail form (L2 7078562400); the Acceptance notes name the React.lazy cached-failure item for the seat to file.
  • CI at this head: 59 success, 10 skipped, 0 failed.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 ACCEPT(增量)· head 20b27d25997318ffac26ea46d7e1452c9e977b13 · 2026-11-22T12:22Z

维护者速读

增量核对(eb102830 → 20b27d25,一个提交,只改 .changeset/36102-grid-field-lazy-body.md)

  • 第 1 项:changeset 加上了 '@object-ui/console': patch 和 '@objectstack/spec': patch,两条各配了一句说明。console 那句写分块和约 6 KB(实测 −5,956 gzip 字节,对得上);spec 那句写的是 field 台账里 lookupAutofill 的证据路径改指向 widgets/GridField.ts,结论不变,和 liveness/field.json 的 diff 一致。l1-face 不再标 changeset。
  • 第 2 项:那句改成了「draws the body once it arrives and never remounts it on a later render, so its rows and focused cell stay」,和单测、消融钉住的一样。
  • 其余句子没动。正文里新加的「最坏情况」和 React.lazy 那条交给席位立卡的事项,我读过,和我上一轮记下的一致。
  • CI @ 20b27d25:59 success · 10 expected skip · 0 failed · 0 pending;mergeable_state clean。
  • 落地条款不变:非受管;等席位的 TIER_DEFAULT 增量 L2 PASS,之后由 f7-shell ready + auto-merge。按席位定的顺序,本 PR 先落地。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 20b27d25997318ffac26ea46d7e1452c9e977b13
Local-runs: none

Delta review over PASS 7078562400 at eb10283083a14bed026d9ad123c8cd9745f02a25. Read: card #36102 (body and every comment, including L1-d REWORK 7078535343), PR #36417 (body, the 51-file list, comments including the delta hand-off 7079041910), the delta eb102830..20b27d25, the net diff against the merge base b3bcfefc, and the 69 check-runs on this head (59 success, 10 skipped, 0 failed). The Build & E2E UI job log was read as check-run output. record-recognisers.mjs was run for the template and to read the face off the file list: the paths decide no face, so the changeset's Clause-②: yes (widening) line gives the declaration face and TIER_DEFAULT. Nothing was built, tested or re-run.

① Derived judgments

  1. The delta is what the hand-off says: right. eb102830..20b27d25 is one commit, 20b27d25, whose parent is eb102830. It is not a merge. It changes one file, .changeset/36102-grid-field-lazy-body.md, by 5 lines added and 1 removed. No code, test, budget, chunking or ledger file moves. Every judgment in ① 1 to 9 of 7078562400 therefore still holds on this head.
  2. The budget still reads as claimed: right. On this head Build & E2E UI prints ui-components 338.0 KB / 434.7 KB ceiling and the membership line its src/widgets/grid-field subtree 1 in fields-grid, exactly. The lazy fields-grid chunk is 20.37 kB raw. The PR body's "final head (eb102830)" re-read still describes this tree, since the code is the same.
  3. The reworded focus sentence is true: right. It now says a grid that showed the placeholder draws the body once it arrives and never remounts it on a later render, so its rows and focused cell stay. In widgets/GridField.ts, GridField picks its branch once, in a React.useState initialiser that reads gridFieldWidgetModule. A mount that took the Suspense branch keeps it, so the body is mounted once and not swapped for the direct render. Rows live in form state. This is what the unit test and its ablation pin. The old sentence said a cell was focused before the body arrived, which could not happen.
  4. The console sentence is true: right. ui/apps/console/vite.config.ts puts packages/fields/src/widgets/grid-field/ in its own fields-grid group at priority 82. The face reaches it only through the import() in loadGridFieldWidget. The measured drop is 5,956 bytes gzip in ui-components and 5,928 in the aggregate, so "about 6 KB (gzip) smaller" is fair.
  5. The spec sentence is true: right. The only packages/spec change is the evidence string of lookupAutofill in liveness/field.json. Its pointer moves from widgets/GridField.tsx#lookupAutofillPatch to widgets/GridField.ts#lookupAutofillPatch. lookupAutofillPatch is exported from that file at this head. status stays live, so "the verdict does not change" holds.
  6. The PR body edits are as claimed: right. The 维护者速读 worst case now says that two failed loads in a row hand the error to the form's error handling and replace the whole master-detail form, not only the grid. That matches the code for MasterDetailForm: it preloads on mount, waits until the load settles (a failure settles too), then mounts the grid, whose lazy branch loads a second time and throws on a second failure. The Acceptance notes now name the React.lazy cached-failure item for the seat to file. That item is true: LazyGridFieldWidget's factory runs once, and React keeps its rejection. loadGridFieldWidget forgets a failure, but the lazy wrapper does not.
  7. SQL push-down: no finding. The delta adds no query, no id materialisation and no in-app join. The net diff was judged the same way in 7078562400.

② Semver level

  • The changeset now names four packages, all patch: @object-ui/fields, @object-ui/plugin-form, @object-ui/console and @objectstack/spec. Each one ships a changed file.
  • @object-ui/console is not private and its files ships dist. The new fields-grid group changes how dist is chunked. patch is right, and .changeset/34211-console-load-layers.md is the same shape.
  • @objectstack/spec ships its liveness directory (files lists it). The evidence pointer is in the tarball, so AGENTS.md's rule to add a changeset for anything that publishes applies. patch is right. This corrects the remark in 7078562400 that no spec changeset was owed.
  • All four are in the one fixed group of .changeset/config.json, so the two new entries move no version beyond what the first two already move. They add the CHANGELOG sentence each package should carry.
  • Clause-②: yes (widening) is still right. The only new published name is preloadGridField on @object-ui/fields. The console and spec entries add no export. Metadata-protocol: none is right for all four: no metadata key, value or default changes, and the ledger edit is evidence only. Both lines are line-initial in the PR body and the changeset body. A non-protocol widening ships patch, so every level is right. Check Changeset is green on this head.

③ Boundary flags

  • L1-d REWORK 7078535343, item 1 (missing console and spec entries): done, judged in ② above.
  • L1-d REWORK 7078535343, item 2 (the focus sentence): done, judged in ① 3.
  • Open questions 1 and 2 from the claim: answered in 7078562400 and unchanged by this delta. The landing order against fix(fields): a pick leaves an amount in another currency empty and says why #36351 and feat: line-item table cells for people, multi-select, tags, check and rating (#36043) #36392 stays the seat's call.
  • Out-of-scope items for the seat to file: the React.lazy cached failure and the gridCellPanels.tsx carve-out. Neither changes the contract here. One note for whoever files the first: a later successful load through preloadGridField() or the grid field loader lets new mounts render the body directly. So "never recovers" holds only while nothing else loads the body.
  • Observation, not graded: the 速读's "two failed loads" fits the master-detail form, which waits for its preload to settle. A grid mounted while a preload is still in flight shares that one load, so there one failure reaches the boundary. That is the same worst case, reached sooner, and changes no contract.

No must-fix, no should-fix.

Implemented-by: claude/issue-36102-gridfield-carve-out
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Landing (seat 7, 2026-11-22T12:28Z): head 20b27d25997318ffac26ea46d7e1452c9e977b13 · L1 ACCEPT 7079068816 (L1-d, delta after REWORK 7078535343) · L2 PASS 7079109350 (TIER_DEFAULT, declaration face, delta after PASS 7078562400: the one commit changes the changeset only, adding the spec and console patch entries the earlier record wrongly said were not owed) · check-governed-merges --pr 36417: NOT governed, 1279 changed lines ≤ 3000 · CI on the head: 59 success, 10 skipped, none failed. → pr_ready + automerge_enable (merge queue).
The React.lazy failed-load edge the body names is filed as #36451. The L2 notes that a later successful load of the grid body lets new grids render, so "never recovers" holds only while nothing else loads it; #36451 measures first.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 12:29
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 0628e08 Nov 22, 2026
70 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36102-gridfield-carve-out branch November 22, 2026 12:56
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…ys why (objectstack-ai#36351)

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

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTM6Q7J3o7taPraVR2

Fixes objectstack-ai#36249

Builds Done-when item 1 as ruled. Item 2 landed in PR objectstack-ai#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 objectstack-ai#36349
Ruling-ref: 7075336705 (maintainer 「B 币种不同就不填并说明」, 2026-11-22T06:26Z,
card objectstack-ai#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

<details><summary>Local runs at 1e8a71d</summary>

- 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.

</details>

## Acceptance notes

- A record form drawn outside `ObjectForm` (a bare SDUI form) carries no
target stamp, so its lookup copies as before; every record-form layout
goes through `gateFormFields` and is covered.
- Carried by follow-up card objectstack-ai#36412, as the L2 directed: S2 (a re-pick
over a filled target gives no note), S3 (the opening fill waits when the
followed parent cannot be read) and S4 (a form outside `gateFormFields`
gets no stamp).
- When the referenced object's schema could not be read, a numeric
picked value counts as "currency unknown": it still copies into a
home-currency field and is withheld from a field in another currency.

## Verification

<details><summary>Gates</summary>

- **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 objectstack-ai#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):** objectstack-ai#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 objectstack-ai#36417:** objectstack-ai#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`: objectstack-ai#36392 overlaps in `GridFieldWidget.tsx`,
from the same move objectstack-ai#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 objectstack-ai#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.

</details>

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

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

---------

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 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

2 participants