Skip to content

Commit f6347c8

Browse files
committed
docs(grid): scope the rich text cell panel wording to the select-first grid
The plugin-grid and fields READMEs, the plugin-grid docs page, the IN_CELL_PANEL_EDIT_WIDGETS jsdoc and the pending rich-text changeset's "Before" line now name the select-first grid (cellSelection) for the panel and its keys, and say what a grid without cellSelection does. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTqAcPU4VyEPH7iVn2
1 parent 4e55e4e commit f6347c8

6 files changed

Lines changed: 38 additions & 14 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

0 commit comments

Comments
 (0)