Skip to content

Commit df2d216

Browse files
committed
feat(spec): submitText — liveness row, docs, key inventory, changesets
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2fi9zfJhUTubyJYb6V
1 parent 0013672 commit df2d216

8 files changed

Lines changed: 86 additions & 3 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@object-ui/core': patch
3+
---
4+
5+
`SPEC_ACTION_KEYS` lists `submitText`, the key `@objectstack/spec` adds to `ActionSchema` for the param dialog's submit button label. An action that carries it is not counted as having an unknown key, and the inventory pin stays green.
6+
7+
Clause-②: no
8+
Metadata-protocol: none
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
'@objectstack/spec': minor
3+
---
4+
5+
feat(spec): an action's param dialog can name its own submit verb — `submitText`
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: added
9+
10+
`ActionSchema` gains one optional key, `submitText`: the label of the submit button in the dialog an action opens to collect its `params`. The button says "Confirm" today for every such action. With the key, a send-email action can say "Send" and a log-call action "Log Call". An action that does not declare it parses exactly as before.
11+
12+
```ts
13+
defineAction({
14+
name: 'log_call',
15+
label: 'Log Call',
16+
objectName: 'crm_contact',
17+
target: 'logCall',
18+
submitText: 'Log Call',
19+
params: [{ name: 'subject', label: 'Subject', type: 'text', required: true }],
20+
});
21+
```
22+
23+
- **An `I18nLabel`.** A plain string or an inline locale map (`{ en, 'zh-CN' }`). A blank string is refused at parse: `''` or whitespace only. Omit the key to keep "Confirm". `submitLabel` and `confirmLabel` (the same button's spelling on a view's `bulkActionDefs`) are refused with a rename to `submitText`, on the action and in a translation bundle.
24+
- **Actions with `params` only.** The param dialog opens only for a non-empty `params`, so `submitText` on any other registered action is refused at parse, naming the key. It is not `confirmText`, the message of the confirm dialog a param-less action opens.
25+
- **Translated like `description`.** The slot is `objects.OBJECT._actions.ACTION.submitText` (`globalActions.ACTION.submitText` for an action with no `objectName`). `translateAction` overlays it for an action that declares `params`, and never gives a button to an action without them.
26+
- **The name.** `submitText` is the protocol's existing word for a submit button's copy: the `object-form` component's `submitText`, beside its `cancelText`.
27+
28+
Nothing draws the key yet. The console's param dialog reads it in a follow-up change. Until then the liveness ledger marks it `planned` with `authorWarn`, so `os validate` warns an author who declares it that the button still says "Confirm".
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@objectstack/lint': patch
3+
---
4+
5+
`validateTranslationReferences` judges an action translation's new `submitText` key (`@objectstack/spec`'s param dialog submit label). Under an action that declares no `params`, at `objects.OBJECT._actions.ACTION.submitText` or `globalActions.ACTION.submitText`, it reports `translation-target-unknown` at `error`: such an action opens no param dialog, so nothing reads the label. Under an action that declares `params` the key is accepted.
6+
7+
Clause-②: no
8+
Metadata-protocol: none

