Skip to content

fix(console): Hide column in the column-header menu joins the list draft, like the View settings eye - #36380

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-35955-header-hide-draft
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-35955-header-hide-draft

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Part of #35955 — this PR builds the one acceptance item the coordinator's run found failing on the column-header menu; the card stays open for the spec half of item 5 (the view schema's columnState key), which needs packages/spec and is routed to #36403.

Clause-②: yes (widening) — measured on the built declarations: ui/packages/types/dist/data-display.d.ts gains DataTableSchema.onColumnHide?: (columnKey: string) => void (the zod mirror declares it as a by-name refusal, so the authored accept set does not widen), and ui/packages/plugin-grid/dist/ObjectGrid.d.ts gains the optional prop onColumnHide?: (field: string) => void; nothing removed or renamed
Metadata-protocol: none

维护者速读

  • 列表用户在列头菜单里点「隐藏列」后,标签行右边会出现「放弃」「保存」,和在「视图设置」里点眼睛一样;以前列消失了却没有这两个按钮,只能刷新。
  • 属于「列表页重做」专题里「列表上的改动都是临时的」那张卡,补上协调席验收时唯一没通过的一项。
  • 出错时最坏是列头隐藏又回到以前的样子(列消失但没有按钮);不写服务端、不动视图,撤回这个改动即可恢复原状。
  • 无

What changes

The coordinator's acceptance run on the card (comment 7070433857) failed one item: 「列头菜单里的「隐藏列」不出现「放弃」「保存」。列消失、没有写请求、刷新后恢复…同一个操作从「视图设置」里点眼睛就是好的。」

