Skip to content

Commit 046762e

Browse files
committed
Merge origin/main into claude/issue-36904-object-designer-fullscreen
#37089 (the permission designer) landed first: one designer-page list now holds both types, AREA_DESIGNER_PAGE_TYPES = ['permission', 'object']. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYoFqGdRM9Qmg7M2o2B
2 parents 562d068 + bc3ec37 commit 046762e

375 files changed

Lines changed: 16254 additions & 4017 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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the `IApprovalService.handleActionPage` contract names the reason a reject link's POST now carries
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Documentation only; no type, schema or export changes. The docblock shipped in `@objectstack/spec`'s contract types now matches what the ADR-0043 action page does since the reject-reason change in `@objectstack/plugin-approvals`:
11+
12+
- The confirm page for a reject link carries a required reason field, and the `POST` reads it from the form's `comment` field beside `token` (the last of each when a field repeats).
13+
- A reject whose `comment` is missing, blank or not a string is answered the same confirm page again with status `400` (redemption outcome `reason_required`): nothing is decided and the token is not consumed. A dead link is still told on its result page with `200`.
14+
- An approve link reads no `comment` and records the fixed comment "Via action link".
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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@object-ui/plugin-chatbot': patch
4+
'@object-ui/app-shell': patch
5+
'@object-ui/i18n': patch
6+
---
7+
8+
feat(console): a chat conversation can be pinned to one record — sent as `context.focus` on every turn, shown as a chip in the composer, kept across navigation — where the agent declares `capabilities.focus`
9+
10+
Clause-②: yes
11+
Metadata-protocol: added
12+
13+
**Contract (`@objectstack/spec`).** `ToolExecutionContext` gains `focus?: { object: string; id: string }[]`, beside `surfaceContext`: the record(s) the conversation is pinned to, as the client reports them on every turn. Client-reported and advisory, never an access decision; a consumer re-reads the record as the caller. At most one entry in phase 1. The agent catalog row (`AiAgentCapabilitiesSchema`, `GET /api/v1/ai/agents`) gains an optional `capabilities.focus: boolean`: an agent that honours the focus says so, and an absent flag reads as false. Both are additions; nothing is removed or renamed, and every catalog row served before the flag still parses.
14+
15+
**Console (`@object-ui/app-shell`, `@object-ui/plugin-chatbot`, `@object-ui/i18n`).** Where the agent the chat runs declares `capabilities.focus: true`:
16+
17+
- The composer's page chip is drawn in the row above the input (where the drafts line sits) instead of on the input's top edge, and carries a pin when the page shows one record (a record page, or a record open in a list's drawer). Pinning makes every later turn send `context.focus: [{ object, id }]`, the first turn of a new conversation included, until the user removes it with the chip's remove control.
18+
- The pinned record's chip replaces the page chip and names the record by its display name, read in the browser as the user; a record the user cannot read keeps its `object · id` pair.
19+
- Opening another record while one is pinned asks once whether to ask about that one instead; a decline is remembered for the conversation.
20+
- The focus belongs to the conversation: it never changes which conversation the drawer shows, and it is restored when that conversation is shown again in the same tab.
21+
- `setChatFocus({ object, id })` (exported from `@object-ui/app-shell`) is the setter every entry point pins through.
22+
23+
Where the agent does not declare the flag — every server today — nothing changes: no pin, no chip, no `focus` key in the request, and the page chip stays where it was. `AgentCapabilities` in `@object-ui/plugin-chatbot` gains `focus`, read from the catalog; unlike the build-era capabilities it has no name-based fallback for older servers. New locale keys `console.ai.focus.pin`, `.pinned`, `.remove`, `.switchPrompt`, `.switchAccept` and `.switchDecline`, in every pack.

0 commit comments

Comments
 (0)