Skip to content

Commit c935c78

Browse files
committed
Merge origin/main (K2 landed) into the component reference branch
# Conflicts: # content/docs/ui/index.mdx # content/docs/ui/meta.json
2 parents a6ea420 + 2f96d87 commit c935c78

18 files changed

Lines changed: 1348 additions & 60 deletions

File tree

‎content/docs/ai/skills.mdx‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,15 @@ ObjectStack provides **nine domain-specific skills**, one per protocol domain
131131

132132
The authoritative list (names, domains, and "use when / do not use" boundaries) is generated from each skill's `SKILL.md` frontmatter. See the **[AI Skills Reference](/docs/ai/skills-reference)** for the full catalog with per-skill detail.
133133

134+
The same package also carries **`objectui`**, the skill for the `@object-ui/*` React
135+
packages rather than for metadata: rendering JSON schemas with `SchemaRenderer`, writing
136+
renderer plugins, data-source integration, and testing, i18n and mobile layout in a React host.
137+
Its source is [`skills/objectui/`](https://github.com/objectstack-ai/objectstack/tree/main/skills/objectui):
138+
a `SKILL.md` entry point, `rules/` the agent always applies, `guides/` it loads per task, and an
139+
`evals/` prompt per guide that catches regressions in agent behaviour. Its frontmatter defers
140+
data modelling, APIs, automation, formulas and agents to the domain skills above, so the two
141+
coexist in one agent. It installs and updates with the rest of `@objectstack/skills`.
142+
134143
<Callout type="info">
135144
Lifecycle hooks, plugin development, and project bootstrap are **not** separate skills — they live in **Data** (record hooks) and **Platform** (plugins, kernel events, `defineStack`).
136145
</Callout>

‎content/docs/data-modeling/field-types.mdx‎

Lines changed: 353 additions & 0 deletions
Large diffs are not rendered by default.

‎content/docs/ui/actions.mdx‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,26 @@ strict params gate admits either bag without a word.
371371
ADR-0059), so any `FieldType` works — a `file` param shows a real upload
372372
control (`multiple` / `accept` / `maxSize` honored), `lookup` a record
373373
picker, `date` a date picker, `richtext` the rich-text editor, and so on.
374+
A field-backed param resolves the same way when the action is launched from a
375+
list's selection bar. Values reach the action as the widget emits them
376+
(`number` a number, `date` `YYYY-MM-DD`, a lookup the record id(s), a `file`
377+
the uploaded `sys_file` id(s), arrays when `multiple`), and the dialog's
378+
**Confirm** stays disabled while an upload is in flight. A param's `visible`
379+
is a CEL predicate over `features`, `current_user` and `data` that omits the
380+
param when false.
374381
- **`confirmText`** — confirmation dialog before running.
375382
- **`successMessage` / `errorMessage` / `refreshAfter`** — post-run feedback
376383
and an automatic data refresh.
384+
`successMessage` is a template whose holes are `{{ }}` over `result` (the
385+
handler's answer) and `record` (the record the action ran on):
386+
`'Invitation sent to {{ result.email }}'`; a `${…}` token in it is refused. A
387+
`type: 'api'` or `'script'` action whose handler can succeed in more than one
388+
way adds `outcomeMessages`, one entry per snake_case `outcome` the handler
389+
returns, each of which may read `${result.*}`; the toast shows the entry the
390+
answer names, else `successMessage`, else a generic "Action completed
391+
successfully". A `message` in the server's answer is shown only when the copy
392+
asks for it (`{{ result.message }}`). Post-success navigation is
393+
`onSuccess: { navigate, openIn }`.
377394
- **`undoable`** — on a single-record update, the success toast offers an
378395
**Undo** that restores the record's prior field values (`Ctrl+Z` works too).
379396
The runtime only captures the prior values when this flag is set, so an
@@ -437,6 +454,24 @@ is a spec proposal for a properly named key, not a values map under this one.
437454
[formulas guide](/docs/data-modeling/formulas) for CEL syntax.
438455
- **`requiresFeature`** ties visibility to a feature flag (compiled into a
439456
`visible` predicate).
457+
- **Relation fields bind as their id.** A `lookup`, `master_detail`, `user` or
458+
`tree` field reads in a predicate as the id the server stores, never as the
459+
record it points at, on every surface (a record page that expanded the
460+
relation for display collapses it again before evaluating). So "only the
461+
record's manager sees this" is `current_user.id == record.manager`;
462+
`record.manager.id` faults, because `record.manager` is a string. An empty
463+
relation is `null`, a clean `false`.
464+
- **`current_user.can(object, verb)`** asks whether the signed-in user holds an
465+
object permission, from the effective permissions the Console already holds
466+
for its built-in Edit and Delete, so a custom action that replaces one of
467+
them can be gated the same way: `visible: "current_user.can('account', 'delete')"`.
468+
The verb comes from the closed `OBJECT_PERMISSION_VERBS` table in
469+
`@objectstack/spec/security`; a verb outside it is a fault, not `false`.
470+
`current_user.hasCapability('<name>')` asks the capability question from the
471+
same payload. Until that payload has loaded both fault, so a `visible` gate
472+
stays closed and a `disabled` gate renders the button disabled until the
473+
answer arrives. In a UI gate they decide only what is shown: the server
474+
still enforces the request the action sends, as `requiredPermissions` does.
440475

441476
### Authorization inside an action
442477

‎content/docs/ui/apps.mdx‎

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,13 @@ nested `actionDef` block — `actionName` is **not** a top-level key on the item
192192
design** — the action owns its own parameter contract, so the app schema does
193193
not validate what goes inside it.
194194

195+
This is how an app-level action ("Quick Create", "Log a Call") is placed: the item
196+
names a declared action, it does not carry the action's definition. The Console
197+
renders it in the sidebar, and on click looks the name up among the declared
198+
actions and runs it through the same runner as a toolbar button, so confirmations,
199+
parameter dialogs and permission checks apply. An item that names no declared action
200+
shows an error when clicked rather than doing nothing.
201+
195202
### Component Navigation
196203

197204
Renders a registered component. `componentRef` is a component-registry key, not
@@ -277,6 +284,54 @@ rejected — a divider has nothing to label, gate, or badge.)
277284
| `requiresObject` | `string` | Hide/disable unless the named object is registered |
278285
| `requiresService` | `string` | Hide/disable unless the named kernel service is registered |
279286

