Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/36023-rich-text-cell-panel.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
'@object-ui/fields': patch
'@object-ui/plugin-grid': patch
Expand All @@ -8,6 +8,6 @@
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.
11 changes: 11 additions & 0 deletions .changeset/36360-rich-text-panel-wording.md
Original file line number Diff line number Diff line change
@@ -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.
13 changes: 8 additions & 5 deletions content/docs/frontend/plugins/plugin-grid.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions ui/packages/fields/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions ui/packages/fields/src/FieldEditWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,11 @@ export const INLINE_EXCLUDED_FIELD_TYPES = new Set<string>([
* 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
Expand Down
12 changes: 8 additions & 4 deletions ui/packages/plugin-grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion ui/packages/plugin-grid/src/GroupRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions ui/packages/plugin-grid/src/temporalCellFace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ export function temporalExtreme(values: Iterable<unknown>, 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)
Expand Down
Loading