diff --git a/docs/features/data-workspace.md b/docs/features/data-workspace.md index 48383b34f..899d21769 100644 --- a/docs/features/data-workspace.md +++ b/docs/features/data-workspace.md @@ -118,7 +118,7 @@ isLabelLocked(field, table) // true for built-in postType fields and sys deleteTooltip(field, table) // disabled-button tooltip text, or undefined ``` -Built-in field **values** (row cells) are additionally read-only on the *structural* system tables (pages/components/layouts) via `isBuiltInValueLocked` (`@core/data/systemTableGuard`); `posts` built-in values stay editable. The same predicate backs the server's row-write rejection (`lockedBuiltInCellKey`). +Built-in field **values** (row cells) stay editable on existing records everywhere, including the *structural* system tables (pages/components/layouts). The one remaining value lock is at **create** time: `protectedBuiltInCreateCellKey` (`@core/data/systemTableGuard`) rejects a create that supplies built-in cells for a structural system table, so those rows are born through their own authoring surfaces rather than the generic row endpoint. `posts` is exempt (`kind === 'postType'`), and the server enforces this in `server/handlers/cms/data/tables.ts`. `FIELD_TYPE_LABELS` maps every `DataFieldType` to a human-readable string and is shared by `FieldRow` and `FieldSchemaComposer`. diff --git a/src/admin/pages/data/components/DataGrid/cells/PageTreeCell.test.tsx b/src/admin/pages/data/components/DataGrid/cells/PageTreeCell.test.tsx index 6ea4d5e54..367b79913 100644 --- a/src/admin/pages/data/components/DataGrid/cells/PageTreeCell.test.tsx +++ b/src/admin/pages/data/components/DataGrid/cells/PageTreeCell.test.tsx @@ -35,10 +35,10 @@ function button(): HTMLButtonElement { } describe('PageTreeCell', () => { - // A `pageTree` cell on a system table is ALWAYS readOnly — every built-in - // field of `pages` / `components` / `layouts` is value-locked. The button - // navigates to the visual editor rather than editing the cell, so gating it - // on readOnly disabled it on exactly the rows it exists for. + // A `pageTree` cell is never editable inline — the tree is authored in the + // visual editor, not typed into a cell. The button navigates to that editor + // rather than editing the cell, so gating it on readOnly disabled it on + // exactly the rows it exists for. it('stays enabled on a read-only cell when a handler is wired', async () => { let opened = 0 renderCell({ readOnly: true, onOpenEditor: () => { opened += 1 } }) diff --git a/src/admin/pages/data/components/DataGrid/cells/PageTreeCell.tsx b/src/admin/pages/data/components/DataGrid/cells/PageTreeCell.tsx index 80a10b9c3..d8b64a5bb 100644 --- a/src/admin/pages/data/components/DataGrid/cells/PageTreeCell.tsx +++ b/src/admin/pages/data/components/DataGrid/cells/PageTreeCell.tsx @@ -10,11 +10,11 @@ * pattern that `RelationCell` uses for `onOpenPicker`. * * `readOnly` deliberately does NOT gate the button. It means "this value is - * not editable in the grid", which is always true for a `pageTree` cell on a - * system table (`isBuiltInValueLocked` holds for every built-in field of - * `pages` / `components` / `layouts`). The button edits nothing — it navigates - * to the visual editor, which enforces its own permissions. Gating it on - * `readOnly` disabled it on exactly the rows it exists for. + * not editable inline in the grid", which a `pageTree` cell never is — the + * tree is authored in the visual editor, not typed into a cell. The button + * edits nothing, it navigates to that editor, which enforces its own + * permissions. Gating it on `readOnly` disabled it on exactly the rows it + * exists for. */ import type { ReactElement } from 'react' import { Button } from '@ui/components/Button'