Skip to content
Merged
21 changes: 21 additions & 0 deletions .changeset/33187-action-answer-table-renderer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
'@object-ui/app-shell': patch
'@object-ui/core': patch
'@objectstack/platform-objects': patch
'@objectstack/spec': patch
---

feat(app-shell): the action result dialog draws a `table` answer field as rows, and Import Users shows its result per row in one

Clause-②: yes (widening) — the console now draws `format: 'table'` fields (declared since the spec half) instead of their label alone, and `sys_user.import_sso_users` draws its per-row report as a table instead of JSON; no input is refused that was accepted before
Metadata-protocol: none

The console's action result dialog, and the param dialog's preflight panel that shares its field renderer, draw a field with `format: 'table'` as a table: one row per element of the array, one cell per entry of the field's `columns`, in order, under the column's `label` (or its `path`). A cell reads its `path` in the element; a missing key or a `null` draws an empty cell, a value that fits the column's `format` draws in it, and anything else draws as one line of JSON. An element that is not a plain object draws as JSON in its row's first cell. An empty array draws the header over a "No rows to display" line. The dialog widens when it draws a table.

A `code-list` field now draws as a code list only when its value is an array of strings, as the renderer contract says; any other array draws as JSON.

`@objectstack/platform-objects`: on a cloud-managed environment, the Import Users result shows one row per CSV line, with the email, whether it succeeded, whether the address was already pending, whether the hosting organization was told and why not, why a row was not added, the columns that were not applied, and a manager that was not linked. The summary counts stay above it.

`@objectstack/spec`: `columns` is no longer marked `[PLANNED — not yet rendered]`, and the renderer contract now says that a `null` cell value draws an empty cell and that only a plain object is read by column paths (an array or `null` element draws as JSON). It also says that inside a table cell `text` and `code-list` draw the value alone with no copy control, while `secret` keeps its mask, reveal and copy and `qrcode` keeps its code and copy. Its liveness rows are `live`.

