Skip to content

Commit a5202dc

Browse files
committed
Merge origin/main into the #36903 rework (#37089's permission designer beside the flow designer)
Claude-Session: https://claude.ai/code/session_01QSeKYnHH41MS5hWVGPia4F Co-authored-by: Claude <noreply@anthropic.com>
2 parents 4c891e4 + bc3ec37 commit a5202dc

275 files changed

Lines changed: 13078 additions & 3793 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: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
'@objectstack/cli': minor
3+
'@objectstack/lint': minor
4+
'@objectstack/spec': minor
5+
---
6+
7+
feat(cli)!: `os validate` and `os build` refuse seed records the seed load would drop: one its own validation rule refuses, or a keyed one with a blank key field
8+
9+
Clause-②: yes (narrowing)
10+
Metadata-protocol: narrowed
11+
Skills-docs: follow-up #37158
12+
13+
<!-- adr-0087: registered seed-record-refused-before-load -->
14+
15+
**BREAKING** accept-set narrowing of two authoring doors, shipped as `minor`. FROM: `os validate` and `os build` exit 0 on a config one of whose seed records the seed load drops (its own validation rule refuses it, or it is keyed and leaves a key field blank). TO: both exit 1 and name the record, its object, its index and the refusing rule or the blank field. The load's own verdicts do not change. Fix: correct the record so its rule admits it, change the rule if the record is right, or give the record its key value.
16+
17+
A seed write is held to the object's own validation rules (every type but `state_machine`), and a record a rule refuses is dropped from the load while the rest land. Until now nothing at authoring time judged a seed record against those rules: `os validate` and `os build` passed, and the first sign was a `[Seeder] … dropped record(s)` line at boot carrying the rule's message, not its name. Both commands now refuse such a config (exit 1), one line per refusal (a record two rules refuse prints two), naming where the record sits, its index and the refusing rule:
18+
19+
```text
20+
✗ Seed records the seed load refuses (1 record)
21+
✗ data[0].records[1]: Seed record #1 of 'xt_payment' is refused by its validation rule 'amount_positive': A payment amount must be positive.
22+
```
23+
24+
The verdict is the write path's own evaluator, run on one rule at a time. A record and rule pair is judged only when the record's own literal values decide it; a pair whose rule reads something the load decides (a reference, a roll-up, formula or autonumber field, a default, a platform-injected column, an expression value, a present value of a non-literal type such as `date` or `datetime`, a `json_schema` rule, a `beforeInsert` hook's write, or the stored row of an `update` dataset) is counted in one dim line and never refused; a dataset whose object the stack does not declare has no rules to judge. A hook registered in plugin code is not visible to the stack, so a config that relies on one to fill a field a rule reads can be refused although the load admits it. Advisory rules (`warning` / `info`) and inactive rules are not judged.
25+
26+
A keyed record (every live mode: `ignore`, `upsert`, `update`) whose literal value for a key field is blank (no value, `null` or `''`) is refused the same way, in the sentence the seed loader refuses it with at load, naming the object, the record index and the field. A key field holding an expression is judged at load only, and so is the object's organization column, which the load stamps: a declared `tenancy.tenantField` the object has, else `organization_id`.
27+
28+
`--json` output carries the refusals under `errors` (`os validate`) or `issues` (`os build`), each with `rule` (`seed-row-refused-by-validation-rule` or `seed-record-key-field-blank`), `location`, `object`, `recordIndex`, and `validationRule` or `field`.
29+
30+
To fix a refused config: correct the record so its rule admits it, change the rule, or give the record its key value. `@objectstack/lint` exports the walk as `judgeSeedRowRefusals`, which takes the evaluator and the tenancy resolver (`resolveTenantFieldName`, `@objectstack/core`) as inputs.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
fix(console): a record page's tabs are arranged in the design mode, under its one bar; a list's draft actions read Reset / Update view
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
The design mode and the record page's 「Configure tabs」 each drew a purple bar with its own Cancel and Save, and the two stacked when both were open. A list's draft actions (Discard / Save) showed under the design mode's bar as a second page save. Following Twenty's grouping (the maintainer's ruling 「照 Twenty 归类」):
12+
13+
- The record page's tabs are part of the design mode. While the mode is on, the tab row of a record's desktop full page is the tabs editor in place, for an administrator who may arrange that object's tabs (the same gates as before: a workspace administrator who may author metadata, the desktop full page, not a drawer or pane, not an authored page, and the customization-door wall on an installed object). The draft is staged with the mode's other changes (the app menu, the header buttons): the mode's Save writes it with them, to the object's own package (`relatedLists`, published) or, on an installed object, to the base's paired `.custom` object extension, as before; the mode's Cancel drops it. The draft stays staged while the administrator moves to another page of the app. The record's ⋯ no longer offers 「Configure tabs」, and the separate 「Configure tabs」 bar is gone. A failed save says so through the mode's own message and keeps the draft staged.
14+
- A list's draft actions are the view's own, as Twenty's 「Reset / Update view」: they now read 「重置 / 更新视图」 (en: Reset / Update view; every bundled language pack is updated), and they stay drawn and live while the design mode is on. The Update view menu keeps 「Save to this view」 and 「Save as my view」. Where the open view cannot take the change (a view a read-only package ships, or a reader who may not write it), the button reads 「另存为我的视图」 (Save as my view), the one save its menu holds; on the phone's chip row it reads 「保存」 (Save) there, so the view switcher beside it keeps its name.
15+
16+
Locale values changed in `@object-ui/i18n` (no key added or removed): `console.objectView.draft.discard` and `console.objectView.draft.save`, in all eleven bundled packs. No props or package exports change. While a record's own edit state is open, its tab row is not the tabs editor.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
feat(studio): a permission set opens full-screen at its metadata address; the record-visibility overview gets its own route
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A permission set in Studio now opens at its own address, `/studio/PACKAGE/metadata/permission/NAME`, full-screen beside the left menu, instead of the Access pillar's rail and workbench. The header is the one every full-screen item page has: × back to the list of sets (its filters kept), ‹ › through it, the set's label (its machine name on the title's tooltip), type and package, and a ⋯ menu. The Access pillar's own page and its list of sets are gone. The tab row is the matrix's five sections (Objects, System capabilities, Row-level security, Tab visibility, Delegated admin), then References, History and Source; History replaces the matrix's History sheet and is addressable (`?tab=history`). Save stays the Studio top bar's, and leaving with unsaved edits (×, ‹ ›, the menu, a reload, closing the tab) asks first; the browser's Back button does not ask.
11+
12+
What the pillar drew around the matrix comes along: Discard draft, Explain access, the suggested-audience strip, and on a read-only base "New similar", now in ⋯ and also on each of the base's rows in the list of sets; the copy opens at its own address with the strip saying where it landed. A draft the AI assistant left (copilot or MCP) shows the designers' notice, and 「放弃 AI 的改动」 drops that one set's draft; a person's own leftover draft keeps Discard draft.
13+
14+
The organization-wide default sharing overview ("Who can see which records") is a page of its own, `/studio/PACKAGE/owd`, the Access group's menu entry; a set's per-object visibility badge opens it on that object (`?object=NAME`).
15+
16+
Old addresses keep working: `/studio/PACKAGE/access?surface=permission:NAME` redirects to the set's address (a set a read-only base's `.custom` pair adds, a "New similar" copy among them, to the pair's address, where it opens writable as the pillar opened it), `?surface=owd:overview` to the overview, and a bare `/studio/PACKAGE/access` to the list of sets; other query parameters are kept. `/studio/PACKAGE/metadata/permission/NAME/history` opens the History tab. The cross-package leg (`/studio/~all/...`) keeps the matrix's environment page. No locale keys, props of published packages or exports change: the catalogue rows only the Access pillar read stay in `@object-ui/i18n`, unread.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/plugin-grid': patch
3+
---
4+
5+
fix(plugin-grid): the row menu offers no Edit on a row held by a locking approval
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A grid row whose record is held by its own pending approval with `lockRecord: true` is refused `RECORD_LOCKED` when it is updated. Its row menu still offered Edit, on the list page and on a record page's related tab. The menu now reads the same lock the grid's cells read (`POST /api/v1/approvals/records/:object/locks`), once per page, when a row's actions are first reached for. A row the lock read answered as locked offers no Edit, as the record page offers none. Delete stays, because a record held by its own approval may be deleted, and the delete cancels the request. The lock read does not report a detail line held because its master is held, so such lines keep both Edit and Delete in this menu, and the server refuses both. When the lock cannot be read, the menu stays as it was: no approvals service (501), a row the reader cannot read, a failed read, or a read not yet asked.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
'@object-ui/fields': patch
3+
---
4+
5+
fix(fields): a `lookupAutofill` written by hand on a standalone form node's field is not run
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No schema key, accepted value or metadata type is added, removed or renamed, and nothing stored is rewritten: `lookupAutofill` on a form field was never in a declared accept set. What narrows is the runtime behaviour of @object-ui/fields (`readLookupAutofillTargets`, and `LookupField` handed `onAutofill`), whose consumer is code, not metadata an upgrade could rewrite. This body does carry a code-level prescription (the FROM, TO and Fix lines below, written without an arrow), so the gate admits this marker on a detector miss, not on a checked fact: no fact-based category covers a runtime function whose behaviour narrows (`runtime-interface-only` reads exported types, `runtime-export-retired` reads an export that is gone). The vocabulary gap is #37136. -->
11+
12+
`lookupAutofill` is a fact about the object, and it runs where the object is read: in a record form and in a line-item grid column. A lookup on a standalone `form` node whose field carries `lookupAutofill` written by hand now fills nothing when a record is picked. The lookup itself is still set. Before, such a pick copied values into the other fields without the cross-currency rule, so an amount could be copied into a field in another currency with no note. A development build now warns once, naming the field and saying where the key is honoured.
13+
14+
Record forms and grid columns behave as before, the cross-currency rule included. The widget recognises a record form by the stamp the record form puts on its lookups (`withLookupAutofillTargets`). That stamp is now written on every lookup that declares pairs, including when no target is a field of the loaded object, and only a stamp the record form issued counts. A `lookupAutofillTargets` key written as data is ignored.
15+
16+
No metadata key is added or changed. Fix: declare `lookupAutofill` on the object's lookup field and draw the object's form.
17+
18+
**BREAKING** (`@object-ui/fields`, the `lookup` and `master_detail` widgets): `LookupField` handed an `onAutofill` writer runs its field's `lookupAutofill` pairs only when the record form stamped the field.
19+
20+
- FROM: a single-value pick, and the opening fill of a create form that opened with the lookup set, filled the declared targets whenever the host handed `onAutofill` (and no `onSelectRecord`) and the field carried `lookupAutofill` pairs.
21+
- TO: it also needs the stamp `withLookupAutofillTargets` issues, which the record form applies to every field it draws. A host that hands `onAutofill` without that stamp, such as a standalone `form` node, sets the lookup and fills nothing, on a pick and on the opening fill alike, and a development build warns once per field.
22+
- Fix: stamp the field through `withLookupAutofillTargets(field, objectFields)` before handing it to the widget, passing the object's field map as the record form does. With no map the stamp names no target, so the pick copies without the cross-currency rule, which is the copy this change stops. Or declare `lookupAutofill` on the object field and draw the object's record form.
23+
24+
**BREAKING** (`@object-ui/fields`, runtime export): `readLookupAutofillTargets(field)` now answers only for a target map that `withLookupAutofillTargets` issued.
25+
26+
- FROM: `readLookupAutofillTargets(field)` returned any non-array object found under the field's `lookupAutofillTargets` key.
27+
- TO: it returns only the map `withLookupAutofillTargets` stamped, which is what the record form does. A same-name key written by hand reads `undefined`. `withLookupAutofillTargets` now also stamps a lookup whose pairs name no field of the map it is given, with an empty map. Before, it returned the field unchanged. The map it stamps is frozen, and a field with pairs always comes back as a copy.
28+
- Fix: stamp the field through `withLookupAutofillTargets`, as the record form does. If you need the raw value, read `field.lookupAutofillTargets` directly.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/core': patch
4+
---
5+
6+
Clause-②: no
7+
Metadata-protocol: none
8+
9+
Two more import row refusals are now sentences of the built-in validation message catalog (`BUILTIN_VALIDATION_MESSAGES`, all four platform locales) and name fields by their label instead of their API name, the same way the duplicate-match-key row does. Each reads in the caller's locale when the caller carries one and in English otherwise, and a deployment override reaches it only where the caller passes a translator. A row blank on every ordered key set (`BLANK_MATCH_KEY`) reads the new `import_blank_match_key` entry, naming each key set by label (`Email; Phone + Company`); its caller is the import endpoint (`POST /data/:object/import` with ordered key sets), which passes the request locale and the deployment's translator, so it reads in the request language and can be overridden under `validation.field.import_blank_match_key`. A run whose match key names a field holding a list or a structured value fails every row with the new `import_multi_value_match_key` entry, naming those fields by label; its only callers are the ones that reach the import runner without the import door (the connector and datasource pulls), which pass no request locale and no translator, so there it reads in English and `validation.field.import_multi_value_match_key` is not consulted. A deployment override of any of the three match-key sentences can name the API names as `{{field}}`. The rows keep their shape and codes (`BLANK_MATCH_KEY`, `VALIDATION_ERROR`), and the multi-value row's `field` still carries the API name; only the `error` text changes. The import door's own `400 INVALID_REQUEST` refusal of such a key is unchanged.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
fix(console): re-ticking a dashboard card's "Apply" for a page filter restores the field the app binds it to, so an opt-out can be undone
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
In the dashboard's own edit state (and in Studio's dashboard editor), unticking "Apply" under a card's "Follows the filters at the top of the page" writes the card's opt-out (`filterBindings: { NAME: false }`). Ticking it again used to drop the entry, which makes the card follow the filter's own field rather than the field the app binds it to. A dashboard save stores the whole document, so the re-target the app ships (for example `dateRange: 'signed_on'` on a card whose dataset has no `issued_on`) was lost: the save then bound the card to a field its dataset lacks, the publish was refused (`dashboard-filter-field-unknown`), and the opt-out stayed in force with no way to undo it from the editor.
11+
12+
Re-ticking now restores the binding the dashboard as shipped by its package gives that card (the layered read's `code` layer) when it re-targets the filter to a field; where the shipped card opts out too, or binds nothing, the entry is dropped as before. The edit state reads the shipped layer in the same layered read it opens the document from, and Studio's editor hands it to the card panel from the read it already makes. Nothing else a save writes changes, and no new strings.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@object-ui/plugin-list': patch
3+
---
4+
5+
fix(plugin-list): a date condition's value reads as a date in the viewer's language
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A list condition chip on a date field printed the stored value as written, so a
11+
drilled dashboard bucket read 「创建时间:≥ 2026-10-01T00:00:00.000Z」 in a zh-CN
12+
session. Every condition row (the reader's chips and the view's locked chips) now
13+
formats a date-family value by the field's type through the console's one date
14+
display path (`formatDate` / `formatDateTime` from `@object-ui/core`), in the
15+
display locale: a `date` field shows the day with its year (an instant at UTC
16+
midnight shows that calendar day in every zone), a `datetime` field shows the
17+
date and time in the display zone, and a `time` field or an unreadable value is
18+
shown as written. The filter the list sends is unchanged.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@objectstack/plugin-approvals': patch
3+
'@objectstack/spec': patch
4+
---
5+
6+
fix(plugin-approvals): the batch lock read answers a line of a held master as locked, as the single read does
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
`getRecordLocks` (`POST /api/v1/approvals/records/:object/locks`) answered `locked: false` for a master-detail line whose master is held by a locking approval, while `getRecordLock` answered `locked: true` and the line's write was refused `RECORD_LOCKED`. The batch read now asks the detail-row lock too, through its new batch form `detailRowsHeldByLockingApproval`: one read of the rows' master-detail columns plus one lookup per master-detail edge, whatever the page size, never one read per row. The answer's shape is unchanged (`{ locked }` or `null`); a list page that reads the batch door now stops offering an editor on such a line. The `getRecordLock` / `getRecordLocks` contract docblocks in `@objectstack/spec` now say a line of a held master answers `true`.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the data and UI skills no longer teach a boolean `inlineEdit` on a master-detail relationship
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
objectstack-data's `rules/relationships.md`, "Inline-edit form factor": the `inlineEdit: true // auto (default)` line is gone, and the smart default is now described as what an omitted key gets, with a note that a boolean is refused. The spec parse refuses `true` and `false` on a relationship field's `inlineEdit` since 18.7.0; only `'grid'` and `'form'` are accepted, and leaving the key out picks the form factor from the child's shape. `evals/objects-fields-relationships.json` case 25 drops the same `true` from its expected answer. objectstack-ui's `rules/list-views.md`, Master-Detail Forms: the pointer to that section no longer lists `true` beside `'grid'` and `'form'`; it says `'grid'` / `'form'` or left out.

0 commit comments

Comments
 (0)