diff --git a/.changeset/36023-rich-text-cell-panel.md b/.changeset/36023-rich-text-cell-panel.md index fc4ae9d9d75..d6b7f930e72 100644 --- a/.changeset/36023-rich-text-cell-panel.md +++ b/.changeset/36023-rich-text-cell-panel.md @@ -8,6 +8,6 @@ feat(grid): a markdown, HTML or rich text cell opens a text box in a panel under Clause-②: yes (widening) Metadata-protocol: none -**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. +**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. **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. diff --git a/.changeset/36360-rich-text-panel-wording.md b/.changeset/36360-rich-text-panel-wording.md new file mode 100644 index 00000000000..bc99d34bb84 --- /dev/null +++ b/.changeset/36360-rich-text-panel-wording.md @@ -0,0 +1,11 @@ +--- +'@object-ui/fields': patch +'@object-ui/plugin-grid': patch +--- + +docs(grid): the rich text cell panel is described for the select-first grid only + +Clause-②: no +Metadata-protocol: none + +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. diff --git a/content/docs/frontend/plugins/plugin-grid.mdx b/content/docs/frontend/plugins/plugin-grid.mdx index d68092393d7..90d060c9782 100644 --- a/content/docs/frontend/plugins/plugin-grid.mdx +++ b/content/docs/frontend/plugins/plugin-grid.mdx @@ -365,11 +365,14 @@ through the host's data source (`dataSource.update`) with no callback to wire. definition**, not by a column key — a field marked `readonly`, and computed/binary field types (formula, autonumber, file, …), never open an editor. There is no `editable` key on `ListColumn`. -- **Rich text edits in a panel** (objectstack#36023): a `markdown`, `html` or - `richtext` cell opens the record form's text box over the stored source in a - panel under the cell, at least as wide as the column, while the cell keeps - showing its value. Enter there is a new line; on a select-first grid - Ctrl/Cmd+Enter saves, Esc discards and a click outside saves. +- **Rich text edits in a panel** (objectstack#36023): on a select-first grid + (`cellSelection`), a `markdown`, `html` or `richtext` cell opens the record + form's text box over the stored source in a panel under the cell, at least as + wide as the column, while the cell keeps showing its value. Enter there is a + new line, Ctrl/Cmd+Enter saves, Esc discards and a click outside saves. A grid + without `cellSelection` opens the text box over the cell on one click: 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. - **Visual feedback**: editable cells show a hover state, and the input is focused and selected when editing begins - **The editor floats over its cell** (objectstack#35688): it opens on a layer diff --git a/ui/packages/fields/README.md b/ui/packages/fields/README.md index 3f5121745ca..5c4ac4ff5da 100644 --- a/ui/packages/fields/README.md +++ b/ui/packages/fields/README.md @@ -142,8 +142,11 @@ they stay in `INLINE_EXCLUDED_FIELD_TYPES` and `hasFieldEditWidget` answers `false` for them, so every other host keeps them out, while `hasInCellPanelEditWidget(type)` answers `true` and `FieldEditWidget` draws the form's rich-text box for them (loaded lazily) when the host asks for the cell -face. The list grid opens it in a panel under the cell, where Enter is a new -line. +face. A select-first list grid (`cellSelection`) opens it in a panel under the +cell, where Enter is a new line, Ctrl/Cmd+Enter saves, Esc discards and a click +outside saves; 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. ### Resolving declared action params diff --git a/ui/packages/fields/src/FieldEditWidget.tsx b/ui/packages/fields/src/FieldEditWidget.tsx index b3449c56b8a..12f20f024e4 100644 --- a/ui/packages/fields/src/FieldEditWidget.tsx +++ b/ui/packages/fields/src/FieldEditWidget.tsx @@ -211,8 +211,11 @@ export const INLINE_EXCLUDED_FIELD_TYPES = new Set([ * Members of {@link INLINE_EXCLUDED_FIELD_TYPES} that the LIST GRID's cell * nevertheless edits, in a panel opened under the cell (objectstack#36023): * the rich-content types, whose panel is the form's own text box over the - * stored source. Enter in it is a new line; the grid saves on Ctrl/Cmd+Enter - * or a click outside and discards on Esc. + * stored source. Enter in it is a new line; a select-first grid + * (`cellSelection`) saves on Ctrl/Cmd+Enter or a click outside and discards on + * Esc. A grid without `cellSelection` opens the box over the cell instead, 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. * * Only a host that asks for the cell face (`inCell`) gets them, so the record * page's field editor, the required-fields dialogs and every other host of diff --git a/ui/packages/plugin-grid/README.md b/ui/packages/plugin-grid/README.md index 699c0f1dc76..c7342e80e1d 100644 --- a/ui/packages/plugin-grid/README.md +++ b/ui/packages/plugin-grid/README.md @@ -996,10 +996,14 @@ the host's data source (`dataSource.update`) with no callback to wire. (formula, autonumber, file, …), never open an editor (`isFieldInlineEditable` in `src/inline-edit-options.ts`). There is no `editable` key on `ListColumn`. -- **Rich text edits in a panel**: a `markdown`, `html` or `richtext` cell opens - the record form's text box in a panel under the cell (Enter is a new line, - Ctrl/Cmd+Enter saves, Escape discards, a click outside saves); the cell keeps - showing its value and the row its height. +- **Rich text edits in a panel**: on a select-first grid (`cellSelection`), a + `markdown`, `html` or `richtext` cell opens the record form's text box in a + panel under the cell (Enter is a new line, Ctrl/Cmd+Enter saves, Escape + discards, a click outside saves); the cell keeps showing its value and the row + its height. A grid without `cellSelection` opens the text box over the cell on + one click, where Enter is a new line, Ctrl/Cmd+Enter does nothing, Escape + discards and a click outside keeps the text as a pending change for the save + buttons. - **Visual feedback**: editable cells show a hover state - **Automatic focus**: the input is focused and selected when editing begins diff --git a/ui/packages/plugin-grid/src/GroupRow.tsx b/ui/packages/plugin-grid/src/GroupRow.tsx index 39d3652d6a6..e2cfd4f683a 100644 --- a/ui/packages/plugin-grid/src/GroupRow.tsx +++ b/ui/packages/plugin-grid/src/GroupRow.tsx @@ -14,7 +14,10 @@ import type { AggregationResult } from './useGroupedData'; export interface GroupRowProps { /** Unique key identifying this group */ groupKey: string; - /** Display label for the group (field value or "(empty)") */ + /** + * Display label for the group: the field value, or for an empty key the + * grid's empty-value string `grid.empty` ("Empty" in English). + */ label: string; /** * The group's size. On a server-grouped grid this is the header query's diff --git a/ui/packages/plugin-grid/src/temporalCellFace.ts b/ui/packages/plugin-grid/src/temporalCellFace.ts index 9c8db085fa6..e15ce41f239 100644 --- a/ui/packages/plugin-grid/src/temporalCellFace.ts +++ b/ui/packages/plugin-grid/src/temporalCellFace.ts @@ -78,8 +78,9 @@ export function temporalExtreme(values: Iterable, type: 'min' | 'max'): * [objectui#13234] A stored `date` / `datetime` value, drawn as the grid's * cell draws the same value. `undefined` for a value the cell has no face for * (empty or unparsable), so the caller keeps its own text: a group band keeps - * the group's own label ("(empty)" for an empty key, the stored text - * otherwise), and an aggregate is left out. + * the group's own label (the grid's empty-value string `grid.empty`, "Empty" + * in English, for an empty key; the stored text otherwise), and an aggregate is + * left out. * * The formatting CALLS are the cells' own, with the cells' arguments: * `DateCellRenderer` in a grid column (`inGridColumn`, objectstack#25884)