diff --git a/.changeset/submitbehavior-jsdoc-mode-aware-default.md b/.changeset/submitbehavior-jsdoc-mode-aware-default.md new file mode 100644 index 0000000000..217eb82e1c --- /dev/null +++ b/.changeset/submitbehavior-jsdoc-mode-aware-default.md @@ -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). diff --git a/packages/spec/src/ui/view.zod.ts b/packages/spec/src/ui/view.zod.ts index bf57bcebdc..1c735db15e 100644 --- a/packages/spec/src/ui/view.zod.ts +++ b/packages/spec/src/ui/view.zod.ts @@ -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)