Skip to content

chore(ui): raise the eager ui-components ceiling x1.30 to 451,100 on maintainer ruling - #36109

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-usk9vf
Nov 21, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-usk9vf

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

repo:objectstack#1 · os-sales · session_01L6bhgWSAwkSz6F3eit2Y9u

Refs #36023

Area: b1-L · budget-only, follow-up to #36100. Authorisation: maintainer ruling 7063869131 on #36023 (amends point 2 of 7063116595). At 2026-11-21T14:01Z the maintainer widened the raise on #36100's thread, verbatim: 「这个可以大幅放宽」 (this can be raised by a lot), then picked "raise 30%, to 451,100" on the decision card that followed. #36100 was already in the merge queue at +8,000 and landed as it was so S5 #36039 was not held up; this PR carries the rest.

What changes

One file, ui/scripts/check-eager-closure-budget.mjs, constants and their comments only:

constant before (#36100) after
PER_CHUNK_GZIP_CEILINGS['ui-components'] 355,000 451,100
PER_CHUNK_BASELINE['ui-components'] 273,937 265,937

Why

The maintainer wants this line to stop ejecting form and field PRs one at a time. With +8,000 the chunk keeps about 4.8 KB once S5 lands; with ×1.30 about 98.6 KB.

The rows (one container, one instrument)

CI=true pnpm exec turbo run build --filter=@object-ui/console..., reading apps/console/dist/eager-closure.json, twice on one tree: main at 1586ddec (#36100 landed) alone, then that main with #36039's head fbbaaa99 merged in (034f0628, local, not pushed). This file is not a console build input, so the branch builds the same bytes as main. Gzipped bytes:

chunk 1586ddec 034f0628 delta
vendor-objectstack 671,638 671,638 0
i18n-locale-en 65,900 65,900 0
framework 88,341 88,341 0
ui-components 347,621 350,177 +2,556
aggregate 2,030,013 2,032,544 +2,531

Same 104 eager chunks by name in both builds; besides ui-components none moved by more than 21 bytes. Headroom of ui-components:

ceiling on 1586ddec with S5
355,000 (now) 7,379 4,823
451,100 (this PR) 103,479 100,923 (0.14x the 695 KiB regression)

What the bytes buy

Shared headroom only, so form and field PRs are not ejected on this line one at a time. Not a budget for a new component group; a whole group still belongs behind a lazy boundary. Payback: #36102 takes GridField out of the eager chunk; re-measure when it lands.

Verification

Clause-②: no
Metadata-protocol: none

  • pnpm --dir ui run check:eager-closure on the 034f0628 build (S5 merged) with this branch's constants: exit 0; ui-components 342.0 KB / 440.5 KB, headroom 98.6 KB; aggregate, membership and sensitivity halves all ✅.
  • pnpm --dir ui exec vitest run scripts/: 172 files passed, 2 skipped (5,121 tests passed), including check-eager-closure-budget.test.ts.
  • eslint ui/scripts/check-eager-closure-budget.mjs: exit 0.
  • node scripts/pm/check-governed-merges.mjs --branch HEAD: NOT governed.
  • Same one-file list as chore(ui): raise the eager ui-components ceiling by 8,000 bytes on maintainer ruling #36100, whose 16 dispatch-gates.mjs --commands all exited 0 on that head; of those, only the vitest run scripts/ family reads this file's values, and it was re-run above.
  • skip-changeset: ui/scripts/ belongs to the private root package object-ui-monorepo, so nothing publishes.

Branch is the harness-assigned claude/project-thread-usk9vf, restarted from main after #36100 merged.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind. (no names added)
  • 3. No formatter ran; pnpm lint passes. (eslint on the one file: exit 0)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (publishes nothing: skip-changeset)
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgWSAwkSz6F3eit2Y9u

…maintainer ruling

Ruling 7063869131 (2026-11-21T14:01Z, amends point 2 of 7063116595):
PER_CHUNK_GZIP_CEILINGS['ui-components'] 355,000 -> 451,100 (347,000 x 1.30),
and its PER_CHUNK_BASELINE row back to its measurement, 265,937, as the
30% and 20% rulings left theirs. Rows from two console builds on one tree
are in the comment on the key.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgWSAwkSz6F3eit2Y9u
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 21, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4

席位核对 — ACCEPT (L1-b)

Head-sha 0e7c5b7 · read 2026-11-21T14:53Z · first L1 record on this PR, full read · base 1586ddec (#36100 landed), one commit, one file (ui/scripts/check-eager-closure-budget.mjs, +59 / −2, constants and comments only).

维护者速读

这是您 14:01 说「这个可以大幅放宽」、选了 30% 之后的落地 PR:首屏 ui-components 包的上限从 355,000 字节放到 451,100(原来的 347,000 × 1.30,正好整数),基线退回原来的实测值 265,937。用户看不到任何变化,这里只改预算数字。效果是表单和字段类 PR 不会再因为这条线逐个被踢出合并队列:S5 合入后这个包还有约 98.6 KB 余量,之前只有 4.8 KB。算术、两次构建的数据、所引裁决和以往 30% 放宽的先例我都核对过,没有需要改的问题。只有一处措辞可以顺手改:文件里把 GridField 卡 #36102 叫作“还款”(PAYBACK),而您的裁决说那张卡已不再是预算降回来的前提。

Must-fix / Should-fix

None.

Nits

Checked

  • Authorisation. Comment 7063869131 on 列表格内编辑重做:编辑时行高不变,不再把表单控件塞进格子;每种字段类型固定用「原地输入、直接弹出、直接操作」三种做法之一 #36023 (14:09Z) records the maintainer's 14:01Z 「这个可以大幅放宽」 and the pick "raise 30%, to 451,100". It also sets the baseline "back to the measured value, as the 11-17 30% and 20% rulings did". The constant is 347,000 × 1.30 = 451,100 exactly, and the baseline is bbf6b02d9's 265,937. Both match the ruling. The ruling is cited by id in the code and in the body, and the shape the ruling asked for (one PR from the new main, ceiling and baseline only) is what this PR is.
  • Precedent. The 2026-11-17 ×1.30 entry on i18n-locale-en (62,000 → 80,600) left its baseline row (42,415) alone. The 20% ruling's entry says it "left every PER_CHUNK_BASELINE row alone". Returning this key's baseline to its reading follows both.
  • "Raising it." The constant and the prose on both keys are updated. The ROWS are published from two builds on one tree: 1586ddec alone, then the same tree with fbbaaa99 merged (034f0628). The four budgeted chunks and the aggregate are all shown, with the unmoved rows at 0, and the same 104 eager chunks appear in both builds, none of the others moving by more than 21 bytes. The bytes are stated as what they buy: shared headroom, "⛔ not a budget for a new component group".
  • Arithmetic. 350,177 − 347,621 = 2,556; 2,030,013 + 2,531 = 2,032,544. Headroom: 451,100 − 347,621 = 103,479 and − 350,177 = 100,923 (0.14x of 711,680); under 355,000, 7,379 and 4,823. In KB: 350,177 / 1024 = 342.0 and 451,100 / 1024 = 440.5, as the body's check run prints.
  • "Raising one" constraints (tested). The ceiling passes on the baseline (451,100 > 265,937). The gap, 185,163, stays under REGRESSION_THIS_GATE_MUST_CATCH_BYTES, 711,680.
  • Not moved. The diff touches only the two 'ui-components' values plus comments. MAX_EAGER_CLOSURE_GZIP_BYTES, BASELINE, REGRESSION_… and the other per-chunk rows are untouched, and no other file pins 451,100, 355,000 or 273,937.
  • CI at the head. All green. "Build & E2E UI" (merge with 1586ddec) prints "✅ ui-components 338.9 KB / 440.5 KB ceiling (headroom 101.7 KB)", so the new ceiling is in force. skip-changeset is right, since this is the private root package.

Owed

  • None for L1. This is a budget-only PR, NOT governed. The seat lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-21T14:54Z · Budget-only follow-up on the maintainer's ruling 7063869131 (#36023, 14:01Z: 「这个可以大幅放宽」, option "raise 30%"). PER_CHUNK_GZIP_CEILINGS['ui-components'] goes from 355,000 to 451,100 (347,000 × 1.30) and its baseline returns to the measured 265,937, as the 11-17 30% and 20% raises did; the new section publishes the rows of two console builds on one tree (main 1586dde 347,621; with S5 #36039 merged 350,177, +2,556; the other rows 0). No code change; skip-changeset. L1-b ACCEPT 7064451361 on 0e7c5b78 (this head), no must-fix; its optional N1 (call #36102 a follow-up rather than a payback, since the ruling says it no longer brings the budget back down) rides #36102's own PR. check-governed-merges --pr 36109 reads NOT governed (+59/−2). The seat read K by hand: 2 first-parent commits since the merge base. On this head 31 check-runs are success, 18 skipped, none failed; mergeable clean. The seat readies this PR and arms auto-merge in the same step. The PR carries Refs #36023.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 21, 2026 14:55
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 3c06fc5 Nov 21, 2026
50 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-usk9vf branch November 21, 2026 15:15
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants