Skip to content

fix(ui): rich-text cell docs, the read-only data-table warning and the onBatchSave refusal describe the select-first model - #38097

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-4we53e
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-4we53e

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

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).
Readings at c6bf4f6 (base origin/main 815e882)
  • 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.

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

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (Not touched.)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L9qibxEbSk19qJRPHrm3v9


Generated by Claude Code

…edy; test leftovers

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T02:46Z

L1-a: ACCEPT at c6bf4f66e0aed4440d6c97ac1f442d6c2a744e1b

  • No contract review is owed. reviewFace finds no face on the file list: ui/packages/types/src/zod/* is not the published spec face. The changeset's Clause-②: no is right, because the accepted set is unchanged (onBatchSave is refused exactly as before; only the sentence moves). handlerKeyRefusal's new optional retirement argument is not public: it is reachable from neither src/index.ts nor the ./zod entry (zod/index.zod.ts), so it widens nothing published.
  • The dead conjunct really is dead. editingCell is set non-null only in startEdit, which returns unless editable. editable = editableProp && autosaves, and autosaves needs selectFirst. So every selectFirst && removed on the edit path was always true where it was read, and Tab and Ctrl/Cmd+Enter behave as before.
  • The new onBatchSave remedy is guarded: a runtime-slot key passed a retirement remedy throws at declaration. The ledger test pins that the node-type remedy is absent for that key and byte-identical for every other key, and that a key with its own remedy must be a retired site.
  • The diagnostic now names GridCellSelectionProvider, the mountable component, not the context value type. The README and the FieldEditWidget comment now describe the one editing model.
  • l1-face changeset flag: benign. The plugin-form and plugin-grid files are test files (affordanceGrantMap-12082.test.tsx, inlineEditPermissionGate.test.tsx), and neither ships. Part of #37521 is right: PR 2 (the CHANGELOG lines) follows.
  • SQL push-down: not applicable.
  • CI at this head: 45 success, the rest expected skips, 0 failed.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Landing · 2026-11-28T02:57Z · zone o3-ux (seat card thread)
Head-sha: c6bf4f66e0aed4440d6c97ac1f442d6c2a744e1b

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 28, 2026 02:57
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit 079edad Nov 28, 2026
59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-4we53e branch November 28, 2026 03:19
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