Skip to content

Commit ae0e43b

Browse files
committed
Merge origin/main into claude/project-thread-j77l7i (#36183 type size and weight sweep)
Conflicts, all on the retired rail, resolved to this branch's side: - ui/packages/plugin-detail/src/RecordSummaryRail.tsx: deleted here; main's one sweep line (card title text-[13px] font-semibold -> text-sm font-medium) goes with the file. No rail markup moved into the pinned layout. - ui/e2e/record-tabs-35595.spec.ts (renamed here from record-tabs-rail-35595): main moved the rail card's title pin 13px -> 14px; that test is gone here. - RecordPageColumns.test.tsx: main moved the rail card title pin text-[13px] -> text-sm; that rail test is gone here. - RecordTimelinePanel.chatterInset-34676.test.tsx: main moved the rail peek row pin text-[12.5px] -> text-sm; that rail test is gone here. One pin moved by the sweep: in the pinned 1024 e2e test, the 400 px tab column after the drag holds four tabs at 14 px (five at 13 px), so quote.account_id moved into 「更多」. The CONTROL now opens the last tab still on the row instead of naming quote.account_id. Sweep kept: every line #36183 changed in a file this branch also changes (RecordDetailView.tsx, RecordApprovalsPanel.tsx) is present unchanged in the merge. No source file this branch adds or rewrites holds a size or weight the sweep maps (text-[9|10|10.5|11|11.5|12.5|13|15|17px], font-semibold, font-bold), checked file by file against main. Claude-Session: https://claude.ai/code/session_01L6bhgUZTwDqtEFzNFCVTri Co-authored-by: Claude <noreply@anthropic.com>
2 parents 241f4b2 + 6c7c6db commit ae0e43b

167 files changed

Lines changed: 2291 additions & 437 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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@objectstack/core': patch
3+
'@objectstack/rest': patch
4+
'@objectstack/client': patch
5+
'@objectstack/spec': patch
6+
'@objectstack/service-messaging': patch
7+
---
8+
9+
feat(rest): Change Owner endpoint — hand one record or a list of records to another owner, on objects that offer the action
10+
11+
Clause-②: yes (widening)
12+
Metadata-protocol: none
13+
14+
Two new doors under the data surface, both run as the caller:
15+
16+
- `POST /api/v1/data/:object/:id/change-owner` with `{ ownerId | queue, notify? }` hands one record to a person or moves it to an ownership queue (ADR-0142), and answers the record's new owner.
17+
- `POST /api/v1/data/:object/change-owner` with `{ ids, ownerId | queue, notify? }` does the same for up to 500 records, one update per record, and answers a per-row report that lists every record that did not move with its code and sentence.
18+
19+
An object offers Change Owner when the platform gives it a reassignable owner and its `userActions.transfer` switch is on (on by default, off on a `controlled_by_parent` detail). Any other object is refused as a whole, `403 CHANGE_OWNER_DISABLED`, whoever asks — a holder of `modifyAllRecords` included. The switch gates this action only: a plain `owner_id` update still needs the transfer grant and nothing else, so imports and hooks are unaffected. On an object that offers it, each record moves through the ordinary write path, so the caller needs edit on the record and the transfer grant (`allowTransfer` or `modifyAllRecords`); without the grant the record keeps its owner and the answer is the data door's own `403 PERMISSION_DENIED`. `notify: true` sends the new owner one notification under the `record.owner_changed` topic, its title keyed so it renders in the new owner's own language (English when no entry renders).
20+
21+
`@objectstack/core` exports `changeRecordOwner`, `changeRecordsOwner`, `changeOwnerOffReason`, `changeOwnerOffRefusal`, `CHANGE_OWNER_DISABLED`, `CHANGE_OWNER_NOTIFICATION_TOPIC`, `CHANGE_OWNER_NOTIFICATION_TEXT` and `assertAssignableUser` (the assigned-work hand-over's target check, now shared). That check now reads the target user the way the write path reads a user reference: a user the caller cannot read answers as one that does not exist (`404`, `reference_not_found`), on Change Owner and on the hand-over alike. `@objectstack/client` adds `data.changeOwner` and `data.changeOwnerMany`. `@objectstack/spec` registers `CHANGE_OWNER_DISABLED` in the error-code ledger, and the `userActions.transfer` liveness row is now `live`. `@objectstack/service-messaging` lists `record.owner_changed` among the platform's notification topics and carries the notice's title in every shipped locale (`messages.recordOwnerChangedTitle`, `messages.recordsOwnerChangedTitle`).
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@object-ui/console': patch
3+
'@object-ui/app-shell': patch
4+
'@object-ui/components': patch
5+
'@object-ui/fields': patch
6+
'@object-ui/plugin-detail': patch
7+
'@object-ui/plugin-form': patch
8+
'@object-ui/plugin-grid': patch
9+
'@object-ui/plugin-kanban': patch
10+
'@object-ui/plugin-list': patch
11+
---
12+
13+
feat(ui): the console's pages set text in two sizes, 14 and 12, and two weights, 400 and 500
14+
15+
Clause-②: no
16+
Metadata-protocol: none
17+
18+
- **Two sizes.** Body text, list cells, field values, inputs, menu items, toolbar controls and buttons are 14px (`text-sm`); field labels, column headers, counts, timestamps, hints and chip text are 12px (`text-xs`). The hard-coded 13px is gone from the console's runtime pages, and the 10px, 11px and other odd sizes there are 12px. The in-cell editor is 14px, like the cell it edits.
19+
- **Two weights.** Record names, tabs, buttons, section titles and column headers are 500 (`font-medium`); body text is 400. Weight 600 and 700 stay only on page and dialog titles 18px and larger. `DropdownMenuLabel` is weight 500 through a declared local patch on the Shadcn primitive (`dropdown-menu-label-medium-weight` in `ui/scripts/shadcn-local-patches.mjs`), so it survives a registry sync.
20+
- **Not changed:** Studio and metadata administration internals, the settings pages, developer tools, phone-only layouts, avatar initials, authored markdown and SDUI heading typography, the docs reader's prose size, and the shape of coloured option badges (still pills).
21+
- A list column with no declared width measures its content, so it grows with the 14px text; a column whose width a view or a user set keeps that width and shows about 8% fewer characters before it truncates.

‎content/docs/api/data-api.mdx‎

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,85 @@ single create.
455455

456456
---
457457

458+
### `POST /data/:object/:id/change-owner`
459+
460+
Hand one record to another person, or move it into an ownership queue
461+
(ADR-0142). The record is written by id, as the caller, through the ordinary
462+
write path: the caller needs edit on the record **and** the transfer grant
463+
(`allowTransfer` on the object, or `modifyAllRecords`). Without the grant the
464+
record keeps its owner and the answer is the data door's own
465+
`403 PERMISSION_DENIED`, exactly as a `PATCH` of `owner_id` would answer.
466+
467+
Offered only on an object the platform gives a reassignable owner and whose
468+
`userActions.transfer` switch is on. The switch defaults to on, and to off on a
469+
`controlled_by_parent` detail. Any other object is refused as a whole with
470+
`403 CHANGE_OWNER_DISABLED`, whoever asks, a `modifyAllRecords` holder
471+
included. The switch gates this action only: a plain `owner_id` update (an
472+
import, a hook, a `PATCH`) still needs the transfer grant and nothing else.
473+
474+
**Body**: exactly one target, and an optional notification.
475+
476+
```json
477+
{ "ownerId": "usr_123", "notify": true }
478+
```
479+
480+
```json
481+
{ "queue": "support_triage" }
482+
```
483+
484+
- `ownerId`: the new owner. A user the caller cannot read, or one that does
485+
not exist, is refused `404 RESOURCE_NOT_FOUND`; a banned user `400
486+
VALIDATION_ERROR`. Both name `ownerId` in `details.fields`.
487+
- `queue`: an ownership queue's name. The record is written with no owner and
488+
that queue; an object without a `queue` column refuses it `400`.
489+
- `notify` (default `false`): send the new owner one notification under the
490+
`record.owner_changed` topic, in their own language. Not allowed with
491+
`queue`. A notification that cannot be sent never fails the transfer.
492+
493+
**Response** `200`:
494+
495+
```json
496+
{ "success": true, "data": { "object": "lead", "id": "lead_1", "ownerId": "usr_123", "notified": true } }
497+
```
498+
499+
A queue move answers `"ownerId": null, "queue": "support_triage"`.
500+
501+
### `POST /data/:object/change-owner`
502+
503+
The same for a list of records: one by-id update per record, each under the
504+
same rules as the single route. Takes up to **500** ids; an empty list, a list
505+
over 500 and a list naming an id twice are refused `400` before anything is
506+
written. An object that does not offer Change Owner is refused as a whole,
507+
`403 CHANGE_OWNER_DISABLED`, before any record is read.
508+
509+
**Body**: `{ "ids": ["lead_1", "lead_2"], "ownerId": "usr_123", "notify": true }`
510+
(or `queue` in place of `ownerId`).
511+
512+
**Response** `200`, with a report: every record that did not move is listed
513+
with the code and sentence its own update was refused with. None is skipped.
514+
515+
```json
516+
{
517+
"success": true,
518+
"data": {
519+
"object": "lead",
520+
"field": "owner_id",
521+
"ownerId": "usr_123",
522+
"updated": 1,
523+
"failed": 1,
524+
"failures": [
525+
{ "id": "lead_2", "code": "PERMISSION_DENIED", "message": "…" }
526+
],
527+
"notified": true
528+
}
529+
}
530+
```
531+
532+
With `notify`, the new owner gets one notification for all the records that
533+
moved, and none when nothing moved.
534+
535+
---
536+
458537
## Analytics
459538

460539
Semantic BI queries using a cube-style API. Provided by `@objectstack/service-analytics` —

‎content/docs/references/api/automation-api.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ const result = AutomationApiErrorCode.parse(data);
424424

425425
| Property | Type | Required | Description |
426426
| :--- | :--- | :--- | :--- |
427-
| **code** | `Enum<'VALIDATION_ERROR' \| 'INVALID_FIELD' \| 'MISSING_REQUIRED_FIELD' \| 'INVALID_FORMAT' \| 'VALUE_TOO_LONG' \| 'VALUE_TOO_SHORT' \| 'VALUE_OUT_OF_RANGE' \| … +377 more>` | ✅ | The inner refusal's code in its WIRE spelling - the ADR-0112 member a record save of the same write answers in `error.code` (e.g. `UNIQUE_VIOLATION`); the closed set `ApiErrorSchema.code` parses against |
427+
| **code** | `Enum<'VALIDATION_ERROR' \| 'INVALID_FIELD' \| 'MISSING_REQUIRED_FIELD' \| 'INVALID_FORMAT' \| 'VALUE_TOO_LONG' \| 'VALUE_TOO_SHORT' \| 'VALUE_OUT_OF_RANGE' \| … +378 more>` | ✅ | The inner refusal's code in its WIRE spelling - the ADR-0112 member a record save of the same write answers in `error.code` (e.g. `UNIQUE_VIOLATION`); the closed set `ApiErrorSchema.code` parses against |
428428
| **message** | `string` | ✅ | The inner refusal's own diagnostic text, verbatim, without the node and operation prefixes the run's failure text adds |
429429

430430
### Allowed Values: `FlowInnerRefusal.code`
@@ -517,6 +517,7 @@ const result = AutomationApiErrorCode.parse(data);
517517
* `BATCH_TOO_LARGE`
518518
* `BATCH_UNRESOLVED_REF`
519519
* `BLANK_MATCH_KEY`
520+
* `CHANGE_OWNER_DISABLED`
520521
* `CLONE_DISABLED`
521522
* `CLOUD_FETCH_FAILED`
522523
* `CLOUD_UNCONFIGURED`

‎content/docs/references/api/contract.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const result = ApiErrorSchema.parse(data);
2828

2929
| Property | Type | Required | Description |
3030
| :--- | :--- | :--- | :--- |
31-
| **code** | `Enum<'VALIDATION_ERROR' \| 'INVALID_FIELD' \| 'MISSING_REQUIRED_FIELD' \| 'INVALID_FORMAT' \| 'VALUE_TOO_LONG' \| 'VALUE_TOO_SHORT' \| 'VALUE_OUT_OF_RANGE' \| … +377 more>` | ✅ | Error code (e.g. VALIDATION_ERROR; StandardErrorCode ∪ the ledger the serving side registers — ERROR_CODE_LEDGER for framework packages) |
31+
| **code** | `Enum<'VALIDATION_ERROR' \| 'INVALID_FIELD' \| 'MISSING_REQUIRED_FIELD' \| 'INVALID_FORMAT' \| 'VALUE_TOO_LONG' \| 'VALUE_TOO_SHORT' \| 'VALUE_OUT_OF_RANGE' \| … +378 more>` | ✅ | Error code (e.g. VALIDATION_ERROR; StandardErrorCode ∪ the ledger the serving side registers — ERROR_CODE_LEDGER for framework packages) |
3232
| **declaredCode** | `string` | optional | The producer-declared code, verbatim, when it is not a member of the closed `code` vocabulary — the open, author-authored channel (app-specific spellings; ADR-0112) |
3333
| **message** | `string` | ✅ | Readable error message |
3434
| **userMessage** | `string` | optional | Producer-marked user-facing refusal text, verbatim, in the request's locale: platform-composed text falls back to the workspace default locale, then `en`; an app-authored refusal falls back to its declared wording. Present exactly when the producer opted in at throw time; consumers render it to end users as received and keep their generic substitution for anything unmarked. Status-agnostic; never replaces `message`. |
@@ -128,6 +128,7 @@ const result = ApiErrorSchema.parse(data);
128128
* `BATCH_TOO_LARGE`
129129
* `BATCH_UNRESOLVED_REF`
130130
* `BLANK_MATCH_KEY`
131+
* `CHANGE_OWNER_DISABLED`
131132
* `CLONE_DISABLED`
132133
* `CLOUD_FETCH_FAILED`
133134
* `CLOUD_UNCONFIGURED`

‎content/docs/references/api/error-code-ledger.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ const result = ErrorCode.parse(data);
295295
* `BATCH_TOO_LARGE`
296296
* `BATCH_UNRESOLVED_REF`
297297
* `BLANK_MATCH_KEY`
298+
* `CHANGE_OWNER_DISABLED`
298299
* `CLONE_DISABLED`
299300
* `CLOUD_FETCH_FAILED`
300301
* `CLOUD_UNCONFIGURED`

‎packages/client/src/index.ts‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,40 @@ export interface UserWorkTransferReport {
276276
remaining: number;
277277
}
278278

279+
/**
280+
* [#35402] Who takes the records in `data.changeOwner` / `data.changeOwnerMany`:
281+
* a person (`ownerId`), or an ownership queue (`queue`, ADR-0142) — exactly
282+
* one. `notify` tells a person target; a queue target refuses it.
283+
*/
284+
export type ChangeOwnerRequest =
285+
| { ownerId: string; queue?: undefined; notify?: boolean }
286+
| { queue: string; ownerId?: undefined; notify?: undefined };
287+
288+
/** [#35402] `data.changeOwner`'s answer: the record's new owner, or the queue it now sits in. */
289+
export interface ChangeOwnerResult {
290+
object: string;
291+
id: string;
292+
/** `null` when the record now sits in `queue`. */
293+
ownerId: string | null;
294+
queue?: string;
295+
notified: boolean;
296+
}
297+
298+
/**
299+
* [#35402] `data.changeOwnerMany`'s answer — the #30205 hand-over's per-object
300+
* outcome, with every row that did not move listed by id.
301+
*/
302+
export interface ChangeOwnerReport {
303+
object: string;
304+
field: string;
305+
ownerId: string | null;
306+
queue?: string;
307+
updated: number;
308+
failed: number;
309+
failures: Array<{ id: string; code: string; message: string }>;
310+
notified: boolean;
311+
}
312+
279313
/**
280314
* [#30237] One page of `recycleBin.list`: an object's recycle-bin entries,
281315
* newest first. Each snapshot row carries only the fields the caller may see
@@ -8255,6 +8289,40 @@ export class ObjectStackClient {
82558289
return this.unwrapResponse<CloneDataResult<T>>(res);
82568290
},
82578291

8292+
/**
8293+
* [#35402] Change Owner on ONE record — `POST /data/:object/:id/change-owner`:
8294+
* hand it to a person (`ownerId`) or move it to an ownership queue
8295+
* (`queue`), as the caller. Refused `403 CHANGE_OWNER_DISABLED` on an object
8296+
* that does not offer the action (`userActions.transfer`); a caller without
8297+
* the transfer grant on the record gets the `/data` write door's own `403`,
8298+
* and a record out of reach its `404`.
8299+
*/
8300+
changeOwner: async (object: string, id: string, request: ChangeOwnerRequest): Promise<ChangeOwnerResult> => {
8301+
const route = this.getRoute('data');
8302+
const res = await this.fetch(
8303+
`${this.baseUrl}${route}/${encodeURIComponent(object)}/${encodeURIComponent(id)}/change-owner`,
8304+
{ method: 'POST', body: JSON.stringify(request) },
8305+
);
8306+
return this.unwrapResponse<ChangeOwnerResult>(res);
8307+
},
8308+
8309+
/**
8310+
* [#35402] Change Owner on a list of up to 500 records —
8311+
* `POST /data/:object/change-owner`: each moves by its own update as the
8312+
* caller, and the answer lists every row that did not move with its code
8313+
* and sentence. The whole call is refused before any write on an object
8314+
* that does not offer the action, a repeated or empty id list, a list past
8315+
* the cap, and an unknown or banned person.
8316+
*/
8317+
changeOwnerMany: async (object: string, ids: string[], request: ChangeOwnerRequest): Promise<ChangeOwnerReport> => {
8318+
const route = this.getRoute('data');
8319+
const res = await this.fetch(
8320+
`${this.baseUrl}${route}/${encodeURIComponent(object)}/change-owner`,
8321+
{ method: 'POST', body: JSON.stringify({ ...request, ids }) },
8322+
);
8323+
return this.unwrapResponse<ChangeOwnerReport>(res);
8324+
},
8325+
82588326
/**
82598327
* [#26594] The field projection of ONE record —
82608328
* `GET /data/:object/:id/field-access`, declared by

0 commit comments

Comments
 (0)