‎content/docs/protocol/objectui/actions.mdx‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ interface Action {
230230
patch?: Record<string, unknown>; // Static field values for operation: 'update', merged under params
231231
body?: HookBody; // Inline logic for type: 'script'
232232
params?: ActionParam[]; // Inputs collected before execution
233+
submitText?: I18nLabel; // The param dialog's submit button verb (default "Confirm")
233234
method?: 'POST' | 'PATCH' | 'PUT' | 'DELETE'; // for type: 'api'
234235
235236
// UX
@@ -496,6 +497,30 @@ params:
496497

497498
`ActionParam` fields: `name`, `field`, `objectOverride`, `label`, `type`, `required` (default `false`), `options`, `placeholder`, `helpText`, `defaultValue`, `defaultFromRow`, `visible` (CEL predicate — the dialog omits the param when false), `requiresFeature` (capability gate, lowered into `visible` — see [Capability gates](#capability-gates-requiresfeature)).
498499

500+
### Naming the submit button: `submitText`
501+
502+
An action with `params` collects them in a dialog whose submit button says **Confirm**. `submitText` gives that button the action's own verb, so a send-email action can say **Send** and a log-call action **Log Call**. The dialog's other copy stays where it was: the title is the action's `label`, and the line under it is `description`.
503+
504+
```yaml
505+
name: log_call
506+
label: Log Call
507+
objectName: crm_contact
508+
type: script
509+
target: logCall
510+
description: Record a call with this contact.
511+
submitText: Log Call
512+
params:
513+
- { name: subject, label: Subject, type: text, required: true }
514+
- { name: notes, label: Notes, type: textarea }
515+
```
516+
517+
- It is an `I18nLabel`: a plain string, translated at `objects.<object>._actions.<action>.submitText` (`globalActions.<action>.submitText` for an action with no `objectName`), or an inline locale map.
518+
- **Actions with `params` only.** An action with no `params` (or an empty list) opens no param dialog, so `submitText` there is refused at parse, and a translation of it under such an action is reported by `os validate` (`translation-target-unknown`).
519+
- It is not `confirmText`. `confirmText` is the message of the confirm dialog a param-less action opens; `submitText` is the button of the param dialog an action with params opens instead.
520+
- A blank string (`''` or whitespace only) is refused at parse. Omit the key to keep **Confirm**.
521+
- `submitLabel` and `confirmLabel` (the button's spelling on a view's `bulkActionDefs`) are refused with a rename to `submitText`.
522+
- The console does not draw it yet: until its param dialog reads the key, the button says **Confirm**, and `os validate` warns an author who declares it.
523+
499524
## AI Tool Exposure (ADR-0011)
500525

501526
An action can be exposed as an AI-callable tool. Exposure is **opt-in and default off** — set `ai.exposed: true`, which then **requires** `ai.description` (≥ 40 chars, the LLM-facing contract).

‎content/docs/ui/translations.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export default defineStack({
7373
| Picklist option labels | `objects.<name>.fields.<field>.options.<value>` |
7474
| View titles, descriptions, empty states | `objects.<name>._views.<view>` |
7575
| Bulk-action copy on a list view (button, confirm prompt, dialog fields) | `objects.<name>._views.<view>.bulkActions.<def>.label` / `.confirmText` / `.confirmLabel` / `.params.<param>.label` / `.help` / `.placeholder` — a bulk param's hint is `help`, not `helpText` |
76-
| Action labels, confirm text, success messages, disabled reasons | `objects.<name>._actions.<action>` |
76+
| Action labels, confirm text, success messages, disabled reasons, param dialog submit labels | `objects.<name>._actions.<action>` |
7777
| Action result dialogs (title / description / acknowledge / field labels) | `objects.<name>._actions.<action>.resultDialog` |
7878
| Form sections | `objects.<name>._sections.<section>` |
7979
| Custom validation-rule messages | `objects.<name>._validations.<rule>.message` |

‎packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,12 @@ describe('#17501 — /meta/types serves a real schema for `action`, and moves no
255255
// live sample below still holds every live key.
256256
// [#26619] 47 → 48: `disabledReason` (why a greyed action is
257257
// unavailable) joined the accepted set, and the sample names it.
258-
expect(Object.keys(properties).length + retiredTopLevelCount('action')).toBe(48);
258+
// [#27944] 48 → 49: `submitText` (the param dialog's submit button
259+
// label) joined the accepted set, and the sample names it.
260+
expect(Object.keys(properties).length + retiredTopLevelCount('action')).toBe(49);
259261
// A sample an author would actually address, and the one #17500's
260262
// repeater titles need a node to sit on.
261-
for (const key of ['name', 'label', 'objectName', 'type', 'params', 'locations', 'outcomeMessages', 'requiresMembershipReach', 'disabledReason']) {
263+
for (const key of ['name', 'label', 'objectName', 'type', 'params', 'locations', 'outcomeMessages', 'requiresMembershipReach', 'disabledReason', 'submitText']) {
262264
expect(Object.keys(properties)).toContain(key);
263265
}
264266
});

‎packages/spec/liveness/action.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
"evidence": "ui/packages/app-shell/src/views/ActionParamDialog.tsx#ActionParamDialog renders it as the dialog's DialogDescription, falling back to the generic `actionDialog.description` string; ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx#paramCollectionHandler and ui/packages/app-shell/src/views/RecordDetailView.tsx#paramCollectionHandler both feed it as `actionDescription(objForI18n, action?.name, action?.description)`; ui/packages/i18n/src/useObjectLabel.ts#actionDescription resolves it through ui/packages/i18n/src/useObjectLabel.ts#actionSuffixes, reading objects.{o}._actions.{a}.description for an action with a key object or globalActions.{a}.description for one without, never both, then this literal; framework: packages/cli/src/utils/i18n-extract.ts emits the key and packages/spec/src/system/translation.zod.ts declares the translation slot.",
1717
"note": "Added #7367 — the RENDERER half predates the key by design: the consumer chain above shipped while `ActionSchema` (strictObject) refused `description`, so no producer could reach it (the mirror image of declared-but-unenforced). Live from the moment this key exists: the dialog reads `action.description` directly, no second input required. Mechanism for the 2026-08-10 ruling on #7278 — an action with `params` carries its confirm question here instead of in `confirmText`, so one decision is one dialog. Moved out of spec source, #23434: packages/spec/src/ui/action.zod.ts (this key's docblock) and packages/spec/src/system/translation.zod.ts (the translation slot's comment) cited this chain by line, sha-less. Re-read at objectui @b9814b334 on 2026-10-15: the object-then-global fallback both described, and this entry's evidence with them, is gone — objectui#11439 retired it, so the client resolves one bundle entry the way packages/spec/src/system/i18n-resolver.ts#actionTranslationNode does."
1818
},
19+
"submitText": {
20+
"status": "planned",
21+
"verifiedAt": "2026-10-30",
22+
"authorWarn": true,
23+
"authorHint": "Keep it, but nothing reads it yet: no console draws an action's `submitText`, so the param dialog's button still says \"Confirm\" until the console's param dialog reads the key.",
24+
"evidence": "packages/spec/src/system/i18n-resolver.ts#translateAction overlays the translated `objects.{o}._actions.{a}.submitText` (or `globalActions.{a}.submitText`) onto the served action when it declares `params`; packages/spec/src/system/translation.zod.ts declares the translation slot; packages/lint/src/validate-translation-references.ts#checkActionSubmitText refuses a translation under an action with no `params`.",
25+
"note": "PLANNED until the console half of #27944 lands (spec PR first, console card second). The framework half is live — parse, blank refusal, the refusal without `params`, translation slot, translateAction overlay, the dangling-translation lint — but no renderer reads the key yet: ui/packages/app-shell/src/views/ActionParamDialog.tsx still draws `actionDialog.confirm`, fed by the two param-collection handlers (ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx#paramCollectionHandler, ui/packages/app-shell/src/views/RecordDetailView.tsx#paramCollectionHandler). `authorWarn` is set because an author who writes the key today sees \"Confirm\", not their verb. The console PR flips this row to `live` with those read points, and drops `authorWarn` / `authorHint` in that same edit (a warned `live` row reds this gate, #21127)."
26+
},
1927
"objectName": {
2028
"status": "live",
2129
"verifiedAt": "2026-09-15",

‎ui/packages/core/src/actions/actionKeys.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ export const SPEC_ACTION_KEYS = [
315315
// question.
316316
'requiresMembershipReach',
317317
'resultDialog',
318+
// Added to `ActionSchema` by objectstack#27944: the param dialog's submit
319+
// button label. Listed for this array's contract alone, like `description`
320+
// above; the dialog reading it is the console's own follow-up.
321+
'submitText',
318322
'successMessage',
319323
'target',
320324
'type',

0 commit comments

Comments
 (0)