Skip to content

Commit e799ec7

Browse files
committed
docs(skills): keep the Convert Lead successMessage its eval reads; pay with other cuts
Claude-Session: https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr Co-authored-by: Claude <noreply@anthropic.com>
1 parent fa749f9 commit e799ec7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎.changeset/37057-actionlayout-validate-scope.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ docs(skills): objectstack-ui says where `os validate` judges `actionLayout` name
77
Clause-②: no
88
Metadata-protocol: none
99

10-
objectstack-ui's `rules/actions.md`, "Button Order (`actionLayout`)": the sentence "`os validate` refuses a name the arm's scope does not place" now says where that holds: on the object, or on an extension of an object the same stack defines. The next sentence, on the paired `.custom` package's extension of an installed object, now says those names are not judged there and that a wrong name draws nothing. The rule itself is unchanged; the text said more than the rule does. Three example lines that repeated a key another example in the file already shows were removed to pay for the new words (the Convert Lead `successMessage`, the Add to Campaign `icon` and `successMessage`).
10+
objectstack-ui's `rules/actions.md`, "Button Order (`actionLayout`)": the sentence "`os validate` refuses a name the arm's scope does not place" now says where that holds: on the object, or on an extension of an object the same stack defines. The next sentence, on the paired `.custom` package's extension of an installed object, now says those names are not judged there and that a wrong name draws nothing. The rule itself is unchanged; the text said more than the rule does. Three Add to Campaign example lines that repeated a key another example in the file already shows (`icon`, `successMessage`, `refreshAfter`) and the gloss "(the handler's answer)" on the copy-holes bullet, which the `resultDialog` bullet above it already says, were removed to pay for the new words.

‎skills/objectstack-ui/rules/actions.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ there: a wrong name draws nothing.
5151
- `preflight` — a read the param dialog shows above the params before submit: `{ read: { url }, path?, fields?, seed? }` sends one `GET` (no other `method`, no body or credentials) to a same-origin API path (one leading `/`) whose only holes are `${param.NAME}` (a declared param; re-read when it changes), `${ctx.recordId}` and `${ctx.record.FIELD}`. `path` selects the answer's sub-tree (`data`); `fields` rows are `resultDialog.fields`' (omitted: JSON). Each `seed: [{ param, path }]` entry fills a declared param, drawn read-only and submitted as shown: seeded once, no `defaultValue` / `defaultFromRow` / `carryOver`, read by no hole; mark it `required` so Confirm waits for the answer. Refused without a non-empty `params` and beside `execution: 'aggregate'`. UX, not authorization: the endpoint still checks a seeded value.
5252
- `resultDialog` — a one-shot dialog that shows the server answer in place of the success toast (so no `successMessage`; `outcomeMessages` is refused beside it): `{ title?, description?, acknowledge?, format?, fields? }`. `fields: [{ path, label?, format? }]`, `path` a dot path into `result.data` (omitted: the whole answer as JSON); `format` is one of `qrcode`, `code-list`, `secret`, `text`, `json`, or `table` with `columns: [{ path, label?, format? }]` (one row per element of the array at `path`, one cell per column; required with `table` and refused beside any other format). The dialog-level `format` (default `json`) and a cell's (default `text`) take every format but `table`. A `text` or `code-list` cell draws the value with no copy control; a `secret` or `qrcode` cell keeps its own.
5353
- `successMessage` / `errorMessage` — toast copy; without `successMessage` the UI shows a generic "Action completed".
54-
- Copy holes are `{{ }}`: `confirmText`, `description` and a param's `helpText` read `record`; `successMessage` and each `outcomeMessages` entry (`resent: 'Invitation resent to {{ result.email }}'`) read `result` (the handler's answer) and `record`; `errorMessage` takes none. A `bulkActionDefs` entry's `confirmText` reads `{{ count }}` and its params by bare name (`{{ tier }}`). In all of them `${record.name}`, `{name}`, logic in a hole and a blank sentence fail `os validate`.
54+
- Copy holes are `{{ }}`: `confirmText`, `description` and a param's `helpText` read `record`; `successMessage` and each `outcomeMessages` entry (`resent: 'Invitation resent to {{ result.email }}'`) read `result` and `record`; `errorMessage` takes none. A `bulkActionDefs` entry's `confirmText` reads `{{ count }}` and its params by bare name (`{{ tier }}`). In all of them `${record.name}`, `{name}`, logic in a hole and a blank sentence fail `os validate`.
5555
- A param's `helpText`, like `description`, is a sentence or an inline locale map (`{ en: 'Why {{ record.name }} is paused', 'zh-CN': '暂停原因' }`); the map is how a page button's inline `action` (no bundle reaches it) writes its hint per locale.
5656
- `undoable: true` — an **Undo** in the success toast (and `Ctrl+Z`). Snapshot: runtime on `operation: 'update'`, console on `type: 'api'`; else refused.
5757
- A list view's `bulkActions: ['<name>']` runs the action once per ticked row. A body that writes each selected row takes that form: declare `execution: 'perRecord'` and write the row it is handed (`ctx.record`, `ctx.recordId`; `crm_create_campaign` below); a row whose run throws is listed with its message. A `bulkActionDefs` entry `{ name, operation: 'custom', execution: 'aggregate' }` runs it once for the selection. A script body or a flow receives the ids under the built-in key `params._selectedIds` (`input._selectedIds`), at most 5000 and only ids the caller can read: one the caller cannot read refuses the whole call (`404 RECORD_NOT_FOUND`) before it starts. A throw is one outcome for the selection; a return value's top-level `succeeded` or `failed` is read as a `BulkActionResult` (`@objectstack/spec/ui`), and in any other form (counts, one list) reported as unreadable.
@@ -97,6 +97,7 @@ export const ConvertLeadAction = defineAction({
9797
locations: ['record_header', 'list_item'],
9898
visible: P`record.status == "qualified" && record.is_converted == false`,
9999
confirmText: 'Are you sure you want to convert this lead?',
100+
successMessage: 'Lead converted successfully!',
100101
onSuccess: { navigate: '/apps/crm_enterprise/opportunity/record/${result.output.opportunity_id}' },
101102
refreshAfter: true,
102103
});
@@ -125,7 +126,6 @@ export const AddToCampaignAction = defineAction({
125126
capabilities: ['api.write'],
126127
timeoutMs: 10000,
127128
},
128-
refreshAfter: true,
129129
});
130130
```
131131

0 commit comments

Comments
 (0)