287+
`label` is optional. An entry without one shows its target's **current** label,
288+
resolved when the navigation renders: the view's label for an entry that names a
289+
labelled view, else the object's or dashboard's label, else the target's machine
290+
name. A renamed object, view or dashboard therefore shows its new name on the next
291+
load with no navigation edit. Other entries fall back to their target's name
292+
(`pageName`, `reportName`, the `url`) and a group to its `id`, so give those a
293+
`label`. A `label` you write renders verbatim; never write an empty one, omit the
294+
key instead.
295+
296+
## Designing the navigation
297+
298+
The same requirement can often be met three ways: a plain object entry, an object
299+
entry anchored to a named view, or a page that embeds views. They are not
300+
interchangeable. For an app with a `project` object:
301+
302+
| You write | The user lands on | What comes with it |
303+
| :--- | :--- | :--- |
304+
| `{ type: 'object', objectName: 'project' }` | `/apps/my_app/project`, the object's default view | The whole object shell: view switcher, object actions, a create button, record routing, search and recents |
305+
| `… viewName: 'project.by_status'` | `/apps/my_app/project/view/project.by_status` | The same shell, opened on a named view; the user can still switch |
306+
| `… filters: { status: 'open' }` | `/apps/my_app/project/data?filter[status]=open`, the bare data surface | The conditions as removable chips over everything permissions allow, bound to no saved view; **Save as view** turns the slice into a named view |
307+
| `{ type: 'page', pageName: 'project_overview' }` | `/apps/my_app/page/project_overview` | Only the page. View switching, actions and record links are assembled by hand |
308+
309+
A page can imitate the other two, but it loses the object shell, and every later
310+
improvement to that shell (new actions, view switching, permission trimming) skips
311+
it. Use the least powerful construct that expresses the requirement:
312+
313+
1. **One plain `object` entry per core business object**, with no `viewName`: the
314+
default view is the view metadata's business, so navigation stays decoupled from
315+
presentation.
316+
2. **`viewName` when the entry is a named perspective** ("By Status", "Due This
317+
Week"): declare a named view and anchor the entry to it. It sets the entry point;
318+
it does not lock the user in.
319+
3. **`filters` for one-off or parameterized slices** (a drill-through, "assigned to
320+
me"): put the condition in the URL instead of authoring a view, and promote it to
321+
a named view only once it is curated and reused.
322+
4. **A page only for composition one view cannot express**: several objects side by
323+
side, KPI cards beside lists, onboarding content. A page that wraps one object's
324+
one view is an anti-pattern.
325+
5. **A `dashboard` for metrics and charts, a `report` for tabular analysis**, rather
326+
than pages of chart blocks.
327+
6. **One entry per target.** Don't offer an object through both a plain entry and a
328+
page wrapping its default view. If an object needs several entries, make each of
329+
them a named-view entry; mixing styles breaks the sidebar's active-state
330+
highlighting.
331+
332+
In a typical business app most entries are `object` entries; pages are for the home
333+
screen, onboarding and cross-object workbenches.
334+
280335
## Areas
281336

282337
An **area** partitions one app's navigation by business domain — Sales, Service,
@@ -683,9 +738,17 @@ branding: {
683738
| Property | Type | Description |
684739
| :--- | :--- | :--- |
685740
| `primaryColor` | `string` | Primary brand color (hex) |
686-
| `logo` | `string` | Logo image URL |
741+
| `accentColor` | `string` | Accent color (hex), for highlights and active states |
742+
| `logo` | `string` | Logo image URL: one square app icon, SVG preferred, at least 64 px. Each surface scales it; there is no second size or wordmark slot |
687743
| `favicon` | `string` | Favicon URL |
688744

745+
`branding` is the whole of an app's theming in metadata: the Console maps
746+
`primaryColor` and `accentColor` onto its `--primary` and `--accent` CSS variables.
747+
There is no theme document to author (the standalone `themes` collection was retired
748+
in 17.1). Both the app and `branding` are strict: a top-level `logo` or `theme` is
749+
refused with a pointer to `branding`, and a misspelled key inside `branding` is
750+
refused rather than dropped.
751+
689752
## Complete Example
690753

691754
{/* os:check */}

0 commit comments

Comments
 (0)