Skip to content

Commit bfd427c

Browse files
committed
docs(spec): regenerate the api surface, export origins and reference docs; add the changeset and the flows guide section
Claude-Session: https://claude.ai/code/session_0115tbh4XfgivQD2RpHHwdMz Co-authored-by: Claude <noreply@anthropic.com>
1 parent f10d535 commit bfd427c

4 files changed

Lines changed: 37 additions & 4 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/service-automation': minor
4+
'@object-ui/app-shell': minor
5+
---
6+
7+
feat(spec,automation,app-shell): a read-only `record_link` screen field shows a record the run created, by its display name, as a link to its record page
8+
9+
Clause-②: yes (widening)
10+
Metadata-protocol: added
11+
12+
A screen flow can now end on a result screen that links the records it created, instead of a toast that points at nothing.
13+
14+
```ts
15+
{ id: 'done', type: 'screen', config: { title: 'Lead converted', fields: [
16+
{ name: 'account_link', label: 'Account', type: 'record_link',
17+
reference: 'crm_account', defaultValue: { dialect: 'cel', source: 'account.id' } },
18+
] } },
19+
```
20+
21+
- **`@objectstack/spec`**: `ScreenFieldConfigSchema` gains the `type` member `'record_link'` (`SCREEN_FIELD_RECORD_LINK_TYPE`). On it, `reference` (the record's object) and `defaultValue` (a value slot that evaluates to the record's id) are required, and `required`, `options`, `placeholder`, `min` and `max` are refused, each at its own key with the exported refusal text (`SCREEN_FIELD_RECORD_LINK_REFERENCE_REQUIRED`, `SCREEN_FIELD_RECORD_LINK_DEFAULT_VALUE_REQUIRED`, `screenFieldRecordLinkRefusedKey`). The name is `record_link`, not `record`, because `record` is already an object field type (a name-keyed map of sub-objects) and a screen field's `type` uses the same vocabulary. Every other `type` value parses as before.
22+
- **`@objectstack/service-automation`**: the resume refuses any value sent under a `record_link` field's name, `null` included and visible or not, with `400 INVALID_SCREEN_INPUT` and the field code `invalid_value` ("shows a record and takes no value"). The value is never bound to a flow variable, the refusal keeps the pause, and a resume that leaves the field out still lands. A caller's param that shares the field's name never counts as answering the screen, so a result screen always pauses.
23+
- **`@object-ui/app-shell`**: the flow screen dialog shows a `record_link` field as the record's display name (the object's `nameField`, through the lookup widget's read-only branch) inside a link to `/apps/APP/OBJECT/record/ID`. An empty id shows "—" with no link, and an object the console cannot route to shows the name without a link. `visibleWhen` works as on any field. The dialog never seeds or posts a value for the field.

