Skip to content

Commit 17dbea4

Browse files
docs(grid): scope the rich text cell panel wording to the select-first grid (objectstack-ai#36414)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbGyo1s5XDjcEx7u8WDqbFTx)_ Fixes objectstack-ai#36360 Part of objectstack-ai#35155 (item 3 only, the two "(empty)" doc comments; items 1-2 stay on that card) Clause-②: no Metadata-protocol: none ## 维护者速读 - 读文档的开发者:说明从"富文本单元格都在格子下方面板里编辑"改为分开写清"选中优先表格"与普通表格两种行为;用户界面无感。 - 属于列表单元格编辑富文本那项工作的收尾,替照着文档挂载普通表格的人纠正误导。 - 只改文字与注释,出错只是说明不准,可直接撤回。 - 要你做什么:无。 ## What changes Text only, no code or behaviour change. Each text that described the rich-text cell panel now names the select-first grid (`cellSelection`) for the panel and its keys, and says in one sentence what a grid without `cellSelection` does: - `ui/packages/plugin-grid/README.md` (ships in the npm tarball): panel sentence scoped; adds the non-select-first sentence. - `ui/packages/fields/README.md` (ships): same. - `content/docs/frontend/plugins/plugin-grid.mdx`: panel sentence scoped (its keys sentence already was); adds the non-select-first sentence. - `ui/packages/fields/src/FieldEditWidget.tsx`: jsdoc on `IN_CELL_PANEL_EDIT_WIDGETS` only. - `.changeset/36023-rich-text-cell-panel.md` (pending, not yet consumed by a release): the "Before" line now says the "This field can't be edited in a list" notice was the select-first grid's. - `.changeset/36360-rich-text-panel-wording.md`: new patch note for the two published READMEs. - Second commit (rider, objectstack-ai#35155 item 3): `GroupRowProps.label` in `ui/packages/plugin-grid/src/GroupRow.tsx` and the doc comment in `ui/packages/plugin-grid/src/temporalCellFace.ts` now say an empty group key is labelled with the grid's `grid.empty` string ("Empty" in English, `useGroupedData.ts` `emptyLabel = t('grid.empty')`), not "(empty)". Comments only. **DELIBERATE CORRECTION** of the pending note `.changeset/36023-rich-text-cell-panel.md` (Check Changeset's foreign-changeset rule stays red by design). Corrected sentence: "Before, these cells opened no editor; on a select-first grid the cell said "This field can't be edited in a list"." Reason: the notice comes from `cellSelection.describeCell`, which only a select-first grid has (`factsOf` in `data-table.tsx`). Every clause was measured in `ui/packages/components/src/renderers/complex/data-table.tsx` at the base: - panel placement: `editsBelow = isEditing && selectFirst && editorBelow`, else `placement: 'cover'` (over the cell); - one click opens: the non-select-first `onClick` calls `startEdit` under `singleClickEdit`, which `ObjectGrid` defaults to `true`; - Ctrl/Cmd+Enter in the injected TEXTAREA commits only under `selectFirst && (ctrlKey || metaKey)`; - Esc: `exitEdit(true)` on both hosts; - click outside: the document `pointerdown` listener calls `saveEdit(true)`, which stages; without `autosaves` (`selectFirst && onRowSave`) the staged value waits for the save bar (`hasPendingChanges && !autosaves`). ## Tests No tested behaviour changed, so no tests and no ablation. ## Acceptance notes - The select-first panel sentence says "a click outside saves"; measured, an immediate save needs `autosaves` (`selectFirst` plus `onRowSave`); a select-first grid wired with `onBatchSave` alone keeps the save bar. Not changed here (outside the card's wording); noted only. ## Verification Two-minute check: `git diff origin/main...HEAD -- ui/packages/plugin-grid/README.md` shows the panel bullet now opening "on a select-first grid (`cellSelection`)" and a second sentence for a grid without it. Files to read first: `ui/packages/plugin-grid/README.md` (published), `.changeset/36023-rich-text-cell-panel.md` (the corrected pending note). <details><summary>Local gates at 83d66cf</summary> - `dispatch-gates --commands` derived 66 commands; 59 exit 0. - `check-empty-changeset --base origin/main` exit 1: the expected DELIBERATE CORRECTION refusal above. - NOT MEASURED, reason PREREQUISITE NOT MET (unbuilt workspace `dist/`, shared verify lock contended): `check:doc-formula-expressions` (3), `check:doc-security-posture` (3), spec `check:docs` (1), spec `check:skill-examples` (3), `check:docs-transcript-drift` (3), `pnpm --dir ui exec vitest run scripts/` (all 56 failures import the unbuilt `@objectstack/spec` dist). CI builds and runs them. - `overlap-check`: VERDICT clean exit 0 (objectstack-ai#36357, objectstack-ai#36316 merge cleanly). - `check-nul-bytes`: OK. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jTqAcPU4VyEPH7iVn2 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8466fca commit 17dbea4

8 files changed

Lines changed: 45 additions & 17 deletions

File tree

‎.changeset/36023-rich-text-cell-panel.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ feat(grid): a markdown, HTML or rich text cell opens a text box in a panel under
88
Clause-②: yes (widening)
99
Metadata-protocol: none
1010

11-
**The list grid edits the rich-content field types in place** (objectstack#36023). On a select-first grid, selecting a `markdown`, `html` or `richtext` cell and pressing Enter, F2, typing or double-clicking opens the record form's own text box over the stored source in a panel under the cell, at least as wide as the column; the cell keeps showing its value and the row keeps its height. Enter in the panel is a new line; on a select-first grid Ctrl/Cmd+Enter saves and keeps the cell selected, Esc discards, and a click outside saves. Backspace or Delete on the selected cell of a select-first grid clears it as for any other editable cell. On a grid without the select-first cell model (an `ObjectGrid` or `object-grid` mounted without `cellSelection`), one click opens the text box over the cell, not in a panel under it: Enter is a new line, Ctrl/Cmd+Enter does nothing, Esc discards, and a click outside keeps the text as a pending change for the grid's save buttons. Before, these cells opened no editor and said "This field can't be edited in a list". The related tab on the record page draws the same grid and behaves the same way.
11+
**The list grid edits the rich-content field types in place** (objectstack#36023). On a select-first grid, selecting a `markdown`, `html` or `richtext` cell and pressing Enter, F2, typing or double-clicking opens the record form's own text box over the stored source in a panel under the cell, at least as wide as the column; the cell keeps showing its value and the row keeps its height. Enter in the panel is a new line; on a select-first grid Ctrl/Cmd+Enter saves and keeps the cell selected, Esc discards, and a click outside saves. Backspace or Delete on the selected cell of a select-first grid clears it as for any other editable cell. On a grid without the select-first cell model (an `ObjectGrid` or `object-grid` mounted without `cellSelection`), one click opens the text box over the cell, not in a panel under it: Enter is a new line, Ctrl/Cmd+Enter does nothing, Esc discards, and a click outside keeps the text as a pending change for the grid's save buttons. Before, these cells opened no editor; on a select-first grid the cell said "This field can't be edited in a list". The related tab on the record page draws the same grid and behaves the same way.
1212

1313
**Only the grid's cell changes.** The three types stay in `INLINE_EXCLUDED_FIELD_TYPES`, and `hasFieldEditWidget` and `isInlineExcludedFieldType` answer as before, so the record page's field editor, the required-fields dialogs, the kanban and timesheet editors keep them out. `@object-ui/fields` exports `hasInCellPanelEditWidget(type)`, true for the three types, and `FieldEditWidget` draws their editor only when the host asks for the cell face (`inCell`); the editor loads lazily. `html` is edited as text; what the cell then draws goes through the sanitizing HTML renderer, as on every other read surface.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@object-ui/fields': patch
3+
'@object-ui/plugin-grid': patch
4+
---
5+
6+
docs(grid): the rich text cell panel is described for the select-first grid only
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
The READMEs of `@object-ui/plugin-grid` and `@object-ui/fields` now say that the panel under the cell, with Ctrl/Cmd+Enter and a click outside saving, is the select-first grid's (`cellSelection`). A grid without `cellSelection` opens the text box over the cell, where Ctrl/Cmd+Enter does nothing, Esc discards and a click outside keeps the text as a pending change for the grid's save buttons. Text only; no behaviour changes.

‎content/docs/frontend/plugins/plugin-grid.mdx‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,14 @@ through the host's data source (`dataSource.update`) with no callback to wire.
365365
definition**, not by a column key — a field marked `readonly`, and
366366
computed/binary field types (formula, autonumber, file, …), never open an
367367
editor. There is no `editable` key on `ListColumn`.
368-
- **Rich text edits in a panel** (objectstack#36023): a `markdown`, `html` or
369-
`richtext` cell opens the record form's text box over the stored source in a
370-
panel under the cell, at least as wide as the column, while the cell keeps
371-
showing its value. Enter there is a new line; on a select-first grid
372-
Ctrl/Cmd+Enter saves, Esc discards and a click outside saves.
368+
- **Rich text edits in a panel** (objectstack#36023): on a select-first grid
369+
(`cellSelection`), a `markdown`, `html` or `richtext` cell opens the record
370+
form's text box over the stored source in a panel under the cell, at least as
371+
wide as the column, while the cell keeps showing its value. Enter there is a
372+
new line, Ctrl/Cmd+Enter saves, Esc discards and a click outside saves. A grid
373+
without `cellSelection` opens the text box over the cell on one click: Enter
374+
is a new line, Ctrl/Cmd+Enter does nothing, Esc discards and a click outside
375+
keeps the text as a pending change for the grid's save buttons.
373376
- **Visual feedback**: editable cells show a hover state, and the input is
374377
focused and selected when editing begins
375378
- **The editor floats over its cell** (objectstack#35688): it opens on a layer

‎ui/packages/fields/README.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,11 @@ they stay in `INLINE_EXCLUDED_FIELD_TYPES` and `hasFieldEditWidget` answers
142142
`false` for them, so every other host keeps them out, while
143143
`hasInCellPanelEditWidget(type)` answers `true` and `FieldEditWidget` draws the
144144
form's rich-text box for them (loaded lazily) when the host asks for the cell
145-
face. The list grid opens it in a panel under the cell, where Enter is a new
146-
line.
145+
face. A select-first list grid (`cellSelection`) opens it in a panel under the
146+
cell, where Enter is a new line, Ctrl/Cmd+Enter saves, Esc discards and a click
147+
outside saves; a grid without `cellSelection` opens it over the cell, where
148+
Ctrl/Cmd+Enter does nothing and a click outside keeps the text as a pending
149+
change for the grid's save buttons.
147150

148151
### Resolving declared action params
149152

‎ui/packages/fields/src/FieldEditWidget.tsx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,11 @@ export const INLINE_EXCLUDED_FIELD_TYPES = new Set<string>([
211211
* Members of {@link INLINE_EXCLUDED_FIELD_TYPES} that the LIST GRID's cell
212212
* nevertheless edits, in a panel opened under the cell (objectstack#36023):
213213
* the rich-content types, whose panel is the form's own text box over the
214-
* stored source. Enter in it is a new line; the grid saves on Ctrl/Cmd+Enter
215-
* or a click outside and discards on Esc.
214+
* stored source. Enter in it is a new line; a select-first grid
215+
* (`cellSelection`) saves on Ctrl/Cmd+Enter or a click outside and discards on
216+
* Esc. A grid without `cellSelection` opens the box over the cell instead, where
217+
* Ctrl/Cmd+Enter does nothing, Esc discards and a click outside keeps the text
218+
* as a pending change for the grid's save buttons.
216219
*
217220
* Only a host that asks for the cell face (`inCell`) gets them, so the record
218221
* page's field editor, the required-fields dialogs and every other host of

‎ui/packages/plugin-grid/README.md‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -996,10 +996,14 @@ the host's data source (`dataSource.update`) with no callback to wire.
996996
(formula, autonumber, file, …), never open an editor
997997
(`isFieldInlineEditable` in `src/inline-edit-options.ts`). There is no
998998
`editable` key on `ListColumn`.
999-
- **Rich text edits in a panel**: a `markdown`, `html` or `richtext` cell opens
1000-
the record form's text box in a panel under the cell (Enter is a new line,
1001-
Ctrl/Cmd+Enter saves, Escape discards, a click outside saves); the cell keeps
1002-
showing its value and the row its height.
999+
- **Rich text edits in a panel**: on a select-first grid (`cellSelection`), a
1000+
`markdown`, `html` or `richtext` cell opens the record form's text box in a
1001+
panel under the cell (Enter is a new line, Ctrl/Cmd+Enter saves, Escape
1002+
discards, a click outside saves); the cell keeps showing its value and the row
1003+
its height. A grid without `cellSelection` opens the text box over the cell on
1004+
one click, where Enter is a new line, Ctrl/Cmd+Enter does nothing, Escape
1005+
discards and a click outside keeps the text as a pending change for the save
1006+
buttons.
10031007
- **Visual feedback**: editable cells show a hover state
10041008
- **Automatic focus**: the input is focused and selected when editing begins
10051009

‎ui/packages/plugin-grid/src/GroupRow.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ import type { AggregationResult } from './useGroupedData';
1414
export interface GroupRowProps {
1515
/** Unique key identifying this group */
1616
groupKey: string;
17-
/** Display label for the group (field value or "(empty)") */
17+
/**
18+
* Display label for the group: the field value, or for an empty key the
19+
* grid's empty-value string `grid.empty` ("Empty" in English).
20+
*/
1821
label: string;
1922
/**
2023
* The group's size. On a server-grouped grid this is the header query's

‎ui/packages/plugin-grid/src/temporalCellFace.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ export function temporalExtreme(values: Iterable<unknown>, type: 'min' | 'max'):
7878
* [objectui#13234] A stored `date` / `datetime` value, drawn as the grid's
7979
* cell draws the same value. `undefined` for a value the cell has no face for
8080
* (empty or unparsable), so the caller keeps its own text: a group band keeps
81-
* the group's own label ("(empty)" for an empty key, the stored text
82-
* otherwise), and an aggregate is left out.
81+
* the group's own label (the grid's empty-value string `grid.empty`, "Empty"
82+
* in English, for an empty key; the stored text otherwise), and an aggregate is
83+
* left out.
8384
*
8485
* The formatting CALLS are the cells' own, with the cells' arguments:
8586
* `DateCellRenderer` in a grid column (`inGridColumn`, objectstack#25884)

0 commit comments

Comments
 (0)