Repository navigation
perf(fields): the line-item grid's body loads on first use, out of the console's eager chunk - #36417
Conversation
…-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>
📓 Docs Drift Check
What this run could not see
Coarse fallback — 174 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ Final head for L1 + L2 · area f7-shell · 2026-11-22T11:28Z
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 REWORK · head 维护者速读
要改的(2 项)
席位核对(本轮已读,增量时不重读)
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: 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 ① Derived judgments
② Semver level
③ Boundary flags
No must-fix, no should-fix. Implemented-by: 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>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ Final head for delta L1 + delta L2 · area f7-shell · 2026-11-22T12:20Z
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 ACCEPT(增量)· head 维护者速读
增量核对(
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Delta review over PASS 7078562400 at ① Derived judgments
② Semver level
③ Boundary flags
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Landing (seat 7, 2026-11-22T12:28Z): head |
…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>
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)
维护者速读
What changes
The line-item grid's body (
GridField, about 90 KB of source) sat in the console's eagerui-componentschunk. 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 lazyfields-gridchunk. 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,isUntouchedNewRowand the column types), which stay eager. It also exportsGridFieldandLineItemsFieldas a small lazy face with the same props.Suspense, with a busy placeholder (grid-field-loading).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.tsxis the body, moved fromwidgets/GridField.tsx(git reads it as a rename, R081). OnlyloadGridFieldWidget'simport()reaches it.MasterDetailFormstarts 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.RecordBodyTableEditor) waits for the body together with the child schema.LineItemsPanelstarts the load when it mounts.vite.config.tsgains afields-gridgroup (priority 82, ahead ofui-components).check-eager-closure-budget.mjsgains itsPER_CHUNK_MEMBERSHIP_CARVE_OUTSrow (src/widgets/grid-field→fields-grid), following thefields-date-pickerprecedent (objectui#12622).vite-ineffective-dynamic-imports.tsdrops GridField from its defeated-lazy list, because the import is now effective.ui-componentsceiling 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.GridFieldWidget as GridField); the helpers stay on./GridField. Three plugin-form test files awaitpreloadGridField()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..., readingapps/console/dist/eager-closure.json, run twice on one tree. The first build ismainatb3bcfefcalone; the second is the samemainplus this change, at3c422050. Gzipped bytes:b3bcfefc3c422050vendor-objectstacki18n-locale-enframeworkui-componentsfields-grid, which is lazy (20,374 raw bytes).ui-components, no chunk moved by more than 31 bytes (index+31).ui-components: 1,309,110 → 1,289,869 (−19,241).eb102830, same instrument):ui-componentsis still 346,403, and the aggregate is 1,869,971 (−3 bytes against3c422050, spread overindex,src,relativeTimeanduseConsoleActionRuntime).4ca78ed1(before the face became a JSX-free.ts) gave 346,399 (−5,960). The ceiling follows the final tree's −5,956.PER_CHUNK_GZIP_CEILINGS['ui-components']PER_CHUNK_BASELINE['ui-components']The gap between ceiling and baseline is unchanged (185,163). ⛔ Not moved:
MAX_EAGER_CLOSURE_GZIP_BYTES,BASELINE,REGRESSION_THIS_GATE_MUST_CATCH_BYTESand the other per-chunk rows. No exemption was added.pnpm check:eager-closureon the final build:✅ chunk ui-components 338.3 KB measured / 434.7 KB ceiling, plus the membership lineits 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:cilane.MutationObserverbefore 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.first-openinto the Description cell. The cell must still be focused after 300 ms and hold the text. Assertions: grid attaches > 0, placeholder attaches = 0.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) andvite previewof a root-base console build, as the CI job runs them.e581a9a5, beforeMasterDetailFormgated the grid, the create case failed:the grid never mounted on its loading placeholder: Expected: 0, Received: 1. A trace showed the placeholder attached insidemd-collectionabout 0.4 s before the grid, because the collection drew authored-but-untyped columns while the derivation was in flight.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)", usingvi.resetModules()and a fresh import:document.activeElementafter a re-render.await preloadGridField(),LineItemsFieldrenders with no placeholder.LineItemsFieldisGridField, the same face.Ablation (committed first, through
node scripts/ablation-replace.mjs):const [loadedAtMount] = React.useState(() => gridFieldWidgetModule);was replaced byconst loadedAtMount = gridFieldWidgetModule;, so the decision is re-read on every render.2e286b33ebdf → 1f484acf48d9.× a mount before the body loads shows the placeholder, then the grid, and a later render keeps the focused cell, withTests 1 failed | 91 passed (92).2e286b33ebdf) andgit diff HEADempty.Suites
pnpm exec vitest run packages/plugin-form/(fromui/):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-checkandpnpm --filter @object-ui/fields run type-check: both exit 0, after a rebuilt fieldsdist.pnpm --dir ui exec vitest run scripts/: exit 0 (part of the derived gate list).Acceptance notes
yes (widening), not the claim'sno. The new published exportpreloadGridField()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.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.widgets/GridField.tsxtowidgets/grid-field/GridFieldWidget.tsx.GridField.lookupAutofill-28245.test.tsxand the widget body.GridField.test.tsxand the widget body.grid-field/GridFieldWidget.tsx. The landing order is the seat's call.origin/mainmerges cleanly.packages/spec/liveness/field.json, whose evidence pointer moved to the helper's new file (check:livenessexit 0).React.lazycaches a first load failure for the whole session, so a host that rendersGridFieldwithoutpreloadGridField()and hits one failed chunk load never recovers until a reload.widgets/gridCellPanels.tsxis imported only by the body and could follow it intofields-grid(about 2.5 KB gzip by estimate, not measured).Verification
Read first, by risk:
ui/packages/fields/src/widgets/GridField.ts: the face, specificallyGridField'suseState(() => gridFieldWidgetModule)andloadGridFieldWidget's retry-on-failure.ui/packages/plugin-form/src/MasterDetailForm.tsx:useGridBodySettledand the!d.columns?.length || !gridBodyReadyarm.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. ExpectTests 92 passed (92), including the three cases of the "lazy face" describe.Generated by Claude Code