Skip to content

Commit b88d54a

Browse files
committed
docs(ui): teach the thank-you panel's record field token, and add the changeset
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibySWZrcTi5MPXZ61kx
1 parent 8e28a15 commit b88d54a

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@object-ui/console': minor
3+
---
4+
5+
feat(console): a public form's thank-you panel shows the record field values its `{{record.field_name}}` tokens name
6+
7+
Clause-②: no
8+
Metadata-protocol: semantic
9+
10+
A `thank-you` panel's `title` and `message` may name an engine-generated field of the record just submitted (an `autonumber` field, such as a case number) as `{{record.field_name}}`. On the public form route the Console now replaces each such token with the value the submit answer carries for it under `fields` (`PublicFormSubmitResponseSchema`, `@objectstack/spec/api`), so a web-to-case visitor sees their case number instead of the token's own text:
11+
12+
```ts
13+
submitBehavior: { kind: 'thank-you', message: 'Your case number is {{record.case_number}}.' }
14+
```
15+
16+
- Which tokens a text holds is read by the spec's `thankYouRecordFieldNames`; the Console has no token grammar of its own.
17+
- A token the answer carries no value for shows as empty, never as the token's text.
18+
- A value is drawn as plain text, never as markup, and a filled value is never read for tokens again.

‎content/docs/ui/forms.mdx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,12 @@ formViews: {
385385
| `continue` | Re-read prefill values and reset state — user can submit another response without reload. |
386386
| `next-record` | Stub for queue contexts; falls back to thank-you when no queue is wired. |
387387

388+
On the public path, a `thank-you` panel's `title` and `message` may name the record just submitted as `{{record.field_name}}`, and the Console replaces each token with the value the submit answer carries for it, drawn as plain text; only an engine-generated field (an `autonumber` field, such as a case number) may be named, and a token with no value in the answer shows as empty:
389+
390+
```ts
391+
submitBehavior: { kind: 'thank-you', title: 'Case opened', message: 'Your case number is {{record.case_number}}.' }
392+
```
393+
388394
### What a `redirect` `url` may be
389395

390396
`url` is **not** a free-form address. It was ruled on 2026-08-11 ([#7496](https://github.com/objectstack-ai/objectstack/issues/7496)) and the schema enforces it, so a URL outside this shape is a parse error at authoring time rather than a surprise in the browser:

‎content/docs/ui/public-data-collection.mdx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ formViews: {
3535

3636
The `submitBehavior` above sets the **copy**, not the behavior: `thank-you` is already the default on the public path, because an anonymous submitter may not read the record back. The internal path defaults the other way — a `type: 'form'` action lands the operator on the record it just created — so do not carry a public form's confirmation panel over to an internal one by habit. See [`submitBehavior` is mode-aware](/docs/ui/forms#the-default-is-mode-aware).
3737

38+
The panel can also show the visitor a reference to the record they just created: name the field in `title` or `message` as `{{record.field_name}}`, and the Console fills it from the submit answer. Only an engine-generated field (an `autonumber` field, such as a case number) may be named; `os validate` and the publish gate refuse any other.
39+
40+
```ts
41+
submitBehavior: { kind: 'thank-you', title: 'Thanks!', message: 'Your case number is {{record.case_number}}.' },
42+
```
43+
3844
That `sharing` block wires the anonymous endpoints automatically:
3945

4046
```

0 commit comments

Comments
 (0)