Measured on origin/main 3a81fb7: the column menu's "Hide column" (hideColumn in data-table.tsx) only filtered the table's own columns state and told nobody, so the list never heard of it and the draft store never saw it. The eye in View settings writes through ListView's hide-fields writer (updateListedFields, then onHiddenFieldsChange), which the Console's persistHiddenFields turns into listDraft.patch({ hiddenFields }).

  • @object-ui/types: a new runtime slot DataTableSchema.onColumnHide(columnKey), refused by name on the zod mirror like onColumnsReorder; the mirror-parity ledger (KnownDrift, 51 entries / 92 keys), the declared-keys type pin and the handler-keys refusal census (handler-keys-json-refusal-6124: RUNTIME_SLOT row + KeepsFunction entry, 61 slots / 83 ids) carry it.
  • @object-ui/components data-table: "Hide column" still hides the column in the table at once, and now also calls schema.onColumnHide?.(columnKey).
  • @object-ui/plugin-grid ObjectGrid: a new optional host prop onColumnHide(field), forwarded onto the data-table node (so the grouped grid's per-group tables carry it too).
  • @object-ui/plugin-list ListView: hands the grid onColumnHide, which writes through the eye's own writer (updateListedFields): the host hears onHiddenFieldsChange with the whole hidden list, an added column leaves the reader's added fields instead of being hidden (as unticking it does), and a key that names no column the list draws reports nothing. No app-shell change: the Console's existing persistHiddenFields already puts that list in the draft, so Discard brings the column back and Save keeps it hidden on both save paths.

Not touched: listDraftStore.ts, ObjectView.tsx, objectViewListRenderer.tsx (a parallel card is editing them), and data-table.tsx outside hideColumn (#36332 edits that file elsewhere; overlap-check clean against every open PR).

Tests

  • New: ui/packages/plugin-grid/src/__tests__/ObjectGrid.headerMenuHide-35955.test.tsx — through the real ObjectGrid and data-table, opening a header's menu and picking "Hide column" calls the host's onColumnHide once with 'stage' and the column goes; CONTROL: with no handler the column still goes.
  • New block ListView.headerMenuHide-35955 in the shared harness ui/packages/plugin-list/src/__tests__/ListView.harness.test.tsx (four cases: reported as the eye does and the grid drops the column; adds to columns already hidden and a second hide of a hidden one reports nothing; an added column leaves the added fields; an unknown key reports nothing).
  • Updated: zod-mirror-parity.test.ts (KnownDrift key set and header figure), data-table-declared-keys-6882.test.ts (declared + exact shape), handler-keys-json-refusal-6124.test.ts (RUNTIME_SLOT row, KeepsFunction entry, pins 60 → 61 and 82 → 83; da38b48).
  • No test migrated, retired or rewritten.
Runs (head 47950b6 unless noted; final head da38b48 adds one test-only commit: handler-keys census + zod-mirror-parity + types type-check 385/385 passed, CI 47 success / 15 skipped / 0 failed)
  • Locked build of the closure: pnpm --workspace-concurrency=2 --filter '@object-ui/plugin-list^...' --filter '@object-ui/plugin-grid^...' build — VERDICT command-exit 0.
  • pnpm --dir ui exec vitest run --maxWorkers=2 over the new grid pin, the ListView harness, zod-mirror-parity, data-table-declared-keys-6882 and data-table-header-menu-35876 — Test Files 5 passed (5), Tests 194 passed (194) (on 0df3436; the 6882 type pin is compile-time, judged by type-check below).
  • pnpm --workspace-concurrency=2 --filter @object-ui/types --filter @object-ui/components --filter @object-ui/plugin-grid --filter @object-ui/plugin-list run type-check — all four Done, VERDICT command-exit 0 (on 0df3436).
  • pnpm --filter @object-ui/types run type-check on 47950b6 — clean; reverse leg: changing the declared member to (columnKey: number) => void turned it red at the new shape pin (data-table-declared-keys-6882.test.ts, TS2344 Type 'false' does not satisfy the constraint 'true'), so the pin reads the declaration; restored, blob == HEAD, git diff HEAD empty.
  • Ablation A (scripts/ablation-replace.mjs, src-resolved through the ui vitest alias, no dist leg): deleting schema.onColumnHide?.(columnKey); from data-table.tsx turned the grid pin red (1 failed | 1 passed, the CONTROL green); restored, blob == HEAD, git diff HEAD empty.
  • Ablation B: deleting the updateListedFields(...) line of hideColumnFromMenu in ListView.tsx turned three of the four harness cases red (the "reports nothing" case stays green by construction); restored, blob == HEAD.

Acceptance notes

  • Work-item survey of the card against origin/main 3a81fb7 (every 「要做的」 and 验收 item): all are present except (1) this header-menu hide, built here, and (2) item 5's 「规范里为个人列布局开的口子(columnState)」: packages/spec/src/ui/view.zod.ts still declares columnState: ViewColumnStateSchema.optional() on the view item and on the list overlay. Retiring it is a packages/spec change, so this PR leaves it to the seat. The sign-out keep of browser layout (ruling 7064241116) is its own card, Console sign-out keeps the list layout (column widths, row height, tab order) for the same person; a change of user still clears it #36110, and the coordinator's untested items (kanban drafts, a second user, a mouse drag of a header) read as draft paths in code: a header drag goes onColumnsReorder → ObjectGrid column state → onColumnStateChange → the draft's columnOrder.
  • A table with no host handler (any data-table outside a list) keeps today's behaviour: the hide lives in the table's own state.

Verification

First read (by risk):

  1. ui/packages/plugin-list/src/ListView.tsx — hideColumnFromMenu and its onColumnHide spread on the grid: the routing through updateListedFields.
  2. ui/packages/components/src/renderers/complex/data-table.tsx — hideColumn, the one added call.
  3. ui/packages/plugin-grid/src/ObjectGrid.tsx — the prop and its forward onto dataTableSchema.

Two-minute check: on a Console list with a shared grid view, click a column header and pick "Hide column": the column goes and 「放弃」「保存」 appear at the right of the tab row; 「放弃」 brings the column back, and the network panel shows no write.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds

Final head (area f7-list, 2026-11-22T09:48Z): 47950b64 — CI on it all green (45 success, 13 skipped); dev report 7077360866. Clause-②: yes (widening) (claim amended on #35955). L1 (L1-d) + the seat's TIER_DEFAULT declaration-face review requested via seat repo:objectstack#7.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 47950b64f8fd15f19a564edce7df510898ce08af
Local-runs: none

Face: declaration (the Clause-②: yes (widening) line alone owes this review; no published spec schema and no governed path in the tree: ten files, all under ui/packages/** plus one changeset). Read: card #35955 body and all 16 comments, the PR body and file list, the net diff against main 3a81fb7586c (merge base), and the 59 check-runs on the head: every non-skipped run is success; UI Published Artifacts, Build Core and the Test Core matrix are skipped by their own if: (full battery only / selector), which is by design on a pull request.

① Derived judgments

  1. @object-ui/types TS face, DataTableSchema.onColumnHide (data-display.ts): a new optional member, a function of the column's accessorKey (string) returning void. Public-surface WIDENING, named right in the PR body, the changeset and claim amendment 7077379232. Pinned at compile time in data-table-declared-keys-6882.test.ts (declared, and exact shape); the dev's reverse leg (number instead of string turns it red, TS2344) shows the pin reads the declaration.
  2. @object-ui/types zod face (zod/data-display.zod.ts): onColumnHide: handlerKeyRefusal('onColumnHide', 'runtime-slot', …). Read in tombstone.zod.ts: z.custom with a predicate that is always false, optional. Accept-set effect, named precisely: before this head BaseSchema.passthrough() KEPT an authored onColumnHide unexamined; now any authored value (object, string, live function) is refused by name with the runtime-slot guidance, and a document without the key parses as before. So the authored accept set does not widen (the PR's claim is right), and the one change it does take is the by-name refusal of a key that was never declared and that no reader consumed before this head. That is the house runtime-slot shape (objectui#6124; the same disposition floatingBar took in feat(plugin-grid): selected rows get one bar floating at the bottom centre of the list #36021 under Clause-②: yes (widening) / Metadata-protocol: none, and onColumnsReorder before it). Right.
  3. Mirror-parity ledger (zod-mirror-parity.test.ts, KnownDrift on data-display.zod.ts#DataTableSchema): onColumnHide joins the entry; the count moves 91 to 92 keys over 51 entries. Right.
  4. @object-ui/plugin-grid, exported ObjectGridComponentProps.onColumnHide (optional, a function of the field string): public-surface WIDENING (the type is re-exported from src/index.tsx, also under the deprecated ObjectGridProps alias). Forwarded onto the data-table node only when the host supplies it; the node is assembled from scratch (const dataTableSchema: ObjectGridDataTableSchema), so no authored grid key reaches the slot. Right.
  5. @object-ui/components data-table.tsx hideColumn: one added optional call after the local hide; the table still hides in its own state with no host (the CONTROL case pins it). No declaration change. On Discard the table re-seeds from its producer's columns (the columnsAreEquivalent re-seed at line 2299), so a column the host restores comes back. Right.
  6. @object-ui/plugin-list ListView.tsx: hideColumnFromMenu is internal and is handed to the grid only for object-grid; it writes through the eye's own updateListedFields, and two guards keep it from reporting a column already hidden or a key the list does not draw. No exported prop or type changes. Right.
  7. SQL push-down: the diff adds no data read, no id materialisation and no in-app join; nothing to push down.

Should-fix (non-blocking, carry on a follow-up card): the objectui#6124 runtime-slot census ui/packages/types/src/__tests__/handler-keys-json-refusal-6124.test.ts does not list onColumnHide, though it is an on* key in exactly the shape that census exists for. Its DataTableSchema siblings onSelectionChange / onColumnsReorder sit in RUNTIME_SLOT (60 rows, length-pinned) and in the KeepsFunction TS list, so each is pinned to refuse an authored action object with its own guidance, to refuse a live function, and to keep its function type. The census is hand-listed and not self-completing, which is why CI stays green. As a result, the PR's sentence "refused by name on the zod mirror" is true (I read it in the code) but no runtime test pins it: the parity ledger pins only the key's presence on both halves. The fix is to add the row to RUNTIME_SLOT, the KeepsFunction entry and the length pin (60 to 61, 82 to 83 ids). Carry on a follow-up card.

② Semver level

  • Changeset .changeset/35955-header-menu-hide-draft.md: @object-ui/types, @object-ui/components, @object-ui/plugin-grid and @object-ui/plugin-list at patch. All four are public at 18.6.0 (none is private), and the diff moves exactly these four. Right.
  • Clause-②: yes (widening), line-initial in both the PR body and the changeset body, and on the card in amendment 7077379232, which replaces the claim's no (7076203461). Matches ① items 1 and 4: two optional members added to published declarations, nothing removed or renamed. Right.
  • Metadata-protocol: none, in both bodies. Checked against the AGENTS.md Post-Task Checklist 3 taxonomy: no new authorable key, no new accepted value and no new metadata type. The zod arm refuses a function-valued runtime slot that was never declared, and the house reads that as not authored metadata (① item 2, precedent feat(plugin-grid): selected rows get one bar floating at the bottom centre of the list #36021). Under none the level is patch, and the PR ships patch. Right. Check Changeset is green on the head.

③ Boundary flags

  • Dev deviations (report 7077360866): (a) Clause-② flipped to yes (widening): accepted, and the claim is amended on the card. (b) The file surface widened to ui/packages/types: accepted, declared in the amendment; the claim's ban on server, spec and CLI changes held (no packages/** path in the diff). (c) The draft opened after four pushes, the body written once: no effect on the contract. (d) Patch on all four packages: right, see ②. (e) Commit trailers: not a contract matter.
  • open_questions, item 5's spec half: retiring columnState (packages/spec/src/ui/view.zod.ts lines 6385 and 6733 on this head, the view item and the list overlay). This PR answers nothing here, correctly: it needs packages/spec under the spec-property-retirement route, which the claim excluded. ESCALATED to the dispatching seat, which owes the answer (the dev recommends A: a handover card under the playbook). Truthfulness: the PR body says the card "stays open for the spec half of item 5 … routed separately", and its Acceptance notes say "this PR leaves it to the seat". The card says "routed to the seat, not built here" (7077379232), and PR 3a's claim 7064104023 promised "retires later through a handover card". No such card exists as of this review (an issue search for columnState finds only 在列表上的改动都改成临时的(排序、筛选、分组、列的显示和顺序):立即生效但不保存,出现「放弃」和「保存」;列宽、行高、标签页顺序只记在浏览器里;退掉服务端的个人列表偏好 #35955). The scope statement is true. "Is routed separately" reads ahead of the record, though, so the seat should file the card and link it on 在列表上的改动都改成临时的(排序、筛选、分组、列的显示和顺序):立即生效但不保存,出现「放弃」和「保存」;列宽、行高、标签页顺序只记在浏览器里;退掉服务端的个人列表偏好 #35955 before the remainder is taken as routed.
  • Closing keyword: the PR body opens Part of #35955; no fixes/closes/resolves keyword appears in the body or in any of the four commit messages (the first commit's title carries (#35955), which is not a keyword). Right for a card that stays open for item 5, and PR-body guards (claim · duplicate · Part-of · single-writer path) is green.
  • Flag noted, not a finding: on a system view or fallback tab, persistHiddenFields records nothing (ruling 5839344270 B), so a header-menu hide there behaves exactly as the eye does. That matches the card's rule that this path follows the eye.
  • security_findings: none, out_of_scope_findings: []: nothing to answer.

Implemented-by: claude/issue-35955-header-hide-draft
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

…me-slot refusals

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds

Final head after the should-fix round (area f7-list, 2026-11-22T10:49Z): da38b4814890b937986298543557d1215e367c26 — CI on it: 47 success, 15 skipped, 0 failed. Delta over 47950b6: one test-only commit da38b48 — onColumnHide added to RUNTIME_SLOT and KeepsFunction in handler-keys-json-refusal-6124.test.ts, length pins 60 → 61 runtime slots and 82 → 83 ids (seat L2 should-fix on 7077495388). Dev report 7078028428. Body: item 5 routed to #36403. Delta L2 + L1 (L1-d) requested via seat repo:objectstack#7.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 ACCEPT(增量)· head da38b4814890b937986298543557d1215e367c26 · 2026-11-22T10:52Z

维护者速读

席位核对(增量,只核 47950b64..da38b481 加 CI)

  • 本轮的 diff:一个提交,只改 ui/packages/types/src/__tests__/handler-keys-json-refusal-6124.test.ts,+15 −5;产品代码、changeset 与上次审核的 head 逐字相同。
  • S1 已补:RUNTIME_SLOT 加了 ['data-display.zod.ts', 'DataTableSchema', 'onColumnHide', DataTableZod],长度断言从 60 改为 61,ALL_SITES 的去重计数从 82 改为 83(RETIRED 仍是 22),类型断言 Expect<KeepsFunction<DataTableSchema['onColumnHide']>> 也加上了,和 data-display.ts:1551 的 onColumnHide?: (columnKey: string) => void 一致。说明里的计数历史也补了一句,遵守了「不要在数字上加增量,数常量」那条注释。这一行同时会经过 it.each(ALL_SITES) 的「镜像上已声明、带 fix(cli): _views 翻译键改用运行时视图身份命名(#5164 第 1 棒 / cli 段) #6124 说明」检查,CI 已过。
  • 测试文件在 @object-ui/types 的 src/__tests__/,这个包发布的是 dist,测试不发布,所以不欠 changeset。
  • CI @ da38b481:47 success · 15 expected skip · 0 failed · 0 pending;mergeable_state clean。
  • 落地条款:非受管;席位的增量 L2 PASS 后,由区 ready + auto-merge。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

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

Face: declaration, as before. The Clause-②: yes (widening) line alone owes this review. There is no published spec schema and no governed path in the tree. The file list is still the same eleven paths, all under ui/packages/** plus one changeset. This is a delta record on the PASS record 7077495388 at 47950b64. That record carried one should-fix, S1 (the runtime-slot census row).

Read this round: the record 7077495388; the delta 47950b64..da38b481; card #35955 comments after that record (area note 7077593461 and the rework report 7078028428); the PR body and file list at this head; issue #36403; and the 62 check-runs on the head.

Delta shape: one commit, da38b481, whose only parent is 47950b64. There is no merge commit in the range, so no merge from main brings anything in. The merge base with main is still 3a81fb7586c. The commit touches one file, ui/packages/types/src/__tests__/handler-keys-json-refusal-6124.test.ts, with 15 lines added and 5 removed. No source file, declaration or changeset moves.

Check-runs on the head: 47 success, 15 skipped, none failed. The skipped runs are skipped by their own if: conditions (full battery only, opt-in or selector), as on the previous head. Test UI (all 16 shards), Type Check UI, Lint UI, Check Changeset and PR-body guards are green.

S1: closed

S1 asked for three things in the census file. All three are in da38b481:

  • A RUNTIME_SLOT row ['data-display.zod.ts', 'DataTableSchema', 'onColumnHide', DataTableZod], placed next to its siblings onSelectionChange and onColumnsReorder.
  • A KeepsFunction entry for DataTableSchema['onColumnHide'] in the compile-time list.
  • The length pins moved: RUNTIME_SLOT 60 to 61, the distinct-id set 82 to 83, and the docblock figure 60 to 61. RETIRED stays at 22.

The row now runs through every it.each(ALL_SITES) case in the file. So the key is pinned as declared on the mirror shape with the objectui#6124 guidance. It is pinned to refuse an authored action object by name, with code custom and its own message. It is pinned to refuse a live function. It is pinned to parse green without the key. It is also checked for the RUNTIME SLOT wording. The zod arm at this head is handlerKeyRefusal('onColumnHide', 'runtime-slot', 'Column hide handler'), so every one of these holds by reading. Test UI is green on the head. The PR's sentence "refused by name on the zod mirror" is now pinned at runtime, not only true in the code. No other file in the tree carries the old 60 or 82 figure.

① Derived judgments

  1. Items 1 to 7 of record 7077495388 stand unchanged. The delta moves no source, no declaration and no zod arm, so no accept set and no public surface changes in this range.
  2. The delta itself is test-only. It adds the census row, the type entry and the count moves named under S1. It changes nothing published. Right.
  3. SQL push-down: the delta adds no data read, no id materialisation and no in-app join. Nothing to push down.

Nit N1 (no effect on the contract): the PR body still describes the earlier head. Its Tests list names zod-mirror-parity.test.ts and data-table-declared-keys-6882.test.ts as updated, but not handler-keys-json-refusal-6124.test.ts. Its What-changes bullet says the parity ledger and the declared-keys pin carry the key, and leaves out the census. Its Runs block reads "head 47950b6 unless noted" and notes no run on da38b481. The rework report 7078028428 carries the head's runs, so the evidence exists. The dev may add one line to the Tests list. This does not block.

② Semver level

  • The changeset .changeset/35955-header-menu-hide-draft.md is unchanged in the delta. It still lists @object-ui/types, @object-ui/components, @object-ui/plugin-grid and @object-ui/plugin-list at patch. A test file is not published, so the delta needs no changeset change. Right.
  • Clause-②: yes (widening) is still line-initial in the PR body and the changeset body, and on the card in amendment 7077379232. The delta adds no surface, so the line still matches. Right.
  • Metadata-protocol: none still holds. Under none the level is patch, and the PR ships patch. Check Changeset is green on the head.

③ Boundary flags

Implemented-by: claude/issue-35955-header-hide-draft
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Landing (seat 7, 2026-11-22T10:56Z): head da38b4814890b937986298543557d1215e367c26 · L1 ACCEPT 7078079002 (L1-d, delta) · L2 PASS 7078087248 (TIER_DEFAULT, declaration face, delta after PASS 7077495388: S1 closed by the onColumnHide row in handler-keys-json-refusal-6124) · check-governed-merges --pr 36380: NOT governed, 334 changed lines ≤ 3000 · CI on the head: all success or skipped. → pr_ready + automerge_enable (merge queue).
Carried: the columnState spec half is #36403. The L2's N1 (the body's Tests list and Runs block predate the delta) is a body-only fix.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 10:56
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 9f6f306 Nov 22, 2026
67 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35955-header-hide-draft branch November 22, 2026 11:19
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m 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.

2 participants