You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 227a4be
Browse filesBrowse the repository at this point in the historyBrowse files
docs(skills): the objectstack-ui actions rule teaches pressed, the reader's own toggle state
A record header action can declare `pressed`, a CEL predicate over the same
scope as `visible` that the header draws as `aria-pressed` while it holds. The
rule says it is display only, that a boolean literal is refused, which spellings
rename onto it, and how a per-reader fact reaches it through an `attachedOnRead`
block. The addition is paid for inside the file: the bare-CEL paragraph folds
into the `visible` bullet, the `ctx` section drops the blessed-name code block
that restates the objectstack-data hooks reference, and the new-tab and
param-pattern prose is condensed.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibz4G9FrLR4TRExx6gn
Copy file name to clipboardExpand all lines: skills/objectstack-ui/rules/actions.md
+29-56Lines changed: 29 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,19 +15,15 @@
15
15
16
16
## Visibility, Disable & Feedback
17
17
18
-
-`visible` — CEL predicate (prefer the `P\`...\`` tagged template); when false the action is **hidden**.
18
+
-`visible` — a bare CEL predicate over the current record (prefer the `P\`...\`` template; `record.<field>` resolves identically on every surface, never `${…}`- or `{…}`-wrapped — see `objectstack-formula`); when false the action is **hidden**.
19
19
-`disabled` — `boolean`**or** a CEL predicate; when true the action **shows but greys out**. Use this (not `visible`) when the action should stay discoverable but locked in the current state.
20
-
-`disabledReason` — an I18nLabel (a plain sentence or an inline locale map) a greyed action shows as its hover title and accessible description. Display-only: never a predicate and never a gate (the hook or permission still refuses). Omit it to keep the console's default "Not available for this record"; a blank one is refused, and `disabledMessage` / `disabledTooltip` / `disabledHint` / `disabledText` are refused naming this key. The reason goes here, not in `description`.
20
+
-`disabledReason` — an I18nLabel (a sentence or an inline locale map) a greyed action shows as its hover title and accessible description. Display-only: never a predicate and never a gate (the hook or permission still refuses). Omit it to keep the console's default "Not available for this record"; a blank one is refused, and `disabledMessage` / `disabledTooltip` / `disabledHint` / `disabledText` are refused naming this key. The reason goes here, not in `description`.
21
+
-`pressed` — a CEL predicate over the same scope as `visible` that marks the action as already done by this reader: while TRUE the record header draws it pressed (`aria-pressed`). Display-only, never a gate; a boolean literal is refused (a constant is a style, not a reader's state), and `active` / `activeWhen` / `pressedWhen` are refused naming this key. A per-reader fact (the reader's vote) is a block the object declares under `attachedOnRead`, filled per caller by a service or `afterFind` hook, read as `has(record.viewer) && record.viewer.vote == 'helpful'`.
21
22
-`confirmText` — set for any destructive or irreversible operation.
22
-
-`successMessage` / `errorMessage` — toast copy on success / failure. Always set`successMessage` for non-obvious outcomes; without it the UI shows a generic "Action completed" toast.
23
+
-`successMessage` / `errorMessage` — toast copy on success / failure. Set`successMessage` for non-obvious outcomes; without it the UI shows a generic "Action completed" toast.
23
24
- Copy holes are `{{ }}`: `confirmText` reads `record`, `successMessage``record` and `result` (the handler's answer); `errorMessage` takes none. A `bulkActionDefs` entry's `confirmText` reads `{{ count }}` and its params by bare name (`{{ tier }}`). `${record.name}`, `{name}`, logic in a hole and a blank sentence fail `os validate`.
24
25
-`undoable: true` — an **Undo** in the success toast (and `Ctrl+Z`). Snapshot: runtime on `operation: 'update'`, console on `type: 'api'`; else refused.
25
26
26
-
Predicates are **bare CEL** — `record.status == "converted"`, evaluated against
27
-
the current record. `record.<field>` resolves identically on every surface
28
-
(`record_header`, `list_item`, …); prefer it over the bare-field form. Never
29
-
wrap a predicate in `${…}` or `{…}` braces (see `objectstack-formula`).
0 commit comments