Repository navigation
Commit 079edad
fix(ui): rich-text cell docs, the read-only data-table warning and the onBatchSave refusal describe the select-first model (#38097)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoPm5yqPvuwrjEV9JhFTrVJj)_
Part of #37521
repo:objectstack#3 · os-tesla · session_01L9qibxEbSk19qJRPHrm3v9
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 表格只剩「先选中、每格提交即保存」一种编辑方式。fields 包随包发布的 README 和注释、`data-table`
只读警告、`onBatchSave` 的拒收文字,现在都按这一种方式说话。
- 读包文档或看控制台警告的宿主开发者不会再被指向已经没有的保存按钮,也不会被叫去挂一个挂不上的类型名。
- 只改文字,并删掉表格里恒为真的判断;哪些写法被拒、键盘怎么用都不变。
- 无。卡的另一半(5 个已发布 CHANGELOG 里的两行)按座位裁定在本 PR 合入后单开纯文档 PR。
## What changes
- **`@object-ui/fields` README, "The grid cell editor's face"** and the
`IN_CELL_PANEL_EDIT_WIDGETS` docblock in `FieldEditWidget.tsx`: the
sentence "a grid without `cellSelection` opens it over the cell, where
Ctrl/Cmd+Enter does nothing and a click outside keeps the text as a
pending change for the grid's save buttons" is gone. They now say the
grid edits only in its select-first model and opens the rich-text box in
the panel under the cell.
- **The over-the-cell branch is unreachable, and its residue in
`data-table.tsx` is retired.** `editable` is `editableProp &&
selectFirst && onRowSave`, and `startEdit` returns at once when the
table is not `editable`, so no editor ever opens outside the
select-first model. Removed as always-true or always-false: the
`selectFirst` conjunct in `editsBelow`; in the host-injected editor's
key handler, the `selectFirst &&` guards on Ctrl/Cmd+Enter in a
textarea, on Tab, and on `commitMoves`; `focusSelectionRef.current =
selectFirst` in the injected editor's `commit` and Escape paths (now
`true`); `!selectFirst ||` in the injected-editor caret effect. The
comment describing Tab "outside the select-first model" is replaced by
the invariant. The non-edit `selectFirst` branches (selection, the
read-only table's arrow navigation, `onRowClick`'s pointer cursor) are
live and untouched, and `CellOverlay`'s `cover` placement stays (plain
editors use it).
- **N3.** `describeUnsavableEditable` (`dataTableBindDiagnostic.ts`)
named `GridCellSelection`, the context's value type, as the thing to
mount. It now names `GridCellSelectionProvider` in both places, and in
its docblock.
- **N4.** `handlerKeyRefusal` (`tombstone.zod.ts`, internal to
`@object-ui/types`, not exported) takes an optional fourth argument: a
`'retired'` key's own remedy, which replaces the node-type remedy.
Omitted, the message is byte-for-byte unchanged. Passed for a
`'runtime-slot'` key, it throws at declaration.
`DataTableSchema.onBatchSave` passes "`onBatchSave` → `onRowSave` on
`object-grid`…", ending "Delete the key." The key is refused exactly as
before (`custom` at its own path, a live function too).
- **N5.** Removed: the two queries of the deleted
`data-table-edit-column-header` test id (autosave and select-first
harnesses; both tests keep their live assertions, and the autosave test
name drops "no edit column"); `inlineEditPermissionGate.test.tsx` case e
and its `headerCellCount` helper; `defaultBatchSave` from the
`affordanceGrantMap-12082` comment.
- One `patch` changeset for `@object-ui/fields`,
`@object-ui/components`, `@object-ui/types`.
## Why
#35827 retired the staged editing model. Shipped text (the fields README
is in the package's `files[]`) still described it, and the warning told
hosts to mount a type. Contract record 7189751333 on PR #37437 named all
of it.
## Verification
Tests added or tightened, each ablated on the committed fix (put back,
run, restored from `HEAD`, tree clean):
- `data-table-autosave-35685.test.tsx` "without the provider: …": the
warning names `` `GridCellSelectionProvider` `` twice and never ``
`GridCellSelection` ``. Ablation (both names back): `1 failed | 23
passed (24)`.
- `handler-keys-json-refusal-6124.test.ts`: the per-site guidance test
now takes an `OWN_RETIREMENT_REMEDY` table (`onBatchSave` → its FROM →
TO, `GridCellSelectionProvider`, "Delete the key.", and no
`action:button`); a new top-level describe pins the helper itself
(default text byte-exact, the remedy replaces only the remedy sentence,
a runtime slot refuses one, every own-remedy key is a retired ledger
site). Ablations: `onBatchSave` back to the generic call, `1 failed |
343 passed (344)`; the helper ignoring the argument, `2 failed | 342
passed (344)`.
- `data-table-select-first-35684.test.tsx`, new describe "an injected
editor keeps the model's keys": a host-injected textarea editor commits
on Tab and moves right, keeps Enter as a new line and commits on
Ctrl/Cmd+Enter with the cell still selected. These hold the two arms
whose `selectFirst &&` guard was removed. Ablations: Tab arm removed, `1
failed | 38 passed (39)`; the textarea Ctrl/Cmd+Enter arm removed, `1
failed | 38 passed (39)`.
- Case e's replacement: "sends one update with that cell only, draws no
save bar, no row Save button and no amber row" in
`data-table-autosave-35685.test.tsx` and "no edit-only column, ever" in
`data-table-select-first-35684.test.tsx` pin at the table itself that an
editable table draws no save column; case e compared three header counts
that can no longer differ.
- No table without a select-first host edits: already pinned by "no
staged fallback" in `data-table-autosave-35685.test.tsx` (no editor
opens, no save bar, one warning).
<details><summary>Readings at c6bf4f6 (base origin/main
815e882)</summary>
- Six touched test files: `Test Files 6 passed (6)`, `Tests 499 passed
(499)`.
- `vitest run packages/components/ packages/types/ packages/fields/
packages/plugin-grid/ packages/plugin-form/` after an `OS_SKIP_DTS=1`
build: `1796 passed | 6 failed | 2 skipped`. The six are spec-parity
tests that read `packages/spec/dist/*.d.mts`, which that build does not
write ("no module symbol for …/spec/dist/system/index.d.mts"). After a
dts build of `@object-ui/plugin-grid^...` and
`@object-ui/plugin-form^...`, those six: `Test Files 6 passed (6)`,
`Tests 145 passed (145)`.
- `type-check` exit 0 for `@object-ui/types`, `components`, `fields`,
`plugin-grid`, `plugin-form`.
- `eslint` on the ten changed `.ts`/`.tsx` files: 0 errors (warnings
pre-existing).
- `check:doc-authoring` exit 0; `check:new-line-citations` 0 new;
`check-changeset-claims`, `check-changeset-no-major`,
`check-adr-0087-registration`, `check-changeset-fixed` exit 0.
- `dispatch-gates --tier --repo objectstack-ai/objectstack` on the
surface: no path-derived tier mandate; no governed path.
</details>
## Acceptance notes
- The `.changeset/pre/35827-…` file and the five published CHANGELOG
entries (spec, app-shell, components, plugin-grid, types) still say
`mount GridCellSelection` / `inside a GridCellSelection host`. Seat
ruling: a dedicated docs-only PR after this one merges, which then
`Fixes #37521`.
- Seen and left, outside the claimed surface: the
`renderSelectFirstTable` docblock in
`ui/packages/components/src/__tests__/test-utils.tsx` says "a
select-first host (`GridCellSelection`)", naming the model, not the
thing to mount.
- The test harness `handler-keys-json-refusal-6124.test.ts` is the
shared harness for `handlerKeyRefusal`; its per-site guidance assertion
had to learn the own-remedy case, which is why it is in the diff.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (Not touched.)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L9qibxEbSk19qJRPHrm3v9
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibxEbSk19qJRPHrm3v9)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 77edd2a commit 079edad
12 files changed
Lines changed: 157 additions & 76 deletions
File tree
- .changeset
- ui/packages
- components/src
- __tests__
- renderers/complex
- fields
- src
- plugin-form/src
- plugin-grid/src/__tests__
- types/src
- __tests__
- zod
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | 130 | | |
132 | 131 | | |
133 | 132 | | |
| |||
291 | 290 | | |
292 | 291 | | |
293 | 292 | | |
294 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
295 | 297 | | |
296 | 298 | | |
297 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
340 | 339 | | |
341 | 340 | | |
342 | 341 | | |
343 | 342 | | |
344 | 343 | | |
345 | 344 | | |
346 | 345 | | |
347 | | - | |
348 | 346 | | |
349 | 347 | | |
350 | 348 | | |
351 | 349 | | |
352 | | - | |
353 | 350 | | |
354 | 351 | | |
355 | 352 | | |
| |||
627 | 624 | | |
628 | 625 | | |
629 | 626 | | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4069 | 4069 | | |
4070 | 4070 | | |
4071 | 4071 | | |
4072 | | - | |
| 4072 | + | |
4073 | 4073 | | |
4074 | 4074 | | |
4075 | 4075 | | |
| |||
4083 | 4083 | | |
4084 | 4084 | | |
4085 | 4085 | | |
4086 | | - | |
| 4086 | + | |
4087 | 4087 | | |
4088 | 4088 | | |
4089 | 4089 | | |
| |||
5080 | 5080 | | |
5081 | 5081 | | |
5082 | 5082 | | |
5083 | | - | |
| 5083 | + | |
5084 | 5084 | | |
5085 | 5085 | | |
5086 | 5086 | | |
| |||
5394 | 5394 | | |
5395 | 5395 | | |
5396 | 5396 | | |
5397 | | - | |
| 5397 | + | |
5398 | 5398 | | |
5399 | 5399 | | |
5400 | 5400 | | |
| |||
5417 | 5417 | | |
5418 | 5418 | | |
5419 | 5419 | | |
5420 | | - | |
5421 | | - | |
5422 | | - | |
5423 | | - | |
5424 | | - | |
5425 | | - | |
5426 | | - | |
5427 | | - | |
5428 | | - | |
5429 | | - | |
5430 | | - | |
| 5420 | + | |
| 5421 | + | |
| 5422 | + | |
| 5423 | + | |
5431 | 5424 | | |
5432 | 5425 | | |
5433 | 5426 | | |
| |||
5439 | 5432 | | |
5440 | 5433 | | |
5441 | 5434 | | |
5442 | | - | |
| 5435 | + | |
5443 | 5436 | | |
5444 | | - | |
5445 | | - | |
| 5437 | + | |
| 5438 | + | |
5446 | 5439 | | |
5447 | 5440 | | |
5448 | 5441 | | |
5449 | 5442 | | |
5450 | 5443 | | |
5451 | | - | |
| 5444 | + | |
5452 | 5445 | | |
5453 | 5446 | | |
5454 | | - | |
| 5447 | + | |
5455 | 5448 | | |
5456 | 5449 | | |
5457 | 5450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
| 302 | + | |
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
| 317 | + | |
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
| 324 | + | |
325 | 325 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
175 | 174 | | |
176 | 175 | | |
177 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
220 | 218 | | |
221 | 219 | | |
222 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
904 | 904 | | |
905 | 905 | | |
906 | 906 | | |
907 | | - | |
908 | | - | |
909 | | - | |
| 907 | + | |
| 908 | + | |
910 | 909 | | |
911 | 910 | | |
912 | 911 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | 204 | | |
213 | 205 | | |
214 | 206 | | |
| |||
248 | 240 | | |
249 | 241 | | |
250 | 242 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | 243 | | |
268 | 244 | | |
269 | 245 | | |
| |||
0 commit comments