Skip to content

Commit 0609359

Browse files
committed
Merge origin/main into claude/project-thread-ae3krw
2 parents 872978b + b0ef25f commit 0609359

57 files changed

Lines changed: 2399 additions & 81 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the `relatedList` field description says what each value does on the parent record page (`false` hidden, `true`/absent an auxiliary panel, `'primary'` a full-width table in the detail body) and points at ADR-0085 for the layout, instead of naming the retired "Related" and "Details" tabs and the page's columns
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@objectstack/spec': minor
3+
---
4+
5+
feat(spec)!: an object extension's `fields` is keyed by the field map's own key grammar, so a field no object could declare is refused where it is written
6+
7+
`ObjectExtensionSchema.fields` was keyed by any string. The fields an extension adds are merged into the target object's field map, and every key of that map is lowercase snake_case: `ObjectSchema.fields` refuses any other. So an extension could add a field under a key (`Region Code`, `region-code`) that the target's own declaration could never hold.
8+
9+
Clause-②: no (narrowing) — `ObjectExtensionSchema` refuses a `fields` key outside the snake_case grammar of an object's `fields` keys, which it accepted. Nothing is widened, and no public export is added.
10+
11+
Metadata-protocol: narrowed (an object extension may no longer add a field under anything but a snake_case field name)
12+
13+
Skills-docs: updated here — `content/docs/data-modeling/object-extensions.mdx` ("Naming the fields you add") gains the key grammar. `skills/objectstack-data/SKILL.md` and its evals teach extension fields only as `region__c`, so every taught line stays true and no skill line changes.
14+
15+
<!-- adr-0087: registered object-extension-field-key-grammar-refused -->
16+
17+
**BREAKING** accept-set narrowing on `ObjectExtensionSchema` (`@objectstack/spec`), at every door that parses an object extension: `defineObjectExtension`, `defineStack({ objectExtensions })`, `os validate` and `os build`, and the `/api/v1/meta` `object_extension` save door. The marketplace install does not parse an extension with the schema (it judges a built artifact's `__c` suffixes and patch targets), so a package built after this change carries the refusal from `os build`.
18+
19+
- **Before.** `fields: { 'Region Code': { type: 'text', label: 'Region' } }` parsed in `defineStack`, whether or not the target was in the same stack, and `os validate` raised nothing on it. In a `.custom` package, `fields: { 'Region Code__c': … }` was saved and published by the `object_extension` doors, served on every object read, re-registered at boot, and stored values in a column of that name.
20+
- **Now.** One `invalid_key` issue at `fields.Region Code`, naming the grammar and an example. The key schema is the one `ObjectSchema.fields` and `fieldPatches` read, one constant, so the three cannot drift.
21+
- **Unchanged.** A snake_case key parses as before, `__c` included (`region_code__c`); where the `__c` suffix is required or refused is still judged by the doors' `__c` rule.
22+
- **Who sees it.** No extension in this repository's examples, skills, docs or templates writes such a key. A stored `object_extension` row that carries one no longer parses, so the sync that registers stored extensions counts it as an error and registers none of it, its `fieldPatches` included, and its next save is refused (422 `INVALID_METADATA`) until the field is renamed. `os migrate meta --stored` lists such a row beforehand, one TODO for each refused key at `fields.KEY`, and leaves it as stored for its owner to rename.
23+
24+
**FROM → TO.** `fields: { 'Region Code': { type: 'text', label: 'Region Code' } }` → `fields: { region_code: { type: 'text', label: 'Region Code' } }` (`region_code__c` in a customization package): key each added field by a lowercase snake_case name, and keep the display text in its `label`. Renaming a field that already stores values also means renaming every view, formula and caller that reads it. The upgrade guide entry is `object-extension-field-key-grammar-refused`.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
perf(app-shell): a record of an app built in the console reads the objects that point at it from the app bundle
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
An app created in the console has no package. Opening a record whose object has no declared record page read the whole object registry, so the synthesized page could find the objects that point at the record's object for its related lists: 553 KB of an 888 KB record open on the CRM example. When the app's navigation reaches the record's object, the app bundle already holds every object that points at it, so the route now reads those by name, from the bundle, together with the record's object and its lookup targets. The related lists are the same. The route still reads the registry for an object outside the app's navigation, with no bundle (draft preview, or a host without one), under a record drawer, and in an app that has a package.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the `ConnectorConnectionState.redirectUri` TSDoc names the service that sets it
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The `ConnectorConnectionState.redirectUri` docblock no longer says that no answer carries the key. It now names its producer: `AutomationServicePlugin.getConnectorConnection` in `@objectstack/service-automation` sets it whenever the redirect URI derivation has a base, and it is absent otherwise. Prose only: no type, schema or accepted value moves.
11+
12+
**Supersedes, in the same release.** The `@objectstack/spec` note "Declared ahead of the service" (until the automation service sets the key, no answer carries it) no longer holds: the `@objectstack/service-automation` note in this release says the connection read now answers `redirectUri`.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
fix(app-shell): an optional choice row in a Studio metadata form can be cleared again
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **A "— None —" item on optional enum selects.** Both builtin select paths of the metadata-admin `SchemaForm` (a form row's `options`, and a schema property's own `enum`) listed only the enum values, so once an author picked a value on an optional key, the form had no way back to "declares nothing". An optional row now leads with "— None —" (the `engine.form.none` word the metadata-admin pickers already use). Choosing it writes the key as absent, through the form's existing clear convention. A required row, and one element of a list of choices, are unchanged: they offer no None item.
11+
- **Clears in an inspector's "More fields" form are kept.** The action, dashboard, hook, page and report editors pass their "More fields" form's changes to a host that merges them over the draft. A key the form cleared was merely missing from that change, so the merge kept the old value: a None pick, or an emptied text box, was undone at once. The cleared keys now reach the draft as absent, and the saved metadata no longer carries them.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@object-ui/mobile': patch
3+
'@object-ui/i18n': patch
4+
'@object-ui/console': patch
5+
---
6+
7+
feat(console): the profile page shows the mobile shell's App lock and opens its settings screen
8+
9+
Clause-②: yes (widening)
10+
Metadata-protocol: none
11+
12+
Inside the ObjectStack mobile shell, a bridge that offers `openAppLockSettings()` now gets an "App lock" row on the profile page (`/system/profile` and the Account app's profile card). The row shows whether the lock is off, or on and after how long it locks, read from the shell's `getAppLock()`, and a tap opens the shell's native settings screen. The lock is the shell's own setting: the Console reads it and never changes it, so the row has no toggle. No event announces a change, so the page reads it again on mount, when it becomes visible again and when the window regains focus. In a plain browser, or a shell older than the app lock, the page is unchanged.
13+
14+
`@object-ui/mobile` adds the two optional bridge members, the `NativeAppLock` type and the `nativeGetAppLock` and `nativeOpenAppLockSettings` wrappers, which feature-detect with `has()` and never throw, like the other wrappers. `@object-ui/i18n` adds `profile.appLock.*` in all ten locale packs.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/console': patch
4+
---
5+
6+
fix(console): a push route from the mobile shell opens the record, hosted under an app the way the inbox hosts it
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
A push delivery carries the notification's link as `route`: app-relative (`/opportunity/123`) or already a Console route (`/apps/crm/opportunity/123`). The Console's listener for the mobile shell's navigate event moved its router to that route as written, so `/opportunity/123` matched no route and the person landed on Home instead of the record.
12+
13+
What changes:
14+
15+
- The listener resolves the route with the same resolver the inbox bell and Home use for that notification. An app-relative route is hosted under the app the person is in or last had open; an `/apps/...` route passes through unchanged.
16+
- With no app open yet (a tap that starts the app), the route goes to the router as given, and the Console's unmatched-route page hosts it under the default app once the app list has loaded: the app the person last had open while it is still active, else the first active app. The same page handles an app-relative path that arrives as the page's first URL, which the shell sends when it re-creates its web view at a held route or when no listener answered.
17+
- A path whose first segment names a Console route served outside an app (`/home`, `/dev`, `/studio`, ...) still redirects to `/`, as before. A path such as `/foo/bar` that names no Console route now opens `/apps/APP/foo/bar` (APP being that default app) instead of Home.
18+
- `@object-ui/app-shell` exports `resolveNotificationTarget`, its `NotificationTarget` type and `CONSOLE_ROOT_SEGMENTS` from the package root.
19+
20+
What to do: nothing.

‎content/docs/data-modeling/object-extensions.mdx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ reason.
160160

161161
## Naming the fields you add
162162

163+
Each key of an extension's `fields` is a field name of the target, so it follows the
164+
grammar of the target's own `fields` keys: lowercase snake_case, such as `region_code`
165+
(`region_code__c` in a `.custom` package). A key outside it (`Region Code`,
166+
`region-code`, a label) is refused when the extension parses, at `fields.<key>`.
167+
163168
Field names in an extension are **not** namespace-prefixed by the platform. The
164169
namespace rule (`<namespace>_<name>`) governs the names of objects a package *defines*;
165170
it does not walk `objectExtensions`, and it could not — the target's name belongs to

‎content/docs/references/data/field.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const result = CurrencyConfigSchema.parse(data);
8585
| **inlineTitle** | `string` | optional | Title for the inline master-detail grid |
8686
| **inlineColumns** | `{ name: string; label?: string; type?: Enum<'text' \| 'number' \| 'currency' \| 'date' \| 'datetime' \| 'time' \| 'select' \| 'lookup' \| 'file'>; width?: number; … }[]` | optional | Explicit columns for the inline grid (derived from the child object when omitted). Each entry is a strict, name-keyed column (`{ name, label?, type?, … }` — objectui GridColumn); identity-only entries (`{ name }`) hydrate everything else from the child object's fields. Unknown keys and the retired `field` spelling are refused at parse. |
8787
| **inlineAmountField** | `string` | optional | Numeric child field summed for the inline grid total |
88-
| **relatedList** | `boolean \| 'primary'` | optional | Show this child collection as a related list on the parent's detail page (read-side mirror of inlineEdit). false = suppress; true/absent = shown as a supporting list, a side card in the record's related column (the shared "Related" tab on the tabbed page); 'primary' = part of the record's main content, drawn in the record's body (the details column, after its first field section) as a full-width table (inside the Details tab on the tabbed page, with no tab of its own). Absent on a master_detail field that sets inlineEdit, the list is 'primary' by default; write true to keep it a side card. 'primary' places a list and does not order it: the parent object's relatedLists orders the body tables and the side cards (ADR-0085). A derived related list (relatedList: 'primary') inherits its row order from the child object's DEFAULT list view sort — the isDefault view, or the first declared list item when none is marked default; wire spelling is sort=`<field>` / sort=-`<field>`, never $orderby. A child object with no list-view sort emits no ordering parameter, and rows fall back to record-id order. |
88+
| **relatedList** | `boolean \| 'primary'` | optional | Show this child collection as a related list on the parent's detail page (read-side mirror of inlineEdit). false = the child object is not shown on the parent record page; true/absent = shown as an auxiliary panel on the record page; 'primary' = part of the record's main content, shown as a full-width table in the record's detail body. Absent on a master_detail field that sets inlineEdit, the list is 'primary' by default; write true to keep it an auxiliary panel. 'primary' places a list and does not order it: the parent object's relatedLists orders the full-width tables and the auxiliary panels. The page layout is defined by ADR-0085. A derived related list (relatedList: 'primary') inherits its row order from the child object's DEFAULT list view sort — the isDefault view, or the first declared list item when none is marked default; wire spelling is sort=`<field>` / sort=-`<field>`, never $orderby. A child object with no list-view sort emits no ordering parameter, and rows fall back to record-id order. |
8989
| **relatedListTitle** | `string` | optional | Title for the detail-page related list |
9090
| **relatedListColumns** | `string[]` | optional | Explicit columns for the detail-page related list, as child field names (e.g. ['name', 'status']); derived from the child object (highlightFields → field walk) when omitted. Strings only — labels, cell types and formatting always derive from the child object's field definitions; column objects are refused at parse. |
9191
| **relatedListFilter** | `any` | optional | Declarative default filter for the detail-page related list: AND-composed with the parent-relationship condition `{ [referenceField]: parentId }` — an authored constraint, never a user-editable suggestion. The related-list tab badge count honors the same composed filter, so counts match the visible rows. Canonical Query-DSL FilterCondition (the same dialect as a query `where`), e.g. `{ status: { $ne: 'deleted' } }` to hide soft-deleted children. |

0 commit comments

Comments
 (0)