‎content/docs/references/automation/builtin-node-config.mdx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ A value: a CEL value envelope `{ dialect: 'cel', source }` evaluated by the expr
278278
| :--- | :--- | :--- | :--- |
279279
| **name** | `string` | ✅ | Field name (the flow variable the value binds to) — a name without a leading `$` (the `$` names are the flow engine's own), read as `{{ name }}` |
280280
| **label** | `string` | optional | Display label |
281-
| **type** | `string` | optional | Input type — an open widget hint (text, number, select, …); `file` renders the platform upload widget and the screen resumes with the uploaded file's id, which a later node writes into a `file` field |
281+
| **type** | `string` | optional | Input type — an open widget hint (text, number, select, …); `file` renders the platform upload widget and the screen resumes with the uploaded file's id, which a later node writes into a `file` field; `record_link` shows the `reference` record whose id `defaultValue` evaluates to, by its display name, as a link to its record page, and takes no input |
282282
| **required** | `boolean` | optional | Whether a value is required to submit |
283283
| **options** | `{ value: any; label: string }[]` | optional | Choices for a select-style field; option values must stay distinct when read as text |
284284
| **defaultValue** | `any` | optional | Prefilled value: a CEL value envelope `{ dialect: 'cel', source }` evaluated when the screen is served (the client receives the value, never the envelope), or a literal written as it is — a `{…}` template token is refused |
@@ -287,7 +287,7 @@ A value: a CEL value envelope `{ dialect: 'cel', source }` evaluated by the expr
287287
| **min** | `number` | optional | Minimum accepted value (numeric fields); enforced on resume |
288288
| **max** | `number` | optional | Maximum accepted value (numeric fields); enforced on resume |
289289
| **inlineHelpText** | `string` | optional | Help text displayed below the field |
290-
| **reference** | `string` | optional | Target object name (snake_case) whose records a `type: 'lookup'` field picks from; REQUIRED when `type` is `lookup` |
290+
| **reference** | `string` | optional | Target object name (snake_case) whose records a `type: 'lookup'` field picks from, or that a `type: 'record_link'` field's record belongs to; REQUIRED when `type` is `lookup` or `record_link` |
291291

292292

293293
---
@@ -300,7 +300,7 @@ A value: a CEL value envelope `{ dialect: 'cel', source }` evaluated by the expr
300300
| :--- | :--- | :--- | :--- |
301301
| **name** | `string` | ✅ | Field name (the flow variable the value binds to) — a name without a leading `$` (the `$` names are the flow engine's own), read as `{{ name }}` |
302302
| **label** | `string` | optional | Display label |
303-
| **type** | `string` | optional | Input type — an open widget hint (text, number, select, …); `file` renders the platform upload widget and the screen resumes with the uploaded file's id, which a later node writes into a `file` field |
303+
| **type** | `string` | optional | Input type — an open widget hint (text, number, select, …); `file` renders the platform upload widget and the screen resumes with the uploaded file's id, which a later node writes into a `file` field; `record_link` shows the `reference` record whose id `defaultValue` evaluates to, by its display name, as a link to its record page, and takes no input |
304304
| **required** | `boolean` | optional | Whether a value is required to submit |
305305
| **options** | `{ value: any; label: string }[]` | optional | Choices for a select-style field; option values must stay distinct when read as text |
306306
| **defaultValue** | `any` | optional | Prefilled value: a CEL value envelope `{ dialect: 'cel', source }` evaluated when the screen is served (the client receives the value, never the envelope), or a literal written as it is — a `{…}` template token is refused |
@@ -309,7 +309,7 @@ A value: a CEL value envelope `{ dialect: 'cel', source }` evaluated by the expr
309309
| **min** | `number` | optional | Minimum accepted value (numeric fields); enforced on resume |
310310
| **max** | `number` | optional | Maximum accepted value (numeric fields); enforced on resume |
311311
| **inlineHelpText** | `string` | optional | Help text displayed below the field |
312-
| **reference** | `string` | optional | Target object name (snake_case) whose records a `type: 'lookup'` field picks from; REQUIRED when `type` is `lookup` |
312+
| **reference** | `string` | optional | Target object name (snake_case) whose records a `type: 'lookup'` field picks from, or that a `type: 'record_link'` field's record belongs to; REQUIRED when `type` is `lookup` or `record_link` |
313313

314314
### Nested Shape: `ScreenFieldConfig.options[number]`
315315

‎packages/spec/api-surface/automation.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@
235235
"SCHEMALESS_NODE_CONFIG_SCHEMAS (const)",
236236
"SCREEN_FIELD_LOOKUP_REFERENCE_REQUIRED (const)",
237237
"SCREEN_FIELD_OPTION_VALUE_COLLISION (const)",
238+
"SCREEN_FIELD_RECORD_LINK_DEFAULT_VALUE_REQUIRED (const)",
239+
"SCREEN_FIELD_RECORD_LINK_REFERENCE_REQUIRED (const)",
240+
"SCREEN_FIELD_RECORD_LINK_REFUSED_KEYS (const)",
241+
"SCREEN_FIELD_RECORD_LINK_TYPE (const)",
238242
"STRUCTURAL_CONDITION_SHAPE_REFUSAL (const)",
239243
"ScheduleOrganization (type)",
240244
"ScheduleOrganizationSchema (const)",
@@ -323,6 +327,7 @@
323327
"resolveFlowNodeValueSlots (function)",
324328
"resolveFlowTriggerKind (function)",
325329
"resolveScheduleOrganization (function)",
330+
"screenFieldRecordLinkRefusedKey (function)",
326331
"structuralConditionRefusal (function)",
327332
"templateSlotSource (function)",
328333
"textSlotTemplateRefusal (function)",

‎packages/spec/export-origins/automation.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@
230230
"SCHEMALESS_NODE_CONFIG_SCHEMAS": "src/automation/schemaless-node-config.zod.ts#SCHEMALESS_NODE_CONFIG_SCHEMAS (const)",
231231
"SCREEN_FIELD_LOOKUP_REFERENCE_REQUIRED": "src/automation/builtin-node-config.zod.ts#SCREEN_FIELD_LOOKUP_REFERENCE_REQUIRED (const)",
232232
"SCREEN_FIELD_OPTION_VALUE_COLLISION": "src/automation/builtin-node-config.zod.ts#SCREEN_FIELD_OPTION_VALUE_COLLISION (const)",
233+
"SCREEN_FIELD_RECORD_LINK_DEFAULT_VALUE_REQUIRED": "src/automation/builtin-node-config.zod.ts#SCREEN_FIELD_RECORD_LINK_DEFAULT_VALUE_REQUIRED (const)",
234+
"SCREEN_FIELD_RECORD_LINK_REFERENCE_REQUIRED": "src/automation/builtin-node-config.zod.ts#SCREEN_FIELD_RECORD_LINK_REFERENCE_REQUIRED (const)",
235+
"SCREEN_FIELD_RECORD_LINK_REFUSED_KEYS": "src/automation/builtin-node-config.zod.ts#SCREEN_FIELD_RECORD_LINK_REFUSED_KEYS (const)",
236+
"SCREEN_FIELD_RECORD_LINK_TYPE": "src/automation/builtin-node-config.zod.ts#SCREEN_FIELD_RECORD_LINK_TYPE (const)",
233237
"STRUCTURAL_CONDITION_SHAPE_REFUSAL": "src/automation/flow-node-expression-paths.ts#STRUCTURAL_CONDITION_SHAPE_REFUSAL (const)",
234238
"ScheduleOrganization": "src/automation/schedule-organization.zod.ts#ScheduleOrganization (type)",
235239
"ScheduleOrganizationSchema": "src/automation/schedule-organization.zod.ts#ScheduleOrganizationSchema (const)",
@@ -317,6 +321,7 @@
317321
"resolveFlowNodeValueSlots": "src/automation/flow-node-expression-paths.ts#resolveFlowNodeValueSlots (function)",
318322
"resolveFlowTriggerKind": "src/automation/flow-trigger-kind.ts#resolveFlowTriggerKind (function)",
319323
"resolveScheduleOrganization": "src/automation/schedule-organization.zod.ts#resolveScheduleOrganization (function)",
324+
"screenFieldRecordLinkRefusedKey": "src/automation/builtin-node-config.zod.ts#screenFieldRecordLinkRefusedKey (function)",
320325
"structuralConditionRefusal": "src/automation/flow-node-expression-paths.ts#structuralConditionRefusal (function)",
321326
"templateSlotSource": "src/automation/flow-text-slot-template.ts#templateSlotSource (function)",
322327
"textSlotTemplateRefusal": "src/automation/flow-text-slot-template.ts#textSlotTemplateRefusal (function)",

0 commit comments

Comments
 (0)