Skip to content

feat: line-item table cells for people, multi-select, tags, check and rating (#36043) - #36392

Merged
objectstack-fleet[bot] merged 18 commits into
mainfrom
claude/project-thread-s3wy8p
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 18 commits into
mainfrom
claude/project-thread-s3wy8p

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #36043

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTbWpneBrqq7SJvrNt

Clause-②: yes (widening)
Metadata-protocol: semantic
Skills-docs: none — no skill names the inline grid column type values or keys (git grep of skills/ for inlineColumns and the column type list: one passing mention in objectstack-data/rules/relationships.md, which lists no types)

维护者速读

  • 表单里的明细表(主从表单的行项目表格)中,人员格子可以直接搜索选人,多选格子可以选多个选项,标签格子可以加标签,勾选格子是复选框,评分格子是星星;以前这些都是普通文本框,人员要手填用户编号,多选只能填一个值。
  • 属于列表页重做专题的单元格编辑那一组,替在主从表单里录入明细行的用户解决「人员、多选填不进去」的问题。
  • 已有表单的明细表会直接变样:布尔字段从「是/否」下拉变成复选框,评分字段从数字框变成星星;作者在列上明确写了类型的不受影响;出错时最坏是这几类格子不好用,已存的数据不受影响,可直接撤回。
  • 无

What changes

The card's words map onto the enum by the spec's existing rule that every column type is spelled as its namesake field type (the inline-grid-column-carriers probe and the field.json liveness note rely on it): people = user, multi-select = multiselect, tags = tags, check = boolean, rating = rating.

Spec (packages/spec/src/data/field.zod.ts). InlineGridColumnSchema.type gains user, multiselect, tags, boolean and rating (nine → fourteen). The column gains one optional key, max: the star count of a rating cell (default 5), because a column carries no field definition and a max: 10 rating would otherwise draw five stars. options and multiple describe what the new cells read from them. inline-grid-columns.ts (deriveInlineGridColumns' cell-type mirror) maps the same way, and each new cell type keeps the fill priority its field types had before, so which derived columns are visible by default does not change (the existing budget pins stay green unchanged). Liveness ledger: the type note lists fourteen types, and a max child row. Regenerated: reference docs, authorable-surface/data.json (one new key), liveness state counts.

Derivation (ui/packages/plugin-form/src/deriveMasterDetail.ts). fieldTypeToColumnType maps user → user, multiselect / checkboxes → multiselect, tags → tags, boolean / toggle → boolean, rating → rating. A derived or hydrated column carries multiple from a multi-person field, max from a rating field, and the child's options on multiselect columns. A tags column takes no options: its cell holds free-form tags and reads no option list. A boolean column keeps the two options it carried as a select ('true' / 'false', labelled with the session's words through booleanLabel): they are the words its read-only and list-mode cells read as, so booleanLabel stays live. A column that declares its type is left alone, as before.

Cells (ui/packages/fields/src/widgets/grid-field/GridFieldWidget.tsx, gridCellPanels.tsx). The cells reuse the main list's in-cell faces rather than forking them:

  • GridPanelCell (new, beside S5's GridSelectCell) is a panel shell under the cell that hosts a widget's own inCell face over a draft: a click outside or Tab writes the draft, Esc writes nothing, and a face that ends on one pick calls commit. The cell keeps drawing its value while the panel is open.
  • multiselect hosts MultiSelectField inCell, tags hosts TagsField inCell, and user hosts UserField inCell (the main list's person picker: searchable list, recents, Clear; a single pick writes and closes).
  • boolean is the Checkbox primitive (click / Space), writing true / false.
  • rating draws RatingField inCell (a click on a star sets it); a digit key on the cell sets that many stars, 0 clears, a digit above max does nothing.
  • Read-only table and list mode: people by name (UserField readonly), a rating as its stars, a multi-select's option labels, a check cell as its option word (else the session's yes/no word).
  • A required cell holding an empty list (multi-select, tags, several people) reads invalid, as an empty scalar does.
  • A multi-select, tags or several-people cell that is emptied writes null, not []: the save path counts only null / '' as blank (isBlankRow), and a cleared multi-value field stores null elsewhere too. An emptied cell reads —.

Item 2 of the card (interim read-only columns) is not built: the seat reads it as superseded once item 1 ships, and this PR ships item 1.

Visible change on existing master-detail forms (named in the changeset): a derived boolean / toggle column is a checkbox instead of the yes/no select and writes booleans instead of the strings 'true' / 'false' (the server's write normalisation reads both the same); a derived rating column is stars instead of a number box; user, multiselect, checkboxes and tags columns are no longer plain text boxes.

Tests

  • ui/packages/fields/src/widgets/GridField.test.tsx, new top-level describe "the cells that edit as in the main list": multi-select (labels, several picks staged then written on leaving, Esc writes nothing, empty list reads invalid when required), tags (a new tag added from the list, Tab writes and moves to the next cell), check (checkbox over true and 'false', click writes a boolean, read-only reads the option word), rating (five stars by default, a click sets, digit keys set and 0 clears, a digit above the stars sets nothing, max: 10 draws ten), people (the person picker opens under the cell; its Clear writes and closes). An emptied multi-select and an emptied tags cell each write null (both pins go red with the fix taken out), and the emptied tags cell reads —.
  • ui/packages/plugin-form/src/deriveMasterDetail.test.ts: the five mappings with their neighbours as controls; a new describe pinning the extras on both the derive and the hydrate path (multiple, options on a multi-select and none on a tags column, the check column's two words, max from the field and none when the field declares none), and that an authored column, a type: 'select' over a boolean field included, keeps its type and extras.
  • deriveMasterDetail.booleanOptions-12924.test.tsx: the derived boolean column is now type: 'boolean' with the same two session-language options; the editable grid pins read checkbox states instead of picker text; the language-switch pin now re-labels the read-only table (the editable check cell shows no word).
  • MasterDetailForm.lateCatalogue-12924.test.tsx: the late-catalogue re-label is read where the grid still draws a boolean's word, a second detail in inlineMode: 'form'; the editable Lines detail keeps the unsaved edit and its checkboxes through the catalogue landing.
  • deriveMasterDetail.inlineGridColumns-11345.test.ts: the "output unchanged" corpus moves its one derived boolean column (gift) from select to boolean, marked where it sits; nothing else in the corpus moves.

Deviations

Four files outside the claim's surface, each a direct consequence of the widening. Seat 7 counts them inside the card.

  • packages/metadata-core/src/object-schema-fls-references.ts: INLINE_COLUMN_POSITIONS classifies the new max key as keep (a number, never a field name). object-schema-fls-references.test.ts refuses an unclassified InlineGridColumnSchema key, so it was red in Test Core 3/10 at 10767ef3.
  • ui/packages/types/src/__tests__/strict-face-read-keys-11070.test.ts: the refused-column-type row used boolean, which is now a cell type, so it moves to toggle, which is still refused. It was red in Test UI 12/16 at 10767ef3.
  • ui/packages/types/src/form.ts: a docblock no longer counts "nine" cell controls.
  • content/docs/data-modeling/field-types.mdx: the inline grid bullets list the fourteen cell types and the checkbox booleans, and add the people, multi-select, tags and rating cells.

The changeset adds '@objectstack/metadata-core': patch and '@object-ui/types': patch for the first two packages.

Acceptance notes

  • A click outside a multi-select / tags / people panel writes through the popover's own dismiss (onOpenChange). The jsdom pins leave the panel through Tab, because that harness's pointer events do not reach the dismiss. The click outside is measured live below.

Live click-through

Showcase app (objectstack dev --seed-admin, fresh database) plus the Console from source (Vite), Chromium through Playwright. To host the three cells, the run added, without committing, inlineEdit: 'grid' and inlineColumns (name, f_multiselect, f_tags, f_users) to showcase_field_zoo.f_master_detail, and a fieldGroups entry placing that child on showcase_project. The edits were reverted afterwards. Project "Website Relaunch", Edit, row 0 of the zoo grid. "Outside" is a click on the dialog's "Edit Project" heading.

Step Multi-select Tags People (multiple)
Stored before ["red","green"] ["alpha","beta"] null
Pick Blue type gamma, Enter Dev Admin
Panels open after the click outside 0 0 0
Cell after the click outside Red, Green, Blue alpha, beta, gamma Dev Admin
Stored after Update ["red","green","blue"] ["alpha","beta","gamma"] ["<Dev Admin's user id>"]
Cell after a page reload and Edit again Red, Green, Blue alpha, beta, gamma Dev Admin
Emptied, click outside, Update: cell / stored — / null — / null not run

The run found one defect, fixed in 2197dbdd: an emptied tags cell drew nothing instead of —. The display helper now reads an empty list as empty for every type. It is pinned in GridField.test.tsx, and the final row above was read with the fix served.

  • rating cells keep RatingField's one button per star, so Tab visits each star; the arrows and digit keys work from any of them.

Verification

Final head 6185caed. It adds three commits to f73a4351:

Checks at the final head:

  • dispatch-gates --ran at 6185caed: 120 derived families accounted for, 120 run, 0 NOT MEASURED, every one exit 0. That includes check:generated and check:liveness after a spec rebuild, and pnpm --dir ui exec vitest run scripts/ run alone under the verify lock.
  • ui/packages/fields/ + ui/packages/plugin-form/ (whole packages) at 6185caed: 567 files, 7,629 tests passed, 8 skipped.
  • The new pins were ablated: both "emptied, it writes null" pins and the tags — pin go red with their fix taken out.
  • overlap-check at 6185caed, verdict read before the push. It merges cleanly with origin/main a10987ae and with 6 of 7 open PR heads. feat(console)!: record create and edit stop loading internal forms; a field's Show on create switch #36543 conflicts only in packages/spec/liveness/state-counts/field.md, a generated count: whichever lands second regenerates it with gen:liveness-counts, not a hand merge.
  • Earlier heads: at 10767ef3, pnpm --filter @objectstack/spec test (871 files, 27,909 tests) and test:repo (92 files, 1,562 tests) passed. CI was green at f73a4351.

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jTbWpneBrqq7SJvrNt

…tags, boolean, rating; add max

Claude-Session: https://claude.ai/code/session_01QsR2jTbWpneBrqq7SJvrNt
Co-authored-by: Claude <noreply@anthropic.com>
…for the widened column type

Claude-Session: https://claude.ai/code/session_01QsR2jTbWpneBrqq7SJvrNt
Co-authored-by: Claude <noreply@anthropic.com>
… column as the check cell

Claude-Session: https://claude.ai/code/session_01QsR2jTbWpneBrqq7SJvrNt
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation protocol:data tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/metadata-core, @objectstack/spec, touching 3 documentable anchor(s). ⚠️ 4 changed file(s) yielded no anchor (packages/spec/authorable-surface/data.json, packages/spec/liveness/field.json, packages/spec/liveness/state-counts/field.md, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

  • content/docs/releases/v17/17-7.mdx (via InlineGridColumnSchema (symbol, a top-level const))

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

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

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

Which tree this was computed on

This run read content/docs from 830a6c719694d94edcd515ec53c4be585c4df18b — the merge of head 6185caed0a71444284bb83c545efd82366896b6c into base a10987ae8fa35f1d1e21b756b3ddd907d07a5897, which is what actions/checkout gives a pull_request run. Not the PR head.

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

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 830a6c719694d94edcd515ec53c4be585c4df18b && git checkout 830a6c719694d94edcd515ec53c4be585c4df18b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a10987ae8fa35f1d1e21b756b3ddd907d07a5897 6185caed0a71444284bb83c545efd82366896b6c && git checkout -B drift-repro a10987ae8fa35f1d1e21b756b3ddd907d07a5897 && git merge --no-ff 6185caed0a71444284bb83c545efd82366896b6c

node scripts/docs-audit/affected-docs.mjs --json a10987ae8fa35f1d1e21b756b3ddd907d07a5897

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

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

…olumn type pins and docs to fourteen cells

Claude-Session: https://claude.ai/code/session_01QsR2jTbWpneBrqq7SJvrNt
Co-authored-by: Claude <noreply@anthropic.com>
…-s3wy8p

# Conflicts:
#	ui/packages/fields/src/widgets/GridField.test.tsx
#	ui/packages/fields/src/widgets/grid-field/GridFieldWidget.tsx
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 REWORK · head f73a4351f074c020dff6c9577c26bbb46cb0bc96 · 2026-11-22T18:12Z

维护者速读

  • 用户能看到什么变化:表单里主从明细表的五类格子改了。人员格子可以搜索选人,多选格子可以选多个,标签格子可以加标签,勾选格子是复选框,评分格子是星星。以前这些都是普通文本框:人员要手填用户编号,多选只能填一个值。
  • 为什么做:卡 Form line-item table: people, multi-select, tags, check and rating columns get their own cell editors instead of a plain text box #36043(主从明细表的单元格编辑)。
  • 出错会怎样:已有表单的明细表会直接变样(布尔字段从「是 / 否」下拉变成复选框,评分从数字框变成星星)。作者在列上写了 type 的不受影响。最坏是这几类格子不好用,已存的数据不受影响。可以整体撤回。
  • 要你做什么:无。
  • 席位意见:REWORK,只有 1 项,只改声明行:Metadata-protocol 应为 semantic。代码、测试、spec 和文档我读下来都是对的,见下面。

要改的(1 项)

  1. Metadata-protocol: added 应为 semantic。 AGENTS.md 的定义是:新键、新可接受值、新元数据类型是 added;含义或默认值变了是 semantic;同时有几种时「narrowed over semantic over added」。本 PR 两种都有:

    • added:InlineGridColumnSchema.type 多了五个值,列多了一个 max 键;
    • semantic:没写 type 的列,type 是从子字段推出来的默认值,这个默认值变了。boolean / toggle 原来推成 select,现在是 boolean,写入的值也从字符串 'true' / 'false' 变成布尔值;rating 从 number 变成 rating;user、multiselect / checkboxes、tags 从 text 变成各自的类型。这正是 spec/src/data/inline-grid-columns.ts 的 cellTypeOf 和 deriveMasterDetail.ts 的 fieldTypeToColumnType 改的地方。changeset 自己也写了「Visible change on existing forms: a column the table derives from a child field (no type written) now follows that field」,也就是作者什么都没改,已有元数据的效果变了。

    所以按「semantic over added」,正文和 changeset 两处都改成 Metadata-protocol: semantic。changeset 的级别已经是 minor,不用改。先例:feat(record-page): on a phone the bottom bar holds the object's own actions only; Edit moves into the top bar's More #36478 改 mobileMaxVisible 不写时的效果,声明的就是 semantic。

席位核对

  • 卡片关系:首行 Fixes #36043。卡上第 1 项(五类列类型和与主列表相同的格内编辑)和第 3 项(每类都有测试)都做了。第 2 项(在第 1 项之前先把这几列设成只读的过渡做法),正文写明席位认为第 1 项交付后就不需要了,我认。卡的验收(人员可搜索选人、多选能存多个、勾选和评分和主列表一样)都由下面的测试覆盖。Fixes 成立。
  • spec:五个新值都沿用「列类型和同名字段类型同名」的既有规则(people = user、check = boolean 等),正文写明了。max 是 int().positive() 的可选键,默认 5。options、multiple 的 describe 补上了新格子怎么读它们。cellTypeOf 里新加的五个类型保留了原来字段类型的填充优先级(boolean 同 select 为 0,rating 同 number 为 1,其余三个同 text 为 4),所以默认显示哪些推导列不变,原来的预算用例没改照样绿。
  • 代码:
    • 新格子复用主列表的格内控件(MultiSelectField / TagsField / UserField / RatingField 的 inCell),外面包一层新的 GridPanelCell:点外面或 Tab 写入,Esc 不写;
    • 勾选格是 Checkbox,onCheckedChange 写 checked === true;
    • 评分格:数字键设星数,0 清空,超过 max 的数字不动;
    • 必填的空列表读作无效。
  • 写入从字符串变布尔:我核过服务端,packages/objectql/src/validation/record-validator.ts:1217 把 '1' / 'true' 强制成 true,所以 changeset 说的「the server reads both the same」成立。
  • 声明:Clause-②: yes (widening) 对:枚举加值、列加 max,@object-ui/fields 的 GridColumn 跟着放宽,没有删改。Metadata-protocol 见第 1 项。Skills-docs: none — …:正文说 git grep skills/ 只有 objectstack-data/rules/relationships.md 顺带提了一下,没有列类型,属实。不是 !,也没有 (narrowing),不欠 dogfood。
  • changeset:五个包都有条目;spec、fields、plugin-form 是 minor,metadata-core、types 是 patch。逐句核过:五个类型、max、各格子的行为、只读面、对已有表单的可见变化、FLS 清洗把 max 归为保留,都和 diff 一致。
  • 偏差:清单外的四个文件都是这次放宽的直接后果,正文逐个写了:INLINE_COLUMN_POSITIONS 收 max;被拒列类型的那条用例从 boolean 换成仍被拒的 toggle;form.ts 的 docblock 不再写「nine」;field-types.mdx 列出 14 种格子。我认。
  • 已发布文档:field-types.mdx 手写的部分和生成的参考页都和代码一致。合入 main 后的生成文件(field.md 计数 109 / 1 / 6 / 116、authorable-surface/data.json、四个参考页)都是用生成器重新生成的,没有手改,并且带上了 feat(spec): a field can say it is not asked for when a record is created (showOnCreate) #36449 的 showOnCreate 和 feat(audit): the activity stream shows each changed field's old → new values by default, served only for fields the reader may read #36399 的 fieldHistory。
  • 测试:GridField.test.tsx 新的 describe 覆盖五类格子,包括 Esc 不写、Tab 写入、max: 10 画十颗星、Clear 写入并关闭。deriveMasterDetail 的五个映射都有相邻类型作对照,另有推导和 hydrate 两条路径上的附加项,以及「写了 type 的列不变(含布尔字段上的 type: 'select')」。原来三个用例文件改的地方都是布尔列从 select 变成复选框的直接结果。
  • 不阻塞:点外面写入走的是弹层自己的 onOpenChange,正文写明在 jsdom 里测不到,浏览器里也没测(NOT MEASURED),用例都用 Tab 离开。这是多选、标签、人员三类格子最常用的写入路径,落地前或落地后在控制台里点一次会更稳。
  • 门禁:本 head 上推导出的 118 族全部跑过,每个都 exit 0;check:generated、check:liveness 是最新的。PR-body guards 有一次运行被取消,同名的新运行在 17:38:52Z 是 success。
  • CI @ f73a4351:62 success、11 skipped、0 failed(那一条 cancelled 见上);mergeable clean。
  • 落地:席位在并行跑契约档 L2。两份评审都通过后,由区 ready + auto-merge。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: f73a4351f074c020dff6c9577c26bbb46cb0bc96
Local-runs: none
Scope: packages/spec/src/data/field.zod.ts, packages/spec/src/data/inline-grid-columns.ts + ui/packages/fields/src/widgets/grid-field/GridFieldWidget.tsx, ui/packages/fields/src/widgets/gridCellPanels.tsx, ui/packages/plugin-form/src/deriveMasterDetail.ts, packages/metadata-core/src/object-schema-fls-references.ts, packages/spec/liveness/field.json, packages/spec/src/inline-grid-column-carriers.test.ts

Inputs read: card #36043 (body, triage 7061460926, claim 7076078435; no ruling on the card), the PR body, the 24-file list, the net diff against main, and the check-runs on this head. The rest of the diff (tests, generated reference pages, the changeset text, ui/packages/types) is the lane seat's ACCEPT at TIER_DEFAULT.

Check-runs on the head: 62 success, 11 skipped, 1 cancelled. The cancelled run is PR-body guards 137294400704 (started 17:37:52Z). The same check ran again on the same head as 137294492840 (started 17:38:12Z) and succeeded, so the cancelled run is superseded. Spec property liveness, Lint & Repo Gates, Test Core (all 10 shards), Test UI (all 16 shards), Check Changeset and Governed Surface Queue Guard are green.

① Derived judgments

  • InlineGridColumnSchema.type goes from nine to fourteen members: user, multiselect, tags, boolean, rating join. Right. The card asks for exactly these five, and each is spelled as its namesake field type, which is the rule the carriers probe and the ledger row already rely on.
  • One new optional key, max (positive integer). Right. A typed column carries no field body, so a rating field with max: 10 would otherwise draw five stars. It is inert on every other cell type, as accept is off a file cell.
  • No type-conditional rule is added, so HYDRATED_INLINE_COLUMN_TYPE in stack.zod.ts correctly stays at its one currency row. No existing rule refuses options on multiselect, multiple on user or max on rating.
  • All four carriers (a relationship field's inlineColumns, a form view's subforms[].columns, object-master-detail-form details, record:line_items) take the same schema object and draw through the same grid, so the widening reaches them together. Right.
  • Every admitted type has a reader and an editor in GridFieldWidget.tsx: user hosts UserField inCell and reads through UserField readonly; multiselect hosts MultiSelectField inCell and reads option labels; tags hosts TagsField inCell and reads the joined list; boolean is the Checkbox primitive and reads the option word; rating is RatingField inCell and reads as stars. No type is admitted that the grid cannot draw or save.
  • Saved value shapes, read against the field schema and record-validator.ts: a single person saves the sys_user id and several people save an array of ids (LookupField writes option.value); multiselect and tags save string[]; boolean saves true / false, and the validator's BOOLEAN_READINGS still reads the old 'true' / 'false' strings the same; rating saves an integer from 1 to the column's max, or null for 0, and the server's min / max gate on the field stays the authority. FieldSchema.multiple names user among the multi-capable types. Right.
  • Read permission on a people cell: names come from the existing LookupField hydration, a find / findOne on sys_user through the session's own data source, and recordToOption builds the label from withoutDeniedFields. A reader denied the name gets the id or an empty value, never a name. No new server path. Right.
  • cellTypeOf in inline-grid-columns.ts mirrors fieldTypeToColumnType arm for arm. The fill priorities keep each field type where it was (boolean 0 as select was, rating 1 as number was, user / multiselect / tags 4 as text was), so the default visible columns do not move. Right.
  • The carriers test does not hold a literal list. It reads the enum off the schema and probes every member against every key, so it follows the fourteen with no edit beyond its comment. The literal accept set is held by the generated reference pages under check:generated, and the refused side by strict-face-read-keys-11070.test.ts, which now refuses toggle. Right, and worth knowing: a member dropped from the enum would be caught by the generated pages, not by the carriers test.
  • Ledger: field.json gains one max child row (live), the type note lists fourteen, and the fieldHistory and showOnCreate rows from main are present. The state-counts shard reads 109 live, 1 dead, 6 planned, 116 classified, one more than main, matching the one new row. authorable-surface/data.json gains data/InlineGridColumn:max alone. True.
  • INLINE_COLUMN_POSITIONS classifies max as kept. Right: it is a number and never names a field.
  • The release-owned page content/docs/releases/v17/17-7.mdx is named by the docs-drift check only. The diff edits no file under content/docs/releases/.
  • Not in this card, and unchanged by it: a select field with multiple: true still derives a single-value select cell.

② Semver level

  • @objectstack/spec minor: an enum gains members and an optional key is added. Nothing that parsed before is refused. Correct.
  • @object-ui/fields and @object-ui/plugin-form minor: new cells, a new exported shell, and a visible change on derived columns that the changeset names (a derived check cell writes booleans where it wrote the strings). The server reads both, and the row-rule record already read those cells as booleans. Minor holds.
  • @objectstack/metadata-core patch and @object-ui/types patch: one classified key and a comment plus a test row. Correct.
  • Clause-②: yes (widening) is on the PR body and in the changeset, and it matches the diff. Metadata-protocol: added matches: one new authorable key, no stored body needs converting.

③ Boundary flags

  • Outside-click write not measured in a browser (dev flag). Answered from the code: every close of the popover that is not Esc goes through onOpenChange to close(true), and Esc is stopped in onEscapeKeyDown before it. The grid's window Esc handler does not act on a key pressed inside the portaled panel. The read holds; the lane seat should still see one outside click in a browser before accept.
  • Rating stars are one button each, so Tab visits each star (dev flag). Accepted as stated; arrows and digit keys work from any star.
  • Item 2 of the card (interim read-only columns) not built. Accepted: item 1 ships in this PR, so the interim has nothing to cover.
  • Four files outside the claimed surface. Accepted: each is a direct consequence of the widening, and two were red in CI without them.
  • No open_questions entry on the card or the PR.
  • SQL push-down: the diff adds no server query, no id materialisation and no in-app join. See N3 for the client-side name read.

④ Design judgment

field.zod.ts: the enum and max hold against their first consumer. One sentence does not.

S1 (should-fix): the options describe in field.zod.ts says the key holds "the tags a tags cell offers", and deriveMasterDetail.ts (takesOptions) copies a tags field's options onto the column for that reason. TagsField never reads field.options: its in-cell list offers only the tags the cell already holds, plus free text. So an author who follows the describe gets nothing, and on a tags field that declares options the server refuses a free tag (invalid_option, tags is in MULTI_OPTION_TYPES) while the cell never shows the allowed set. Either offer the column's options in the cell, or strike the clause from the describe, the regenerated pages and the takesOptions comment.

GridFieldWidget.tsx and gridCellPanels.tsx: the cells agree with the contract except at one edge.

S2 (should-fix): a cleared list cell writes []. The widget's own isEmptyCell reads [] as empty, but the save path's isBlankRow (masterDetailTx.ts, read only) counts only null, undefined and '' as blank. A new line where the user picks a tag, an option or a person and then removes it is no longer blank, so it is sent as a create and can persist as an empty child record, where a cleared text cell was dropped. The field contract says an empty list stores null; writing null when the list empties (in the multiselect / tags / user onWrite) closes it inside the diff. Multi-record lookup cells on main share the edge; this PR adds three cell types to it.

inline-grid-columns.ts: holds. Mirror and priorities agree with the renderer, sentence by sentence.

deriveMasterDetail.ts: the five mappings, multiple from a multi-person field, max from an integer rating max, and the untouched typed column all agree with the schema's describes.

object-schema-fls-references.ts, field.json, the carriers test: agree with the contract.

N1 (nit): stale prose. component.zod.ts line 2585 and metadata-form-zod-reconciliation.test.ts line 302 still count twenty column keys (now twenty-one), and that ledger row's reason does not list max. In deriveMasterDetail.ts, the columnValueType and hydrateColumns docblocks still say a boolean becomes a select. In field.json, the inlineColumns note cites objectui db11afd4967c for a fourteen-type mapping that commit does not hold, and the options child note still names select cells only.

N2 (nit): an empty tags list draws an empty cell where an empty multi-select draws the em dash; cellDisplayText has a multiselect arm and no tags arm.

N3 (nit): each people cell that holds a bare id reads its name with its own findOne on sys_user, once for the display face. This is the path lookup cells already take on main, and the PR's stated reason is reuse of the main list's face. A follow-up could expand the person on the child read.

No security-sensitive mechanism found.

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

VERDICT: PASS

…Metadata-protocol semantic; stale column prose

Claude-Session: https://claude.ai/code/session_01QsR2jTbWpneBrqq7SJvrNt
Co-authored-by: Claude <noreply@anthropic.com>
…-select does

Found on the live click-through: after its last tag was unpicked the cell
drew nothing instead of the em dash.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6185caed0a71444284bb83c545efd82366896b6c
Local-runs: none
Scope: packages/spec/src/data/field.zod.ts, packages/spec/src/data/inline-grid-columns.ts + ui/packages/fields/src/widgets/grid-field/GridFieldWidget.tsx, ui/packages/fields/src/widgets/gridCellPanels.tsx, ui/packages/plugin-form/src/deriveMasterDetail.ts, packages/metadata-core/src/object-schema-fls-references.ts, packages/spec/liveness/field.json, packages/spec/src/inline-grid-column-carriers.test.ts

Delta review. The record at f73a4351f074c020dff6c9577c26bbb46cb0bc96 (comment 7083478985) passed with S1 and S2 open. This record reads what changed since: the two own commits 6e74cfe0839 and 2197dbdd622 (11 files, +61/-22), the merge of main at 07b17542a24 (68ebf224a70), and the regenerated page (6185caed0a7). Inputs read: card #36043 and its comments, the L1 REWORK 7083426270, the PR body, the 26-file list, the net diff against main, and the check-runs on this head. Everything the earlier record judged and this range does not touch stands as judged there.

Check-runs on the head: 74 runs, 63 success, 11 skipped, none failed, none cancelled, none pending. Spec property liveness, Lint & Repo Gates, Test Core (all 10 shards), Test UI (all 16 shards), Check Changeset (both runs), PR-body guards (both runs) and Governed Surface Queue Guard are green. The PR reads mergeable.

① Derived judgments

  • The accept set does not move in this range. InlineGridColumnSchema still has fourteen type members and the one new key max. The only schema edit is the options describe.
  • The options describe now reads: options of a select or multiselect cell, the two words of a boolean cell, and "A tags cell reads none: it holds free-form tags." Right. TagsField reads no field.options; its list is built from the tags the cell holds.
  • A column that declares type: 'tags' together with options still parses. Right: no rule is added, the key is inert there, as accept is off a file cell, and the describe now says so.
  • takesOptions in deriveMasterDetail.ts is select, multiselect, boolean. A derived or hydrated tags column carries no options, even from a tags field that declares some. Right, and pinned on both paths (topics in deriveMasterDetail.test.ts).
  • An emptied multi-select, tags or multi-person cell now writes null. Right against every consumer read:
    • The field contract. FieldSchema.multiple says a cleared optional multi-value field stores null, that the rule binds every writer, and that readers take null and [] alike as empty.
    • Blank counting. isBlankRow in masterDetailTx.ts counts null, undefined and ''. A new line whose only value was removed is blank again and is not sent as a create.
    • In-grid required. isEmptyCell reads null and [] both as empty, so the cell is flagged either way. The pin with a stored [] is still there.
    • Server write. The record validator already turns a blank multi-value write into the blank storage form, and required refuses an empty or null list. null from the client is the form the server would have stored. An update that empties an optional list sends null and clears it.
    • A stored [] on an older row. It reads as an empty cell (held is [], the face draws the em dash). Opening and leaving the panel writes nothing, because the draft equals the value. Picking and removing a value leaves the draft [], equal to the stored [], so nothing is written either. The row has an id, so blank counting does not apply to it.
  • cellDisplayText now returns the em dash for an empty list on every column type. Right. File cells already did; lookup cells draw elsewhere.
  • Ledger: the inlineColumns note now says the in-repo fieldTypeToColumnType maps all fourteen since this card, and no longer credits that to the objectui commit. The options child note names select, multiselect and boolean, and says a tags cell reads none. True to the tree. No row is added or removed, so the state counts do not move in this range.
  • The merge. The net diff against main still holds only this PR's 26 files. The merge commit kept the branch's older mobileMaxVisible row in content/docs/references/ui/component.mdx while taking main's describe in component.zod.ts; 6185caed0a7 regenerates that one row. At the head the row is byte-equal to main's row and to the describe in component.zod.ts line 859. component.zod.ts holds both main's describe and this PR's "twenty-one keys" comment. Nothing of main's is reverted.
  • The regenerated page against its generator (packages/spec/scripts/lib/schema-section.ts) and the describes. The generator writes a property's description into the cell as is, after escaping. The type, options, multiple and max rows under RecordLineItemsProps.columns[number], and the same rows in field.mdx, equal the zod describes word for word. The three columns rows carry the generator's own shortened enum. The generated-output checks live in the Lint workflow, and every Lint run on this head is green.

② Semver level

  • @objectstack/spec minor, @object-ui/fields minor, @object-ui/plugin-form minor, @objectstack/metadata-core patch, @object-ui/types patch. Unchanged, and still correct. The range adds a behaviour fix to cells that are new in this same PR, a describe sentence and prose. Nothing that parsed before is refused.
  • Clause-②: yes (widening) is on the PR body and in the changeset. It matches: an enum gains members and an optional key is added.
  • Metadata-protocol: semantic is on the PR body and in the changeset. It is the right value. The PR adds values and a key, and it also changes the default of an omitted column type (a boolean field derived a select and now derives boolean, a rating field derived number and now derives rating, and so on). AGENTS.md ranks semantic over added. The L1 REWORK 7083426270 asked for this line and the tree now carries it.
  • The changeset text now states the two delta behaviours: an emptied list writes null, and a tags cell takes no options. Both match the code.

③ Boundary flags

  • Outside-click write (the flag from the earlier record). Answered: the PR body now reports a live run in Chromium where a click outside closed each of the three panels and the value was stored. The code path is the one read before, onOpenChange to close(true).
  • Multi-person cell, emptied: reported "not run" live and not pinned. Answered from the code. LookupField emits [] when the last person is removed or Clear is pressed with multiple (three sites), and the user cell's onWrite passes it through the same emptyListAsNull as the other two cells. It writes null. See N4 for the pin.
  • A tags field that declares options: the server still refuses a free tag on it, and no tags face shows the allowed set, in the grid or in the main list. This is the state on main, the PR no longer claims otherwise, and it is outside this card. A follow-up card could offer the declared set in TagsField.
  • Multi-record lookup cells still write [] when emptied. Unchanged from main and outside this card; the helper is there to reuse.
  • Overlap, from the PR body: feat(console)!: record create and edit stop loading internal forms; a field's Show on create switch #36543 touches the generated packages/spec/liveness/state-counts/field.md. Whichever lands second regenerates it. For the lane seat at merge time.
  • No open_questions entry on the card or the PR.
  • SQL push-down: the range adds no server query, no id materialisation and no in-app join.

④ Design judgment

S1: closed. The describe, the regenerated rows, takesOptions with its comment, and the ledger note agree that a tags cell reads no options. The derive pin holds a tags field that declares options and expects none on the column.

S2: closed. emptyListAsNull sits on the onWrite of the multiselect / tags cell and of the user cell, the three places a list can empty. The multi-select and tags pins assert null after the last value is removed and the panel is left with Tab.

N1: closed. component.zod.ts and the reconciliation ledger count twenty-one keys and the ledger reason lists max; the two deriveMasterDetail.ts docblocks say check cell; the ledger notes are corrected.

N2: closed. An emptied tags cell draws the em dash, pinned beside the tags null pin.

N3: unchanged, left as a follow-up.

field.zod.ts: holds. inline-grid-columns.ts: not touched in this range; holds as judged.

No must-fix, no should-fix.

N4 (nit): the multi-person cell's null on empty is not pinned. It is correct by reading, and it shares the helper the two pinned cells use, so a pin is not needed for this verdict. One case in GridField.test.tsx (a user column with multiple, Clear, expect null) would keep the third call site from drifting. Follow-up, or left.

N5 (nit): two leftovers of the em-dash fix. In cellDisplayText the multiselect arm's own empty-list return can no longer be reached. In list mode a stored [] draws the em dash without the muted colour, because that class tests null and '' only. Display only.

No security-sensitive mechanism found.

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

VERDICT: PASS

Seat note: N4, N5 and the multi-record lookup cell that still writes an empty list (main's state) are non-blocking; the seat carries them with N3 to a follow-up card after landing. Landing waits on the L1-d delta.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 ACCEPT(增量)· head 6185caed0a71444284bb83c545efd82366896b6c · 2026-11-22T20:32Z

维护者速读

  • 用户能看到什么变化:和上一轮一样(明细表的人员、多选、标签、勾选、评分格子按主列表的方式编辑)。这一轮多了两点:把多选、标签或多人格子清空后存的是空值 null,不是空列表;清空的标签格子显示「—」。
  • 为什么做:卡 Form line-item table: people, multi-select, tags, check and rating columns get their own cell editors instead of a plain text box #36043。这一轮回应我上一轮的 REWORK 和席位 L2。
  • 出错会怎样:和上一轮一样。清空写 null 后,只剩空格子的一行仍算空行,不会被当成有内容的明细提交。
  • 要你做什么:无。
  • 席位意见:ACCEPT。上一轮的 REWORK 项已关。

增量核对(f73a4351 → 6185caed,4 个提交,其中 1 个合入 main)

  • 上一轮 REWORK 项(Metadata-protocol)已关:changeset 和 PR 描述都写 Metadata-protocol: semantic。省略 type 的列,默认格子变了,这是语义变化,和上一轮的判断一致。
  • 清空写 null:GridFieldWidget.tsx:137 新增 emptyListAsNull,多选 / 标签格子(:1350)和人员格子(:1379)的 onWrite 都经过它。
    • 多选和标签各有一个 jsdom 测试钉住「清空后写 null」,PR 说拿掉修复两个都会变红。
    • 多人格子我只读了代码,没有实机跑。链路是:LookupField 单元格里的「清除」先 onChange(multiple ? [] : null) 再 onCommit();GridPanelCell 的 commit 读 draftRef(同一个处理函数里设的草稿也读得到),写出 [];再经 emptyListAsNull 变成 null。逐个取消最后一个人时,filter 得到 [],走同一条路。多人格子清空这一支没有单独的测试,但它和已钉住的两支用的是同一个函数,不阻塞。
  • 清空显示「—」:cellDisplayText 对空数组返回「—」,对所有类型生效,有测试钉住。这是 PR 实机跑时找到的缺陷,在 2197dbdd 修复。
  • 标签列不带 options:deriveMasterDetail.ts 的 takesOptions 去掉了 tags。测试加了一个声明了选项的标签字段 topics,在推导和补全两条路径上都钉住「不带选项」。field.zod.ts 里 options 的说明、field.json 的 liveness 说明、两份参考文档都改成「标签格子不读选项」,彼此一致。
  • 「twenty-one keys」:我数了 InlineGridColumnSchema 在这个 head 上的键,是 21 个(name 到 requiredWhen)。component.zod.ts 和 reconciliation 测试里的数字都对;reconciliation 的「只适用于一种格子」清单也补上了 max。
  • PR 描述里的实机记录:多选、标签、多人格子点外面后写入,读数和代码一致。「清空、点外面、更新」这一行:多选和标签都是「— / null」,和上面的代码一致;多人格子写的是 not run,和我上面说的一样,没有实机读数。
  • 合入 main 后的再生成(6185caed):component.mdx 只动了一行,是 mobileMaxVisible 的说明。它照抄 main 上 component.zod.ts:859 的文字,不是这个 PR 的内容,只是把生成的文档跟上 main。
  • CI @ 6185caed:63 success、11 skipped、0 failed;mergeable clean;不在治理面。
  • 落地:非受管。席位的短增量 L2 通过后,由区 ready + auto-merge。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Landing (seat 7, 2026-11-22T20:33Z): head 6185caed0a71444284bb83c545efd82366896b6c · L1-d delta ACCEPT 7085367537 · L2 delta PASS 7085364786 (same head; S1, S2, N1 and N2 closed; N3 to N5 carried to a follow-up card) · check-governed-merges --pr 36392: NOT governed, 936 changed lines · CI on the head: 63 success, 11 skipped, none failed · mergeable clean. → pr_ready + automerge_enable (merge queue).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 20:34
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 6db1dc2 Nov 22, 2026
75 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-s3wy8p branch November 22, 2026 21:10
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…e console's eager chunk (objectstack-ai#36417)

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

repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ

Fixes objectstack-ai#36102

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

## 维护者速读

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

## What changes

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

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

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

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

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

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

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

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

## Tests

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

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

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

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

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

</details>

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

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

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

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

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

</details>

<details><summary>Suites</summary>

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

</details>

## Acceptance notes

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

## Verification

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

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

---

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

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

---------

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

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

repo:objectstack#7 · zhuangjianguo · session_01QsR2jVMKrYARogu1S6PcHj

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

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

## 维护者速读

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

## What changes

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

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

### What this PR deliberately leaves to PR 2

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

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

## Tests

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

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

## Acceptance notes

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

## Verification

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

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

</details>

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

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

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

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

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
… values by default, served only for fields the reader may read (objectstack-ai#36399)

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

Part of objectstack-ai#36290

PR 1 of 3 (spec + server). PR 2 draws per-field rows on the record page
from the served change code, and PR 3 adds the per-field history card
(`Fixes objectstack-ai#36290`). Shape approved by the seat (option B: a new key,
`enable.fieldHistory`, with no default), per ruling 7076513167.

Clause-②: yes (widening)
Metadata-protocol: semantic
Skills-docs: carried by objectstack-ai#36419

## 维护者速读

- 记录的动态里,每个被修改的字段现在默认显示「字段:旧值 → 新值」,所有对象都一样;对象写 `enable: { fieldHistory:
false }` 可整体关闭,字段写 `fieldHistory: false` 可单独关闭。成员只能看到自己有权读取的字段的修改,不开放
`sys_audit_log`。
- 属于「记录页字段修改历史」:以前只有逐个字段写了 `trackHistory: true`
才显示值,其余修改只写字段名。新开关没有默认值,所以已构建或已存储的对象升级后直接生效,不需要重新构建。
- 若出错,可能表现为成员看到不该看到的字段值(读取侧已按字段逐条收窄并有测试钉住),或某条动态写入失败(摘要已按 500
字符上限截断)。可整体撤回,已写入的动态行不受影响。
- 升级注意:`trackHistory: false`(对象上或字段上)都不再关闭值显示。要关闭,对象请写
`enable.fieldHistory: false`,字段请写 `fieldHistory: false`。字段设计器以前每次保存都会写
`trackHistory: false`,所以这个值不能当作关闭开关;仓库内 44 个平台对象已补上对象级开关。

## What changes

**Spec** (`packages/spec/src/data/object.zod.ts`, `field.zod.ts`,
forms):
- New `ObjectCapabilities.fieldHistory: z.boolean().optional()` with no
default. Absent: values show. `false`: values off for the object. It has
no default on purpose: `ObjectSchema.parse` materializes every defaulted
`enable` key whenever an `enable` block exists, so a default would be
written into every built artifact and stored definition (measured: 33 of
38 hotcrm objects carry an `enable` block). With no default, an upgraded
install gets values with no rebuild.
- `enable.trackHistory` keeps its schema and meaning (default `false`;
with `true` the default record page reads the compliance ledger and the
derived `history` verb is served). Its describe now says that value
display is `fieldHistory`'s question.
- New `FieldSchema.fieldHistory: z.boolean().optional()`, no default:
the field's off switch. Absent: values show. `false`: the change is
named by label only. `true`: values show, a media or JSON type included.
Under an object with `enable.fieldHistory: false`, values stay off
whatever the field says.
- Field `trackHistory` keeps its schema. `false` now reads like absent
(values show): the field designer wrote `trackHistory: false` on every
save while the key meant nothing (`FieldDesigner.tsx`, persisted by
`MetadataFieldsPage.tsx`), so a stored `false` cannot be told from a
choice. `true` keeps one job: it opts a media or JSON field in.
- Object form `enable` composite offers `fieldHistory`; the object
form's `fields` repeater and the field form offer the field
`fieldHistory`. Each row's help text says that unset means on, although
the switch shows off. Liveness entries `object.json#fieldHistory` and
`field.json#fieldHistory` (live, evidence
`audit-writers.ts#changeValuesShownFor`).
- The two closures over every `FieldSchema` key classify the new key:
driver-sql `FIELD_KEY_STORAGE_CLASS` (`presentation`: `createColumn`
never reads it) and metadata-core `FIELD_REFERENCE_POSITIONS` (`keep`: a
boolean that names no field). The metadata-protocol `field` property
count moves 84 → 85.

**Writer** (`packages/plugins/plugin-audit/src/audit-writers.ts`):
- `changeValuesShownFor(objectDef)` decides per changed field: off when
the object writes `enable.fieldHistory: false`, or the field writes
`fieldHistory: false`, or the field is a credential
(`collectMaskedReadFields`: `secret`, and `password` off better-auth
objects — both sides would be the same mask). Media and structured-JSON
types (`image`, `file`, `avatar`, `video`, `audio`, `signature`,
`composite`, `repeater`, `record`, `location`, `address`, `code`,
`json`, `vector`) show values only with an explicit `fieldHistory: true`
or `trackHistory: true`. Everything else is on, including a field that
writes `trackHistory: false`.
- `renderTrackedChangeSummary` and `planTrackedLookupReads` take that
predicate instead of reading `trackHistory === true`.
- The stored summary is fitted to `sys_activity.summary`'s `maxLength`
(500) by `fitStoredChangeSummary`: each side is cut to 60 characters
first, then trailing changes are left out (`; …`). Before this, the
tracked branch was not fitted, so a long value would fail the insert
under default-on. The `summary_message` code keeps every change, each
side capped at 1,000 characters.

**Read side** (`activity-field-redaction.ts`,
`activity-summary-message.ts`, `audit-plugin.ts`):
- The `fieldChanges` code (`metadata.summary_message`) is now served to
readers, narrowed change by change with the same `resolveServedFields`
answer as `metadata.old` / `metadata.new`. A reference field's change is
kept only for a reader served the referenced record's title
(`referenceTitlesPerRead`). Any other code is still stripped for
non-system readers, and `text_sources` stays stripped.
- When a reader is not served the stored summary, it is recomposed from
the narrowed changes in the reader's locale instead of dropped whole. A
row whose every change is withheld is still withheld as a row.
- The summary-locale middleware is now registered before the redaction
middleware, so redaction runs inside it and the locale composer sees the
narrowed code.

**44 in-repo objects** that wrote `trackHistory: false` now also write
`fieldHistory: false`, so their "no history" holds: cloud-connection
`sys-cloud-binding-credential`; metadata-core `sys-metadata-audit`,
`sys-metadata-commit`, `sys-metadata-history`; platform-objects
`sys-attachment`, identity `sys-account`, `sys-device-code`, `sys-jwks`,
`sys-oauth-access-token`, `sys-oauth-client-assertion`,
`sys-oauth-client-resource`, `sys-oauth-consent`,
`sys-oauth-refresh-token`, `sys-oauth-resource`, `sys-personal-view`,
`sys-session`, `sys-two-factor`, `sys-user-preference`,
`sys-verification`, system `sys-lifecycle-state`,
`sys-migration-journal`, `sys-migration`, `sys-platform-setting-audit`,
`sys-platform-setting`, `sys-recycle-bin`, `sys-secret`,
`sys-seed-landed-key`, `sys-setting-audit`, `sys-setting`,
`sys-trusted-key`; plugin-audit `sys-activity`, `sys-audit-amendment`,
`sys-audit-checkpoint`, `sys-audit-log`, `sys-audit-signing-key`,
`sys-comment-reaction`; plugin-sharing `sys-share-link`;
service-automation `sys-connector-connection`,
`sys-connector-credential`, `sys-flow-credential`; service-messaging
`channel-account`, `channel-user-link`, `user-device`; service-realtime
`sys-presence`. hotcrm at `689166c`: 0 objects write `trackHistory:
false` (reported to the seat; nothing pushed there).

**Files that moved because the default flipped** (approved by the seat
as growth within the ruling):
- *Object-form translation bundles, 11 locales*
(`packages/platform-objects/src/apps/translations/*.metadata-forms.generated.ts`):
the new `enable.fieldHistory` label, and the two `trackHistory` help
texts, which still said "opt-in per field". Why it moved: the form
offers a new row, and the old help text is now false. Since review round
1 they also carry the field `fieldHistory` row labels and the new help
texts. Count pins move with them:
`object-collapsed-sections-echo-decisions.test.ts` (panel leaves 117 →
119, capabilities 11 → 13, open leaves 128 → 130) and
`object-lifecycle-panel-echo-decisions.test.ts` (positive control 756 →
759).
- *Two dogfood files*:
`field-history-tracking-activity.dogfood.test.ts`, whose website-only
leg pinned the label-only frame and now reads `Website:
https://before.example → https://after.example` (why: `website` declares
no `trackHistory`, so it is on).
`activity-label-display-field.dogfood.test.ts`: its `REF_TITLED` fixture
gets `enable: { fieldHistory: false }`. Why: those pins read the update
frame that names the record by its label (the referenced title). With
values on, the update's summary would be `Name: titled → titled again`,
which names no record label, so the withheld/served pair would pass
without testing anything. With values off, the frame still names the
record label, so the pins keep testing whether the title is served.
- *Checklist item* `records-forms.field-history-tracking` rev 16: title,
acceptance[1], negative[0], automated.ref and source[1] said values were
opt-in per field. Why: they now describe the shipped default.
- *Four hand-written docs*: `protocol/objectql/security.mdx` §7,
`data-modeling/objects.mdx` flag table, `data-modeling/fields.mdx` and
`data-modeling/validation-rules.mdx` `trackHistory` rows. Why: each said
values were opt-in.

## Review round 1 (L2 7078144432 FAIL, L1 7078132570 REWORK)

- **M1, designer-saved `trackHistory: false`.** Closed by a field key of
its own instead of a conversion (seat OK'd). A stored-row conversion was
measured and rejected: `applyConversionsToStoredItem`
(`packages/spec/src/conversions/stored.ts`) replays the whole chain on
every read with `includeRetired: true` and no version window. So a
conversion that drops field `trackHistory: false` would also erase every
deliberate opt-out saved after the upgrade, on every load. With
`fieldHistory` as the off switch, a stored `trackHistory: false` reads
like absent, so fields already saved through the designer show values
after the upgrade with no conversion. Census: no code-authored field in
`packages/**` or `examples/**` writes `trackHistory: false`; all 45
occurrences are object-level `enable` blocks (44 objects plus a
comment).
- **S1, two-state switch.** Each `fieldHistory` row and the field
`trackHistory` row now have help text. Renderer, read at this head:
`SchemaForm.tsx` draws a boolean as `<Switch checked={!!value}
onCheckedChange={(c) => onChange(c)} />`. So an untouched switch writes
nothing, and only a toggle writes `true` or `false`. It cannot show
unset apart from `false`: an unset `fieldHistory` shows as off while
values show. The help text says this. A third state is a renderer change
that no PR on this card carries.
- **Nits.** The field describe now says an object `enable.fieldHistory:
false` wins over a field `true` (pinned). Not taken: `tree` changes
still show a stored id, and multi-value option types show stored values
joined by commas. The card's acceptance names select, lookup and user,
and those three resolve.
- **L1.** `Skills-docs: carried by objectstack-ai#36419`. objectstack-ai#36419's step 1 still names
field `trackHistory: false` as the field's off switch. At this head it
is field `fieldHistory: false`, and the seat owns that card's text.

## Census: every reader of `enable.trackHistory` (seat rider)

None of these reads changes meaning, because `trackHistory` is
untouched:
- objectstack `packages/spec/src/data/api-derivation.ts` (`history`
verb, `=== true`).
- ui `RecordDetailView.tsx` (`historyEnabled`: `!== true` → no ledger
read); `appObjectScope.ts` (`recordStreamObjectNames`, `=== true`);
`ObjectSettingsPanel.tsx` (opt-in toggle; writes an explicit boolean; a
`fieldHistory` toggle is PR 2).
- `plugin-approvals` `approval-service.ts` (type only); cli `explain.ts`
(doc example); metadata-core `object-schema-fls-references.ts` (key
list).
- Not readers: database-loader's `trackHistory` is an unrelated loader
option; driver-sql `builtin-column-collision` is a name map; hotcrm has
comments only.
- UI producers of the field key: `FieldDesigner.tsx` writes
`trackHistory: data.trackHistory === true` on create and edit (so every
save writes an explicit `false`), and `ObjectFieldInspector.tsx` reads
`!!def.trackHistory`. Since this head that `false` reads like absent, so
it no longer changes behaviour. PR 2 moves both producers to
`fieldHistory`.

## Tests

- `audit-writers.test.ts`, new describe `[objectstack-ai#36290] a changed field shows
old → new unless the object or the field turns it off`: absent → on;
`enable.fieldHistory: false` → label only; `enable.trackHistory: false`
alone → still on (the upgrade note); field `fieldHistory: false` → label
only; field `trackHistory: false` (what the designer wrote) → values
still show; object `enable.fieldHistory: false` wins over field
`fieldHistory: true`; `json` with `fieldHistory: true` → on; credential
→ label only; `json` → only with `true`; a long value inserts at ≤ 500
with each code side capped at 1,000 and `…`; 30 changes fit with `; …`.
- `activity-field-redaction.test.ts`, `[objectstack-ai#36290]` code pins: a system
reader gets the full code; a masked reader's code omits the masked
field; an unserved reader's code and recomposed summary omit the
unserved field; the control reader gets it all; a non-`fieldChanges`
code is still not served; a reference change is kept only under the
title rule. These fail if the per-change narrowing is removed (each
asserts the absent field is absent from summary, code and old/new).
- `spec/src/data/object.test.ts`: a parsed `enable` block carries no
`fieldHistory` key, and `false` survives parse.
- Fixtures that pin the label-only frame now say so (field
`fieldHistory: false` or `enable.fieldHistory: false`):
`audit-milestone-summary`, `audit-lookup-summary`, `audit-writers`
(amount, campaign, person_qualification),
`activity-lookup-name-field-label-34055`,
`activity-summary-reader-locale.integration`.

## Verification

Head `aa362ba1`: a merge of main after objectstack-ai#36449 (objectstack-ai#36425 `showOnCreate`)
landed. Against main, the PR's diff changes in two places only: the
metadata-protocol `field` count (85 → 86) and the generated liveness
count (`field` 115). Re-run at `aa362ba1`: metadata-protocol pin 18,
driver-sql closure 11, metadata-core FLS 63, platform-objects
translations 610, spec `src/data` 6713, plugin-audit writers + redaction
181, `check:generated`, checklist and i18n-bundle checks all pass.
Before that, `d531553a` was `c43a42bb` plus one changeset line naming
`@objectstack/driver-sql` at patch (L1 7080045587); the figures below
were measured at `c43a42bb`, and this commit changes no source. Round 2
(`6e416547` the field key, `17772933` the metadata-protocol count,
`c43a42bb` the two key closures) on top of round 1 (`851997e6`).

- plugin-audit full suite: 109 files / 1809 tests passed (round 2).
- spec `src/data` 187 files / 6708 passed; platform-objects translations
610 passed; metadata-core full suite 27 files / 1048 passed; driver-sql
`builtin-column-collision` 2 files / 18 passed; metadata-protocol
`meta-types-degenerate-derivation` 18 passed; lint
`validate-security-posture` + `rule-explanations` 232 passed; cli
`data-model-rules` 65 passed; service-messaging and metadata-core
`builtin-column-storage-attributes` 18 passed.
- Ablations at round 2 (each restored, `git diff HEAD` empty after):
removing the field `fieldHistory === false` check of
`changeValuesShownFor` reds 4 tests in `audit-writers.test.ts`; making
field `trackHistory: false` an off switch again reds the
`designer_saved` pin; removing the driver-sql `fieldHistory` row reds
`classifies EVERY FieldSchema key, and invents none`. Round 1's
ablations (per-change narrowing 9 of 40, `enable.fieldHistory` branch 8
of 139) still hold.
- `dispatch-gates --commands` at round 2: 128 commands, every one exit
0; `dispatch-gates --ran`: 128 derived, 128 run, 0 NOT-MEASURED. This
sweep does not derive the driver-sql and metadata-core key closures;
CI's Test Core 3/10 and 10/10 found them at `17772933`, fixed in
`c43a42bb`.
- Full dogfood battery at `c43a42bb`, after rebuilding driver-sql and
metadata-core under the verify lock (build VERDICT command-exit 0):
`vitest run` lock VERDICT command-exit 0, Test Files 484 passed / 3
skipped (487), Tests 4107 passed / 68 skipped (4175), no failures. The
same battery at `6e416547` + `17772933` gave the same counts.
- CI at `c43a42bb`: 70 check-runs completed, 60 success and 10 skipped,
none failed (Test Core 10/10, Test UI 16/16, Type Check UI and
workspace, every Lint lane, Build Core, Build Docs, Live E2E UI, Check
Changeset, PR-body guards, Spec property liveness).
- `overlap-check` at `aa362ba1`: clean against `origin/main`. objectstack-ai#36449 has
landed and is merged in. objectstack-ai#36392 now conflicts only in the generated
`liveness/state-counts/field.md`.

Two-minute check: `pnpm --filter @objectstack/plugin-audit exec vitest
run src/audit-writers.test.ts src/activity-field-redaction.test.ts -t
36290`.

Read first, by risk:
1. `packages/plugins/plugin-audit/src/activity-field-redaction.ts`: the
per-change narrowing of `summary_message` and the recomposed summary.
2. `packages/plugins/plugin-audit/src/audit-writers.ts`:
`changeValuesShownFor` and `fitStoredChangeSummary`.
3. `packages/plugins/plugin-audit/src/audit-plugin.ts`: the middleware
order.

---

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

https://claude.ai/code/session_01QsR2jRCdMrPNTumXfsr1mw

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

---------

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

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

Fixes objectstack-ai#36151

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

## 维护者速读

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

## What changes

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

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

Mechanism:

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

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

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

## Tests

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

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

Pins updated where they pinned the reversed behaviour:

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

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

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

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

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

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

</details>

## Acceptance notes

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

## Verification

Read first (by risk):

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

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

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

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

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

---

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

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

---------

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

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

Fixes objectstack-ai#36270

repo:objectstack#7 · zhuangjianguo · session_01QsR2jSHfkSrXZxbdWoQxnW

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

## 维护者速读

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

## What changes

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

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

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

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

## Tests

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

## Acceptance notes

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

## Verification

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

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

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

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

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

Runs at 2bd0242:

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

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

Runs at 67fe455:

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

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

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

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

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

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

</details>

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

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

</details>

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

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

https://claude.ai/code/session_01QsR2jSHfkSrXZxbdWoQxnW

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…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 protocol:data protocol:system protocol:ui size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Form line-item table: people, multi-select, tags, check and rating columns get their own cell editors instead of a plain text box

2 participants