Repository navigation
feat(grid): read-only cells say so in the grid, a cell save is said in one live region, a touch never edits in place (#35689 slice A) - #36332
Conversation
…n one live region, a touch never edits through the edit button (#35689) Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m Co-Authored-By: Claude <noreply@anthropic.com>
…ed rows for inline edit (#35689) Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m Co-Authored-By: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds Final head (area f7-list, 2026-11-22T07:33Z): |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract-review-claim: session_01QsR2jTeURPvEm465RcoYEC · head 2c776b4 · 2026-11-22T07:37Z |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Inputs read: card #35689 body and all six comments (triage 7025512457, seat 4 claim 7073322916, os-dev-report 7075348874, handover 7075542258, seat 7 claim 7075957369); PR #36332 body, its 16-file list and the net diff against merge-base ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 REWORK · head 席位核对
要改的一项
修完推新 head、CI 全绿后再报一次,我在新 head 上只核 delta。 |
… on a lock answer (#35689) Claude-Session: https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds Co-authored-by: Claude <noreply@anthropic.com>
…grid package (#35689) Claude-Session: https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds Co-authored-by: Claude <noreply@anthropic.com>
…line-edit-a11y The approval-lock hook moved to one read per page (#36295); the re-render on an answer is re-applied on its new shape. Claude-Session: https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds Final head after the REWORK round (area f7-list, 2026-11-22T10:12Z): |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Delta review over the PASS record 7076070602 at ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 REWORK(增量)· head 维护者速读
要改的(1 项)
席位核对(增量,只核
|
…the provider value's identity matters (#35689) Claude-Session: https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 ACCEPT(增量)· head 维护者速读
席位核对(增量,只核
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds Final head after the delta REWORK (area f7-list, 2026-11-22T11:26Z): |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Delta review over the PASS record 7077725274 at ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Landing (seat 7, 2026-11-22T11:31Z): head |
…aft, like the View settings eye (objectstack-ai#36380) Part of objectstack-ai#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 objectstack-ai#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` (objectstack-ai#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. <details><summary>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)</summary> - 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. </details> ## 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, objectstack-ai#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](https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds)_ <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… and group subtotals and the footer total follow a cell save (objectstack-ai#35689 slice B) (objectstack-ai#36476) Fixes objectstack-ai#35689 — slice B (groups and totals after a save). Slice A (touch, accessibility, checked rows) landed earlier on its own PR, so nothing else on the card is left. Clause-②: no Metadata-protocol: none ## 维护者速读 - 列表页按阶段分组时,把一条的阶段从甲改成乙:停在这一行时它不动,点到别的行后它出现在乙组,两组的条数和金额小计都对;改金额后分组小计和表尾合计马上更新。 - 列表行内编辑重做专题的最后一块(分组与合计随保存更新),这张卡至此做完。 - 出错时最坏是分组小计或表尾合计显示旧数字、或这一行要刷新后才换组,保存的数据本身不受影响;可以直接撤回。 - 无 ## What changes Measured first on `origin/main` 285ad8d, in a list that selects a cell first (the list page's grid), with the card-named pins below run against the unchanged source: | Card item | Server grouping | Browser grouping | Premise | |:---|:---|:---|:---| | A row whose stage changed moves to its new group after the user leaves the row | did not move | did not move | holds: broken | | Group counts and amount subtotals after the save | not refreshed | not refreshed | holds: broken | | Footer total, flat grid whose rows are the whole set | not refreshed | n/a | holds: broken | | Footer total, grid paged on the server (whole-set figure) | already re-read after a write | n/a | false: works on main, pinned only | Why: a select-first save redraws only its own row (the row patches of objectstack-ai#35685) and the list lets its own write go by on the bus, so nothing is read again. The groups, the group headers' numbers and the footer's row figures read the rows as loaded, not as saved. The whole-set footer listens to the bus itself, so it already re-asked. What this PR does, all in `@object-ui/plugin-grid`: - **The figures read the saved rows.** `rowsAsSaved` (in `objectGridRowPatch.ts`) gives the rows with each saved row in place of the one read, while that read is the one held. The footer reads it, so a flat grid's total includes the saved value at once. A grid that groups the rows it was handed buckets it, so its counts and subtotals follow the save. - **A row whose save changed a grouping field is held in its group until the row is left.** `writeRowInPlace` notes such a record in `heldInGroup`. The browser bucketing reads that record as it was loaded (it stays in its group, counted and summed there). `onCellSelect` on a cell of another row lets it go: the browser bucketing then moves it, and a server-grouped grid reads its group headers and open groups' rows again (`regroupNonce`). A cell of the same row does not let it go. Any later save on a held row waits with it. - **Any other save in a server-grouped grid re-asks only the headers** (`savedFigureNonce`), so subtotals update at once and no row is read again. `objectGridGrouping.ts` now keys the header query on that nonce and the row pages on `regroupNonce` alone. - A grid without the select-first model still reads everything again after each save, as before (control pin). Docs: `content/docs/frontend/plugins/plugin-grid.mdx` gains one bullet under the per-cell save section. Changeset: `@object-ui/plugin-grid` patch. ## Tests One new top-level describe in the component's existing select-first save harness, `ObjectGrid.autosave-35685.test.tsx`: "ObjectGrid — groups, subtotals and the footer total after a cell save (objectstack#35689)". It covers both grouping paths: the server, where the grid asks its own group headers and group pages, and the browser, where it buckets rows a host hands it. - Card line 「离开这一行后它出现在乙组,两个组的条数和金额小计正确」, on each path: a stage pasted from Prospect to Won keeps the row in Prospect, with both groups at their old figures. A click on another cell of the same row keeps it there too. A click on a cell of another row moves it to Won, and the groups read Prospect 1 · 100 and Won 2 · 80. - Card text 「分组小计…随保存更新」, on each path: an amount saved is in its group's subtotal at once. No row is read again. A server-grouped grid asks its headers exactly once more, and a browser-grouped one asks nothing. - Card line 「表尾合计在改了金额后更新」: in a flat grid whose rows are the set, the footer sum goes from 180 to 200. In a grid paged on the server, the whole-set footer is read again and reads 200 (this holds on main and is pinned only). - Control: without `cellSelection`, a write on the bus re-reads the grouped grid at once. Ablations: one run per leg through `scripts/ablation-replace.mjs`. Every anchor hit x1 and went to x0, and every restore came back to the HEAD blob `f5aebf14` with `git diff HEAD` empty. The suites import the grid by relative path (source), so no dist leg was owed: | Leg | Mutation | Red | |:---|:---|:---| | A1 | `onCellSelect` no longer lets a held row go | 2: the move pin on both paths | | A2 | no header re-ask on a save | 1: server subtotal | | A3 | the grouping reads the loaded rows | 2: browser move and browser subtotal | | A4 | the footer reads the loaded rows | 1: flat footer | | A5 | a held row is bucketed as saved | 1: browser hold before leaving | <details><summary>Readings (all through scripts/pm/os-verify-lock.sh)</summary> - On `origin/main` 285ad8d before any source edit, the new describe gave 5 failed and 2 passed (the paged footer and the control). The failures: Won expected Bolt and Cord, got Cord only (both paths); the subtotal stayed 2 · 150 (both paths); the footer stayed Sum: 180. - At e96aa67 (after merging origin/main with objectstack-ai#36332 and objectstack-ai#36396): `pnpm turbo run build --concurrency=2 --filter='@object-ui/plugin-grid^...' --filter='@objectstack/client-react...'`: 54 successful. Then `pnpm --filter @object-ui/plugin-grid run type-check` (script echoed): exit 0. Then `pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-grid/`: Test Files 304 passed (304), Tests 2706 passed (2706). And `pnpm --dir ui exec vitest run --maxWorkers=2 scripts/`: Test Files 172 passed, 2 skipped; Tests 5127 passed, 2 skipped; exit 0. - At 1285fe4 (the final head; it only moves the new describe above the state-machine block, so it does not collide with an open PR's append at the end of the file): the harness gave Test Files 1 passed (1), Tests 29 passed (29), VERDICT command-exit 0. `pnpm check:nul-bytes` exit 0. </details> <details><summary>Gates</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` at e96aa67 derived 72 families (6 paths vs merge base d8628ac). All ran with exit 0. Three needed a second attempt: `check:skill-examples` first exited 3 because client-react had no dist (built, then exit 0); `check:type-check-debt` first exited 3 because the lock was busy (run under the lock, exit 0, 0 raw tsc errors); the ui `scripts/` suite first got no turn on the lock (exit 99), and its reading is above. - `--ran`: 72 derived, 72 run, 0 NOT-MEASURED, 0 UNRUN, with every exit code recorded. - `node scripts/pm/overlap-check.mjs` at 1285fe4: VERDICT clean exit 0, against origin/main 7ae5e07 and 4 open heads (objectstack-ai#36453, objectstack-ai#36438, objectstack-ai#36357, objectstack-ai#36316). </details> ## Acceptance notes - "Leaving the row" means selecting a cell of another row (a click, the arrow keys, Tab across the row's end). Escape, or a click outside the grid, keeps the row selected, so it stays in its group until another row is selected or the list loads again. - When a server-grouped grid regroups on leaving a row, it reads the open groups' rows again, so a group pager turned past page 1 starts over at page 1, as on any refresh. - A held record stays noted after a later full load. The next time a row is left, the groups are read one extra time. That read is harmless. ## Verification Files to read first, by risk: 1. `ui/packages/plugin-grid/src/ObjectGrid.tsx`: `noteSavedPlace`, `leaveHeldRows`, and the `savedData` and `groupedData` memos. 2. `ui/packages/plugin-grid/src/objectGridGrouping.ts`: the header and row reload keys. 3. `ui/packages/plugin-grid/src/objectGridRowPatch.ts`: `rowsAsSaved`. Two-minute check: `pnpm --dir ui exec vitest run packages/plugin-grid/src/__tests__/ObjectGrid.autosave-35685.test.tsx`. Expect 29 passed, including the seven under "(objectstack#35689)". --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…, 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>
Requested by Leehom · project thread
Part of #35689 — slice A (touch, accessibility, checked rows). Slice B (a row moving to its new group, group subtotals and the footer total refreshing after a save) stays on the card for its own PR.
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
Measured on
origin/mainbefore any edit (the dispatch's six mechanism assumptions):isTouchPress, from 行内编辑:去掉开关,始终可改;单击选中、双击或回车编辑;只读格说明原因 #35684): holds, pinned. One gap measured: a lookup cell's edit button (the pencil) is drawn atopacity-0once any pointer enters the cell and is still hit-testable, so a tap on the right edge of an unselected lookup cell landed on the invisible button and opened the editor in place. Fixed inCellEditButton: a finger entering an unselected cell does not draw the button, and a touch click on one drawn earlier for a mouse does nothing (the row ignores a click on a button). The press is read by its own click only, then cleared, so a later click with no pointer of its own (assistive tech) edits as before. The explicit edit entry on touch is the record page (a tap beside the button opens it), per the card's 「通过记录页或显式的编辑入口」.aria-readonly. Absent. Now, only when the table isrole="grid", a data cell that opens no editor carriesaria-readonly="true", and so does the type-catcher input that holds focus in the selected cell (the element a screen reader lands on). Every cell reads the table's own facts (editable, the column,isRowEditable); the selected cell adds the host's (describeCell). The host's answer is asked as the cell becomes selected and kept in state (selectedHostReadOnly), asked again only when the selected row is re-read or the host hands the table a newGridCellSelectionvalue, so it is not asked per render for a host whose value is stable.describeCell's TSDoc now says exactly that: asked when the reader acts on a cell, once as a cell becomes selected, and again when its row is re-read or the provider's value is a new object; the value's identity is part of the contract, so a host keeps it stable (memoised) or the selected cell is asked on every render.ObjectGrid), the host value is now memoised on what its cell facts read (fields, object, permissions, the view'seditable, the update verdicts, the approval locks, the page's record ids, the language), so it is new only when an answer can have changed; the commit question and the chip opener read the latest render through a ref.useRowApprovalLocksre-renders its host when a lock read answers (and when the answers are dropped on an invalidation):isLockedand the hook's value are new exactly then. So a lock answered after the select-time ask is said on the selected cell at once, without the reader moving, both ways (locked by the service, or a pendingapproval_statusthe service says is not locked).role="status"span mounted with its state, its words only inaria-label, plusrole="alert"on failure. A region that mounts with its content is often not announced, and a label is not live content. Now one persistent visually hiddenaria-live="polite"region per table that saves per cell (autosaves), drawn for the table's whole life; a successful save writes "Saved: COLUMN" into it (new keytable.cellSavedAnnouncement, all eleven packs), each saying in a node of its own so the same words twice are said twice. Cells saved together are joined with the pack's list punctuation (validation.formInvalidJoiner, the key the form's field lists use:、in ja and zh), and a column with no header is never named by its key (the region then saystable.cellSaved, "Saved"). A failure stays with the existing cell alert, said once; the region drops the earlier "saved". The per-cell mark becomesrole="img"with its existing label: named, never live, so no duplicate announcement.placement="below"): measured, it already returns to the cell by Esc and by a pick (focusSelectionRef, 行内编辑的编辑框改成浮层,行高不变;选中长文本原地展开全文;逐字段类型的目标样子 #35688). Pinned, no source change.border-2 border-primary, WCAG 1.4.11, 3:1 needed): passes everywhere, no change. Token arithmetic (sRGB relative luminance) on the shipped themes:--primary211 100% 50% on--backgroundwhite): 3.97; on the hover row (muted/40) 3.74; on a checked row (primary/5) 3.73; on a checked hovered or active-record row (primary/10) 3.49; on full muted 3.40.@object-ui/componentsdefault theme: 17.84 light, 19.09 dark, at least 14.53 on any row state.commitCellValuestages one cell and never readsselectedRowIds;selectionResetKeymoves only on bulk actions and refresh: holds, pinned.Review round (L1 7076074435, L2 7076070602)
describeCellasked per renderObjectGrid's value memoised so it is new only when its facts can change. TSDoc kept as is.1733276c,6bc85294useRowApprovalLocksre-renders on an answer; re-applied on main's batched lock read (#36295) in the merge1733276c,65b9199fpressedByRefnever reset1733276c', ', rawaccessorKeyvalidation.formInvalidJoiner; a header-less column is left unnamed1733276cdescribeCellTSDoc says when the table asks it and that the provider value's identity matters; the two data-table comments that echoed it aligned69919545Tests
New card-named describes, each in the component's existing harness file:
data-table-select-first-35684.test.tsx: a touch tap opens the record and a touch double-tap neither selects nor edits; a tap on an unselected lookup cell's edit button edits nothing (control: the mouse's click edits); after such a tap, a click with no pointer of its own edits; the selected read-only cell carriesaria-readonlyon the cell and its focus, an editable one none; the host's facts are asked as the cell is selected and not again across three re-renders, and a new host value is asked again and turnsaria-readonlyon where the selection is; a table that edits nothing marks every cell; control: outside the grid noaria-readonly.data-table-autosave-35685.test.tsx: the region is there and silent before any save, says "Saved: Name" after one, a second saying is a new node, saving is not said, and the table holds exactly one live element; cells saved together read已保存:Stage、Namein zh; a header-less column reads "Saved"; a refused save is said by the cell alert alone and the region empties; control: no region without per-cell save. With two rows checked, a cell edit sends one update of that one cell and both checks stay.data-table-keys-35687.test.tsx: a picker panel under the cell hands focus back to the cell on Esc and on a pick.ObjectGrid.cellSelection-35684.test.tsx: with the page's lock read held open, a row the service says is locked turnsaria-readonlyon once the read answers, and a row whoseapproval_statusstands in as locked turns it off once the service says it is not, both while the cell stays selected.Readings, all through
scripts/pm/os-verify-lock.sh. Head69919545changes only the TSDoc and two comments over65b9199f:At 6991954 (TSDoc round)
pnpm --workspace-concurrency=2 --filter '@object-ui/components^...' build, thenpnpm --filter @object-ui/components run type-check, then the three data-table harnesses andObjectGrid.cellSelection-35684: Test Files 4 passed (4); Tests 116 passed (116); VERDICT command-exit 0.dispatch-gates --commandsre-derived: the same 42 families as at 65b9199;pnpm check:nul-bytesexit 0. The other families were not re-run locally for a comment-only delta; CI runs them (below).Type-check, the touched harness files and the affected packages' suites at 65b9199
pnpm --workspace-concurrency=2 --filter '@object-ui/plugin-grid^...' build, thenpnpm --filter @object-ui/components run type-check,pnpm --filter @object-ui/plugin-grid run type-check,pnpm --filter @object-ui/i18n run type-check: VERDICT command-exit 0 (each script name echoed in the log).ObjectGrid.cellSelection-35684,ObjectGrid.autosave-35685,ObjectGrid.requiredPrompt-35956): Test Files 6 passed (6); Tests 154 passed (154).pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-grid/ packages/components/ packages/i18n/: Test Files 910 passed, 1 skipped (911); Tests 9532 passed, 37 skipped (9569); VERDICT command-exit 0.pnpm --dir ui exec vitest run --maxWorkers=2 scripts/(derived family): Test Files 172 passed, 2 skipped (174); Tests 5127 passed, 2 skipped (5129); exit 0.Ablations this round (one each, through `scripts/ablation-replace.mjs`: anchor hit once, blob changed, restored to the HEAD blob, `git diff HEAD` empty)
The suites read
data-table.tsxand the hook from source (the ui vitest config aliases@object-ui/componentstosrc; the grid test imports the hook relatively), so no rebuild per leg was owed.cellReadOnlycallingreadOnlyReasonOfon the selected cell): 1 red, "the host's facts are asked as the cell becomes selected, never per render" (expected 2 calls, got 5); the other aria pins stay green, as they should.ObjectGrid.cellSelection-35684.data-table.tsxblob b7a0e669 and the hook blob 271953e6, each equal to HEAD;git diff HEAD0 lines.Earlier readings (previous dev, heads e276bef and 2c776b4)
packages/components/ packages/i18n/Test Files 608 passed, 1 skipped;scripts/172 passed, 2 skipped files.aria-readonlyremoved, 2 red; the region's success saying removed, 2 red; the touch guard removed, 1 red.Acceptance notes
aria-readonlyon cells other than the selected one reads the table's own facts only (editable, the column,isRowEditable); the host's per-cell facts (describeCell: field read-only, permission, approval lock) are asked of the selected cell alone, because the table asksdescribeCellonly at the moments its TSDoc names, never for every cell. A screen reader moving cell to cell always lands on the selected cell, so the acceptance line holds; a reader browsing the table in its virtual mode hears the coarser answer on cells it does not select.aria-readonlyreads theapproval_statuscolumn (the hook's fail-open stand-in) and changes when the read answers; Enter or F2 in that window waits for the read (fix(approvals, list): a list cell waits for the record's approval lock before it edits, and a page's locks are read in one request (#35795) #36295) and says the reason.ObjectGridmemo is not pinned by a test of its own (its call count is internal to the host); the table-level pin holds the table to "never per render" for any host whose value is stable.cellSelection): there a click only selects, sosingleClickEditis never read, and the touch pins indata-table-select-first-35684.test.tsxalready run withsingleClickEdit: true.ObjectGridpassessingleClickEdit: schema.singleClickEdit ?? trueon main today; feat(spec,ui)!: every grid that renders editable selects a cell first, and object-grid singleClickEdit is retired #36357 (read at579f99ae) also editsObjectGrid.tsx(hostCellSelection = cellSelectionProp ?? inlineEditable,singleClickEdit: true) andObjectGrid.cellSelection-35684.test.tsx; it makes every grid that renders editable select-first, so this behaviour extends to them and no pin here flips;node scripts/pm/overlap-check.mjs --pr=36357on 6991954: merges cleanly, VERDICT clean. The one residual is a host passingcellSelection={false}explicitly (none in-tree). A grid on the older click-to-edit model (nocellSelection,singleClickEdittrue) still edits on a touch tap, as it did before this PR; that model is outside this slice.Verification
Read first (risk order):
ui/packages/plugin-grid/src/ObjectGrid.tsx, thegridCellSelectionmemo and its dependency list: a missing dependency would leave the selected cell'saria-readonlystale until the reader moves (act-time reads stay fresh either way).ui/packages/components/src/renderers/complex/data-table.tsx, theselectedHostReadOnlylayout effect and thecellReadOnlyline in the body-cell map.ui/packages/plugin-grid/src/hooks/useRowApprovalLocks.ts, theanswerSeqbump in the read'sfinallyand on the invalidation reset.Two-minute check:
pnpm --dir ui exec vitest run packages/plugin-grid/src/__tests__/ObjectGrid.cellSelection-35684.test.tsx, expect every test passing, among them the two in "the selected cell says a lock that answers after it was selected (objectstack#35689)".Local gates (targeted, derived from the diff) at 65b9199
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 42 families (19 paths vs merge base c448c61); all run, every one exit 0 (check:query-options-erasurere-run without the loop's 300 s cap after the first try hit it: exit 0, "ratchet holds").pnpm check:type-check-debt: exit 0, "0 raw tsc error(s) total".--ranreconciliation: 42 derived, 42 run, 0 NOT-MEASURED, 0 UNRUN, exit 0. ui i18n gates:check:i18n-keys,check:i18n-drift,check:i18n-dead-keysexit 0.pnpm check:nul-bytes: exit 0.node scripts/pm/overlap-check.mjsbefore each push: VERDICT clean (at 65b9199 after merging origin/main, which had conflicted on the lock hook and its test; at 6991954 against origin/main ff60149 and 10 open heads, and with--pr=36357).CI on 6991954: 45 success, 13 skipped, 0 failure (on 65b9199 before it: 47 success, 15 skipped), among them Lint and Repo Gates, TypeScript Type Check, Test Core, Governed Surface Queue Guard, Lint UI, Type Check UI, Test UI (16/16 shards), Build and E2E UI, Live E2E UI, Dogfood Regression Gate, Check Changeset, PR-body guards.
Generated by Claude Code