Repository navigation
Commit 5dbcc02
feat(ui): retire the grid's staged edit model with its host interface (#37437)
Fixes #35827
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — `skills/**` never taught the grid's host props
(`cellSelection`, `onBatchSave`, `singleClickEdit`, "Save All" have zero
hits there); none of them is authorable metadata.
## 维护者速读
- 用户能看到什么变化:所有可编辑表格只剩一种编辑方式,单击选中单元格、双击或回车进入编辑、提交即保存;“全部保存”栏和行内保存按钮全部消失。
- 为什么做:两套编辑模式并存,旧的暂存模式只剩一个宿主属性在用,按你的裁决让旧模式和它的接口一起退役。
- 出错会怎样:自己画表格的 React
宿主若还写着旧属性,升级后类型检查直接报错;没有保存通道的裸表格只读显示并在控制台警告一次,可整版回退。
- 要你做什么:本 PR 约 4000 行改动,超过三千行,需要你本人落地。
## What changes
Ruling A on the card ("the old mode and its interface retire together"):
- **`@object-ui/plugin-grid`**: the `cellSelection={false}` arm of
`ObjectGrid`, `onBatchSave` and the default batch save are removed.
`cellSelection` accepts only `true` (ask for select-first on a read-only
grid). The default cell save (`defaultRowSave`) keeps only the
select-first path: rule check, claim-answer warnings, `If-Match` write,
conflict dialog, Undo toast. The record verdicts are now asked on first
cell selection only (the mount-time ask served the staged arm).
- **`@object-ui/components`**: `data-table` loses the staged arm
(pending-changes bar, Save All / Cancel All, the row save/cancel column,
click-to-edit, the amber tints) and its fallback copy rows. Ruling term
(2), bare-primitive arm: **loud refusal**. An editable `data-table`
edits only inside a `GridCellSelection` host that also passes
`onRowSave`; otherwise it renders read-only and logs one `[ObjectUI]
DataTable editable:` console warning naming what is missing. Writing
through a data source the table does not own was rejected because the
primitive has no `objectName` or record identity of its own.
- **`@object-ui/types`**: `DataTableSchema.onBatchSave` is `?: never` on
the TS face and a `retired` handler-key refusal on the zod mirror;
`DataTableSchema.singleClickEdit` is removed (it only chose how the
staged editor opened). Parity ledgers updated (KnownDrift 92 to 91,
RuntimeOnlyDeclared 31 to 30). The `keyboardNavigation` describe drops
its staged sentence.
- **`@object-ui/app-shell`**: `ResourceListPage` stops passing
`cellSelection={false}`. It is read-only, so it keeps click-to-open
(assumption A1, measured: its 14 test files pass, and a read-only grid
never mounts the select-first provider).
- Docs: `content/docs/frontend/plugins/plugin-grid.mdx` and the
plugin-grid README describe the one editing model and the `onRowSave`
hand-off.
- Changeset `.changeset/35827-data-table-staged-edit-retired.md` with
both declaration lines, the BREAKING banner and the FROM/TO table.
- **`@objectstack/spec`**: the ADR-0087 D3 entry
`data-table-staged-edit-retired`
(`packages/spec/src/migrations/entries/semantic/19.data-table-staged-edit-retired.ts`).
Protocol 19 opened on main while this was in flight, so the entry is a
step-19 file; step 19's rationale is one hand-written string, so
`registry.ts.template` is untouched. No conversion: nothing it retires
is authorable metadata.
Outside-host census (ruling premise clause): public clones of `hotcrm`
and `gallery` at their default-branch heads have zero hits for
`cellSelection={false}` and `onBatchSave`. No named outside host, no
fork.
## Tests
Staged-path pins either migrated to the select-first gestures (click,
then double-click, Enter, F2 or typing; reading the per-cell save) or
were deleted together with the behaviour they pinned, each deletion
leaving a comment that names the pin covering the same ground. Deleted
files: `data-table-batch-per-row-12292`,
`data-table-refusal-cells-27520`,
`ObjectGrid.inlineEditPendingKeyedByRecord-12310`. New helpers in
`components/src/__tests__/test-utils.tsx`: `renderSelectFirstTable` and
`openCellEditor`.
<details><summary>Readings</summary>
- `@object-ui/components`: 4958 passed
- `@object-ui/plugin-grid`: 2774 passed
- `@object-ui/types`: 10512 passed
- plugin-list, plugin-view, i18n, plugin-form, data-objectstack
onMutation: 7654 passed, 0 failed
- app-shell `ResourceListPage*`: 14 files, 105 passed
- type-check: types, components, plugin-grid, plugin-list, app-shell
clean
- eslint on the touched files: no errors
- dispatch gates, first round: 70 of 73 green;
`check-adr-0087-registration` was red until the entry landed and is
green now; `@objectstack/spec check:skill-examples` refused (exit 3)
because `@objectstack/client-react` was not built in this container, and
nothing under `skills/**` or that package is touched
- the 41 gates the spec file adds: 39 green;
`check-plugin-teardown-shape --self-test` refused for a shallow clone
and `check:dual-build-cjs-loads` for an unbuilt `knowledge-turso`, both
outside this change
- spec migration tests (`src/migrations`) green
- dogfood battery on `deefadb3`: 487 files, 4129 passed, 68 skipped, 0
failed
- CI Test Core 5/10 on `deefadb3`: one CLI integration file timed out in
its 480 s setup hook; the same file passes locally on the same head (54
of 54), so its failed job was re-run once
</details>
## Acceptance notes
- **`packages/spec` fence.** The claim's Amendment 1 admits the one
semantic entry file, and the maintainer approved it by name; it is the
only `packages/spec` path this diff touches. `'@objectstack/spec':
minor` is in the changeset with it.
- **Size.** About 4000 changed lines (1216 added, 2787 removed), above
the 3000-line line, so this lands by the maintainer.
- **Dead locale keys.** The locale packs still carry `table.saveAll`,
`table.cancelAll`, `table.modified`, `table.saveRow`,
`table.cancelChanges`; nothing reads them now. Left for a follow-up so
this diff stays off the locale files.
- **Fenced, now stale.** `ui/packages/fields/README.md` (around lines
145 to 147) and `FieldEditWidget.tsx` (around lines 216 to 217) still
describe a grid without `cellSelection`. `ui/packages/fields/**` is
outside this claim.
- **Unused option.** `useRecordCrudVerdicts`' `updateOnMount` option has
no caller left; removing it is a small follow-up.
## Verification
Files to read first, by risk:
1. `ui/packages/plugin-grid/src/ObjectGrid.tsx`: `defaultRowSave` (the
only save path now) and the `hostCellSelection` derivation.
2. `ui/packages/components/src/renderers/complex/data-table.tsx`: the
`selectFirst && onRowSave` edit gate and the read-only fallback.
3. `ui/packages/types/src/zod/data-display.zod.ts`: the `onBatchSave`
retired refusal.
Two-minute check: `pnpm --dir ui exec vitest run
packages/components/src/__tests__/data-table-autosave-35685.test.tsx`
passes, and its "no staged fallback" describe shows an editable table
with no host rendering read-only with exactly one warning line.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CZProAps4gBPhsLSVt)_
<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6CZProAps4gBPhsLSVt -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent c349576 commit 5dbcc02
69 files changed
Lines changed: 1253 additions & 2787 deletions
File tree
- .changeset
- content/docs/frontend/plugins
- packages/spec/src/migrations/entries/semantic
- ui/packages
- app-shell/src/views/metadata-admin
- components/src
- __tests__
- context
- renderers/complex
- __tests__
- data-objectstack/src
- plugin-grid
- src
- __tests__
- plugin-list/src
- types/src
- __tests__
- zod
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
| 215 | + | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
415 | | - | |
| 414 | + | |
416 | 415 | | |
417 | 416 | | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
424 | 420 | | |
425 | 421 | | |
426 | 422 | | |
| |||
449 | 445 | | |
450 | 446 | | |
451 | 447 | | |
452 | | - | |
453 | | - | |
454 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
455 | 452 | | |
456 | 453 | | |
457 | 454 | | |
| |||
612 | 609 | | |
613 | 610 | | |
614 | 611 | | |
615 | | - | |
616 | | - | |
617 | | - | |
| 612 | + | |
| 613 | + | |
618 | 614 | | |
619 | 615 | | |
620 | 616 | | |
621 | 617 | | |
622 | | - | |
| 618 | + | |
623 | 619 | | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
| 620 | + | |
| 621 | + | |
631 | 622 | | |
632 | 623 | | |
633 | 624 | | |
| |||
636 | 627 | | |
637 | 628 | | |
638 | 629 | | |
639 | | - | |
640 | 630 | | |
641 | 631 | | |
642 | 632 | | |
| |||
653 | 643 | | |
654 | 644 | | |
655 | 645 | | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
660 | 651 | | |
661 | 652 | | |
662 | 653 | | |
663 | 654 | | |
664 | | - | |
| 655 | + | |
665 | 656 | | |
666 | 657 | | |
667 | 658 | | |
668 | 659 | | |
669 | 660 | | |
670 | 661 | | |
671 | 662 | | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | 663 | | |
678 | 664 | | |
679 | 665 | | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
694 | 675 | | |
695 | 676 | | |
696 | 677 | | |
697 | | - | |
698 | | - | |
| 678 | + | |
699 | 679 | | |
700 | 680 | | |
701 | 681 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1521 | 1521 | | |
1522 | 1522 | | |
1523 | 1523 | | |
1524 | | - | |
1525 | 1524 | | |
1526 | 1525 | | |
1527 | 1526 | | |
| |||
0 commit comments