Skip to content

Commit 21d81b6

Browse files
committed
test(metadata-protocol): /meta/types serves 49 action keys; name the console card on the planned row
The served action schema gains `pressed`, so the declared total moves 48 -> 49 and the sample names it. The liveness row and the docs callout name the console card that will draw the pressed face. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvXVNub8x3B5XhGFrP
1 parent 64d80fe commit 21d81b6

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ pressed: "has(record.viewer) && record.viewer.vote == 'helpful'"
367367
- A per-reader fact is usually not a column of the row (a vote is a child record per user). Declare it as a block under the object's `attachedOnRead`, have the serving side attach it to each row it returns for the caller (a service, or an `afterFind` hook that shapes the rows), and read it as `record.<block>.<leaf>`, guarded with `has()`. `os build` and `os validate` check the leaf against the declared block.
368368

369369
<Callout type="info">
370-
The spec, the build check and this contract are in place; the console's record header and declared actions bar do not draw the pressed face yet, so today the button looks the same whatever the predicate answers.
370+
The spec, the build check and this contract are in place; the console's record header and declared actions bar do not draw the pressed face yet ([#28242](https://github.com/objectstack-ai/objectstack/issues/28242)), so today the button looks the same whatever the predicate answers.
371371
</Callout>
372372

373373
#### Evaluation context

‎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+
// [#27946] 48 → 49: `pressed` (the reader's pressed-state predicate)
259+
// 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', 'pressed']) {
262264
expect(Object.keys(properties)).toContain(key);
263265
}
264266
});

‎packages/spec/liveness/action.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
"authorWarn": true,
166166
"authorHint": "Kept, but no console surface draws `pressed` yet: the button looks the same whatever the predicate answers. The predicate is still checked at build (record scope, declared fields and `attachedOnRead` blocks), so it is ready when the header buttons read it.",
167167
"evidence": "packages/spec/src/ui/action.zod.ts#pressed (the parse-time door: `EvaluatedExpressionInputSchema`, a CEL string normalized to the envelope, a boolean literal and the blank shapes refused); packages/lint/src/validate-expressions.ts#checkAction (the authoring gate at `os build` / `os validate` and the object save door: the predicate is judged in the `record` scope, and as a SERVED_ROW_SITES member a block the object declares under `attachedOnRead` resolves)",
168-
"note": "PLANNED — declared spec-first by #27946 (spec half; the console half is a follow-up domain:ui card). The reader to come is the record page header (`page:header` buttons) and `DeclaredActionsBar`, drawing the button with `aria-pressed` and a pressed face while the predicate is TRUE. Measured in this repo at origin/main 3a2f4c00: no source under ui/ reads `action.pressed` (the one hit is the inventory line in ui/packages/core/src/actions/actionKeys.ts SPEC_ACTION_KEYS, which restates the spec's declared keys and reads nothing), and no other package reads it. So an authored predicate draws nothing today; nothing is gated or stored differently, which is also the contract once it is live (display only). Flip to `live` on the console PR, citing its read points, and drop `authorWarn` / `authorHint` in the same edit (a warned `live` row reds this gate)."
168+
"note": "PLANNED — declared spec-first by #27946 (spec half; the console half is #28242, a domain:ui card). The reader to come is the record page header (`page:header` buttons) and `DeclaredActionsBar`, drawing the button with `aria-pressed` and a pressed face while the predicate is TRUE. Measured in this repo at origin/main 3a2f4c00: no source under ui/ reads `action.pressed` (the one hit is the inventory line in ui/packages/core/src/actions/actionKeys.ts SPEC_ACTION_KEYS, which restates the spec's declared keys and reads nothing), and no other package reads it. So an authored predicate draws nothing today; nothing is gated or stored differently, which is also the contract once it is live (display only). Flip to `live` on the #28242 console PR, citing its read points, and drop `authorWarn` / `authorHint` in the same edit (a warned `live` row reds this gate)."
169169
},
170170
"ai": {
171171
"status": "live",

0 commit comments

Comments
 (0)