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
21 changes: 21 additions & 0 deletions .changeset/submitbehavior-jsdoc-mode-aware-default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
"@objectstack/spec": patch
---

docs(spec): state `submitBehavior`'s default as mode-aware, not a single fixed kind (#7441)

The TSDoc block above `FormViewSchema.submitBehavior` in `packages/spec/src/ui/view.zod.ts`
still read `` `thank-you` (default) — show a confirmation panel``, which the maintainer's
2026-08-10 ruling on #7245 makes false for the internal path: `thank-you` stays the default
only on the public `/console/f/:slug` path, while the internal `/console/forms/:name` path
— where `type: 'form'` actions send operators — now defaults to redirecting to the record
that was just created. An explicit `submitBehavior` wins in either mode.

Rewritten to state both defaults and the reasoning behind each, mirroring the contract
already landed in `content/docs/protocol/objectui/actions.mdx` and `content/docs/ui/forms.mdx`
(PR #7417). The schema itself is unchanged: `submitBehavior` stays `.optional()` with no
`.default()`, and its `.describe()` string (`'Post-submit behavior'`) is untouched — only
the source comment was wrong, and only the source comment changes.

No generated output changes: `gen:docs` never renders property-level TSDoc, so `check:docs`
reports all 231 files still in sync (same measurement PR #7444 made for the same reason).
11 changes: 10 additions & 1 deletion packages/spec/src/ui/view.zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,16 @@ export const FormViewSchema = lazySchema(() => strictObject({
/**
* What happens after a successful submit.
*
* - `thank-you` (default) — show a confirmation panel
* The default when this is omitted is **mode-aware**, not a single fixed
* kind (ruled 2026-08-10 on #7245): the public `/console/f/:slug` path
* defaults to `thank-you` — there is no record an anonymous submitter is
* allowed to read back, so a confirmation panel is all there is to show.
* The internal `/console/forms/:name` path — where `type: 'form'` actions
* send operators — defaults to redirecting to the record that was just
* created, since an operator who just created a record belongs on that
* record. An explicit `submitBehavior` always wins, in either mode.
*
* - `thank-you` — show a confirmation panel
* - `redirect` — send the browser to a URL
* - `continue` — reset the form so another response can be entered
* - `next-record` — advance to the next record (internal queues only)
Expand Down
Loading