`@object-ui/core`: `ResultDialogFieldSpec` gains `columns`, derived from the contract's answer-field row like its `label` and `format`, so the console's table renderer reads it off the runner's own type.
2 changes: 1 addition & 1 deletion content/docs/protocol/objectui/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ resultDialog:
- { path: client.client_secret, label: Client Secret, format: secret }
```

Each `fields[].path` is a dot path into `result.data`. The per-field `format` (`qrcode`, `code-list`, `secret`, `text`, `json`) controls rendering.
Each `fields[].path` is a dot path into `result.data`. The per-field `format` (`qrcode`, `code-list`, `secret`, `text`, `json`, `table`) controls rendering. `table` draws an array as rows and requires `columns: [{ path, label?, format? }]`, one entry per cell, with `path` read in one element of the array; `columns` is refused beside any other format, and a cell takes any format but `table`.

#### ⚠️ That `target` is not interchangeable with the SDK's registration door

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,45 @@ describe('features.cloudManaged hides every other action whose door writes or de
expect(offeredOn(SysInvitation, 'reject_invitation', INVITATION_ROW, { ...MULTI, cloudManaged: true })).toBe(true);
});
});

/**
* objectstack#33187: the import door answers one report row per CSV line
* (plugin-auth `ImportSsoUserRowResult`: `row`, `email`, `ok`,
* `alreadyPending`, `host`, `error`, `notApplied`, `managerError`), and the
* result dialog draws that report as a `table`, one cell per member a reader
* needs, instead of a block of JSON. The columns are the contract's
* (`resultDialog.fields[].columns`), so the declaration parses as the
* console's `ResultField` reads it.
*/
describe('import_sso_users draws the per-row report as a table', () => {
const rowsField = () => {
const dialog = declared('import_sso_users').resultDialog as { fields?: Array<Record<string, unknown>> };
return (dialog.fields ?? []).find((field) => field.path === 'rows');
};

it('declares `rows` as a `table` whose columns read the door row members, in reading order', () => {
const field = rowsField();
expect(field?.format).toBe('table');
expect((field?.columns as Array<{ path: string }>).map((column) => column.path)).toEqual([
'row',
'email',
'ok',
'alreadyPending',
'host.notified',
'host.reason',
'error.message',
'notApplied',
'managerError',
]);
});

it('CONTROL: the summary counts stay fields of their own, ahead of the table', () => {
const dialog = declared('import_sso_users').resultDialog as { fields?: Array<{ path: string; format?: string }> };
expect(dialog.fields?.map((field) => [field.path, field.format])).toEqual([
['summary.added', 'text'],
['summary.alreadyPending', 'text'],
['summary.failed', 'text'],
['rows', 'table'],
]);
});
});
23 changes: 22 additions & 1 deletion packages/platform-objects/src/identity/sys-user.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,11 +548,32 @@ export const SysUser = ObjectSchema.create({
resultDialog: {
title: 'Import Finished',
acknowledge: 'Done',
// `rows` is the door's per-row report (plugin-auth
// `ImportSsoUserRowResult`), drawn as a table: one row per CSV line, a
// cell per answer member. A member a row does not carry draws an empty
// cell: `alreadyPending` and `host` only on a row that was added,
// `error` only on one that was not, `notApplied` only on a re-add that
// sent columns, `managerError` only when no manager was linked.
fields: [
{ path: 'summary.added', label: 'Added', format: 'text' },
{ path: 'summary.alreadyPending', label: 'Already pending, told again', format: 'text' },
{ path: 'summary.failed', label: 'Not added', format: 'text' },
{ path: 'rows', label: 'Result per row', format: 'json' },
{
path: 'rows',
label: 'Result per row',
format: 'table',
columns: [
{ path: 'row', label: 'Row', format: 'json' },
{ path: 'email', label: 'Email' },
{ path: 'ok', label: 'Succeeded', format: 'json' },
{ path: 'alreadyPending', label: 'Already pending, told again', format: 'json' },
{ path: 'host.notified', label: 'Hosting organization told', format: 'json' },
{ path: 'host.reason', label: 'Why not told' },
{ path: 'error.message', label: 'Not added because' },
{ path: 'notApplied', label: 'Not applied (set these on the record)', format: 'code-list' },
{ path: 'managerError', label: 'Manager' },
],
},
],
},
},
Expand Down
27 changes: 14 additions & 13 deletions packages/spec/liveness/action.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
},
"resultDialog": {
"status": "live",
"note": "objectui one-shot result reveal {title,description,acknowledge,format,fields}. `fields[].format: 'table'` and its `columns` (#34391) are PLANNED until the console reader #33187 lands (see `preflight.fields.columns`, the same row): the spec refuses the contradictions at parse, and the console draws a `table` row's label alone today."
"note": "objectui one-shot result reveal {title,description,acknowledge,format,fields}. `fields[].format: 'table'` and its `columns` (#34391) are LIVE since the console reader #33187 (see `preflight.fields.columns`, the same row): the spec refuses the contradictions at parse, and the console's `ResultField` draws a `table` row as a table, one row per element and one cell per column."
},
"preflight": {
"status": "live",
Expand Down Expand Up @@ -327,24 +327,25 @@
"note": "Live with its container `preflight.fields`: the row's display format, from resultDialog's format set."
},
"columns": {
"status": "planned",
"verifiedAt": "2026-11-16",
"note": "PLANNED (spec card #34391; reader #33187, maintainer ruling A 6915677641). The cells of a `format: 'table'` row, `[{ path, label?, format? }]`, from the row builder `resultDialog.fields` shares (packages/spec/src/ui/action.zod.ts#actionAnswerFieldRow). Enforced at parse today: required by `table`, refused beside any other format (#refuseTableColumnContradictions), and a cell takes the field formats minus `table`. NOT yet drawn: the console's `ResultField` (ui/packages/app-shell/src/views/ActionResultDialog.tsx) has no `table` branch, so until #33187 lands a `table` row draws its label alone. Re-grade `live` in the PR that lands that renderer.",
"status": "live",
"verifiedAt": "2026-11-17",
"evidence": "ui/packages/app-shell/src/views/ActionResultDialog.tsx#ResultField (the `table` branch: an array value draws through `TableBlock`, any other value as `json`); ui/packages/app-shell/src/views/ActionResultDialog.tsx#TableBlock (one row per element, one cell per entry of `columns`, in order); ui/packages/app-shell/src/views/ActionResultDialog.tsx#TableCellValue (the cell, in the column's format or as compact JSON); ui/packages/app-shell/src/views/ActionParamDialog.tsx#PreflightPanel (each preflight `fields` row through the same `ResultField`)",
"note": "LIVE (spec card #34391; reader #33187, maintainer ruling A 6915677641). The cells of a `format: 'table'` row, `[{ path, label?, format? }]`, from the row builder `resultDialog.fields` shares (packages/spec/src/ui/action.zod.ts#actionAnswerFieldRow). Enforced at parse: required by `table`, refused beside any other format (#refuseTableColumnContradictions), and a cell takes the field formats minus `table`. Drawn by the console's `ResultField`, which the result dialog and the preflight panel share, by the `table` bullet of the `resultDialog` renderer contract; pinned in ui/packages/app-shell/src/views/__tests__/ActionResultDialog.test.tsx. First producer: `sys_user.import_sso_users`, whose per-row report draws as a table (packages/platform-objects/src/identity/sys-user.object.ts).",
"children": {
"path": {
"status": "planned",
"verifiedAt": "2026-11-16",
"note": "Planned with its container `preflight.fields.columns`: the dot path, in ONE element of the array, of the value a cell draws; a path that resolves to nothing draws an empty cell, and an element that is not an object draws as compact JSON text in its row's first cell."
"status": "live",
"verifiedAt": "2026-11-17",
"note": "Live with its container `preflight.fields.columns`: the dot path, in ONE element of the array, of the value a cell draws; a path that resolves to nothing or to `null` draws an empty cell, and an element that is not a plain object draws as compact JSON text in its row's first cell."
},
"label": {
"status": "planned",
"verifiedAt": "2026-11-16",
"note": "Planned with its container `preflight.fields.columns`: the column header; omitted, the header is the column's `path`."
"status": "live",
"verifiedAt": "2026-11-17",
"note": "Live with its container `preflight.fields.columns`: the column header; omitted, the header is the column's `path`."
},
"format": {
"status": "planned",
"verifiedAt": "2026-11-16",
"note": "Planned with its container `preflight.fields.columns`: the cell format, the field formats minus `table` (refused at parse: a table does not nest); omitted, `text`. A value that does not fit the cell's format, whatever it is, draws as compact JSON text, and a missing value draws an empty cell (the `table` bullet of the `resultDialog` renderer contract)."
"status": "live",
"verifiedAt": "2026-11-17",
"note": "Live with its container `preflight.fields.columns`: the cell format, the field formats minus `table` (refused at parse: a table does not nest); omitted, `text`. A value that does not fit the cell's format, whatever it is, draws as compact JSON text, and a missing or `null` value draws an empty cell (the `table` bullet of the `resultDialog` renderer contract)."
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/spec/liveness/state-counts/action.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ committed anywhere: `check:liveness` sums the shards when it reads them.

| Type | live | exp | elsewhere | dead | planned | classified |
|---|---|---|---|---|---|---|
| `action` | 79 | 0 | 0 | 1 | 5 | 85 |
| `action` | 82 | 0 | 0 | 1 | 2 | 85 |
28 changes: 16 additions & 12 deletions packages/spec/src/ui/action.zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ const ActionAnswerTableColumnSchema = strictObject({
'`table` is a field format, not a cell format: a cell draws one value of one row, and a table does not '
+ 'nest. Drop `format` (a cell value that does not fit its format, an object or an array included, draws as compact JSON text), or '
+ "write `format: 'json'`.",
).optional().describe('Cell format: the field formats minus `table`; omitted, `text`. A value that does not fit the cell\'s format, whatever it is (an object or an array under `text`, a number under `secret`), draws as compact JSON text; a missing value draws an empty cell.'),
).optional().describe('Cell format: the field formats minus `table`; omitted, `text`. A value that does not fit the cell\'s format, whatever it is (an object or an array under `text`, a number under `secret`), draws as compact JSON text; a missing or `null` value draws an empty cell. Inside a cell, `text` and `code-list` draw the value alone with no copy control, while `secret` keeps its mask, reveal and copy and `qrcode` keeps its code and copy.'),
});

/**
Expand Down Expand Up @@ -935,8 +935,8 @@ function actionAnswerFieldRow(surface: string, pathDescription: string) {
}, {
path: z.string().describe(pathDescription),
label: I18nLabelSchema.optional(),
format: ActionAnswerFieldFormatSchema.optional().describe('Per-field format override. `table` [PLANNED — not yet rendered] draws an array as rows and requires `columns`.'),
columns: z.array(ActionAnswerTableColumnSchema).optional().describe("[PLANNED — not yet rendered] The cells of a `format: 'table'` field, in order: `[{ path, label?, format? }]`, `path` read in ONE element of the array. Required by `table` (never guessed from the element's keys) and refused beside any other format. Until the console's table renderer lands, a `table` field draws its label alone."),
format: ActionAnswerFieldFormatSchema.optional().describe('Per-field format override. `table` draws an array as rows and requires `columns`.'),
columns: z.array(ActionAnswerTableColumnSchema).optional().describe("The cells of a `format: 'table'` field, in order: `[{ path, label?, format? }]`, `path` read in ONE element of the array. Required by `table` (never guessed from the element's keys) and refused beside any other format."),
}).superRefine(refuseTableColumnContradictions);
}

Expand Down Expand Up @@ -1809,15 +1809,19 @@ const actionObject = () => strictObject({
* each entry of the field's `columns` one cell, in `columns` order. The
* header of a column is its `label`, falling back to its `path`. A cell
* reads the column's dot `path` in the element; a missing value (the
* path resolves to `undefined`) draws an empty cell. A present value
* draws in the column's `format` (omitted: `text`) when it fits that
* format the way a field's value must: `qrcode`, `secret` and `text` take
* a string, `code-list` an array of strings. Any value that does not fit,
* whatever the column's format (an object or an array under the omitted
* `text`, a number under `secret`), draws as compact JSON text, which is
* also how `json` draws in a cell. An element that is not an object has no
* paths to read: its row draws the element itself as compact JSON text in
* the first cell and leaves the other cells empty. `[]` draws the header
* path resolves to `undefined`) and a `null` draw an empty cell. A
* present value draws in the column's `format` (omitted: `text`) when it
* fits that format the way a field's value must: `qrcode`, `secret` and
* `text` take a string, `code-list` an array of strings. Any value that
* does not fit, whatever the column's format (an object or an array under
* the omitted `text`, a number under `secret`), draws as compact JSON
* text, which is also how `json` draws in a cell. Inside a cell, `text`
* and `code-list` draw the value alone with no copy control, while
* `secret` keeps its mask, reveal and copy and `qrcode` keeps its code
* and copy. An element that is not
* a plain object (an array, `null` or a scalar) has no paths to read: its
* row draws the element itself as compact JSON text in the first cell and
* leaves the other cells empty. `[]` draws the header
* row over an empty-state line. A field value that is missing is skipped
* like any other field's, and one that is not an array draws as `json`,
* as `code-list` does.
Expand Down
Loading
Loading