Repository navigation
Commit 6a35635
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XP3RHGWUG7UH3fNa4tBa9UC)_
Fixes #35403
Clause-②: yes (widening) — new published `@object-ui` surface, measured
on the export lists (merge base `b3bcfefcb` against head):
`onBulkChangeOwner` and `bulkChangeOwnerOffered` props on `ObjectGrid` /
`ListView`; `CHANGE_OWNER_BULK_ACTION` (plugin-grid); `FormOwnerLine`,
`FormOwnerLineProps`, `FormOwnerLineContext`, `FormOwnerActionTarget`,
`FormOwnerLineHost` (plugin-form; the last three also from `/core`);
`'transfer'` in `RecordOperation` (plugin-detail); `grid.changeOwner`
and `console.changeOwner.*` keys in every locale (i18n); nothing removed
or renamed
Metadata-protocol: none
Seat reading 2026-11-22 08:01Z: Q1 A, Q2 A
## 维护者速读
- 控制台用户在记录页、列表批量选择栏和编辑表单上能看到「更改负责人」操作;编辑表单里负责人以只读显示,操作就在旁边。
- 这是「更改负责人」三张卡里的最后一张(控制台界面);服务端接口和规则判断已经在前两张卡里合并。
- 出错时最坏的情况是该显示的按钮没显示,或者在服务端本会拒绝的地方多显示了一个按钮;不改服务端,也不改任何数据规则,撤回这次合并即可。
- 无。
## What changes
**The record page.** The header gets a **Change Owner** entry in its `⋯`
menu (`sys_change_owner`, in `RecordDetailView`'s built-in header
entries). It is drawn only when all three facts hold, as ruled:
1. The object is structurally eligible.
2. Its switch `userActions.transfer` is on. Facts 1 and 2 come from the
spec's one resolution, `resolveUserActionTransfer` in
`@objectstack/spec/data`.
3. The explain engine's `transfer` verdict for this record is a definite
allow.
The verdict comes from the record page's existing single read. Its
`explain` list now asks `transfer` wherever facts 1 and 2 hold.
`seedRecordPageReaders` seeds that answer into the same verdict cache
`useRecordVerdict` reads, so there is no second per-record request. The
queue Claim shares the same answer. If `disabledWhen` holds for the
record, the entry is drawn disabled with the reason beside it, as the
CRUD entries are.
**One dialog** (`ChangeOwnerDialog`), used by the record action, the
form action and the bulk action:
- The picker is labelled with the object's own label for `owner_id`. The
served label is passed through `fieldLabel`, and "Owner" (i18n) is used
only when the object serves none.
- You can pick a person, or a queue where the object carries the
ADR-0142 `queue` column. Queues are read from `sys_queue` only once the
queue target is chosen.
- An optional notify checkbox sends `notify: true` only when ticked.
- One record calls `data.changeOwner`; two or more call
`data.changeOwnerMany`, both from `@objectstack/client`. There is no
server, spec, SDK or REST change.
- A refusal shows the server's own sentence.
- A bulk answer ends in a report: moved, already had this owner, did not
move. Every row that did not move is listed with the server's sentence,
unsampled.
**The list.** `ObjectGrid`'s selection bar (and its row context menu's
bulk section) offers **Change Owner** where the host wires the new
optional `onBulkChangeOwner` prop, unless the new optional
`bulkChangeOwnerOffered` is `false`; `ListView` forwards both. Wiring
`onBulkChangeOwner` makes the rows selectable, as a bulk action does.
The Console wires it wherever facts 1 and 2 hold (read client-side, no
request), so a user with no bulk Delete, on a view with no authored bulk
actions, still gets checkboxes. It passes `bulkChangeOwnerOffered` as
the explain engine's `transfer` verdict for the OBJECT, which must be a
definite allow (`POST /security/explain` with no `recordId`, one
question per object and principal, shared by every list). **The question
is asked once a selection is open in the page's list, not when the list
opens** (`useListChangeOwnerOffered(objectDef, listSelecting)`, reading
the page's existing `useListPageSelecting`). Opening a list therefore
costs the server no explain read, the posture the grid's row verdicts
already take (`useRecordCrudVerdicts`). Rows that the switch's
`visibleWhen` excludes are left out of the request with the same
fail-closed fold the bulk Delete runs, and the dialog says how many it
left out. The server judges every remaining row again.
**The default edit form.** `owner_id` is still dropped from the form's
fields by `filterSystemFields` / `SERVER_OWNED_FIELD_NAMES` and never
written by the form. It is now shown read-only on its own line above the
fields, with the host's action beside it. The line appears only under a
host that mounts `FormOwnerLineContext` (exported from
`@object-ui/plugin-form` and its `/core` entry). The Console mounts it
around its global edit dialog and the page-mode form. An embedded form
without the context is unchanged.
**Strings.** All new strings are in all 11 console locales:
`grid.changeOwner` and the `console.changeOwner.*` block. The two
counted strings are plural families with a base key in every pack.
## Tests
**Rework round (L1 REWORK 7077241523, L2 FAIL 7077265450), head
`7a1cdd56`:**
- **M1.** The changeset's `Clause-②:` line reads `yes (widening)`; its
body lists the new surface per package. Measured with the TypeScript
checker (`getExportsOfModule` and the members of each exported interface
and type) on each entry, merge base `b3bcfefcb` against head. Added
names: plugin-grid `CHANGE_OWNER_BULK_ACTION`; plugin-form
`FormOwnerActionTarget`, `FormOwnerLine`, `FormOwnerLineContext`,
`FormOwnerLineHost`, `FormOwnerLineProps` (root) and
`FormOwnerActionTarget`, `FormOwnerLineContext`, `FormOwnerLineHost`
(`/core`); plugin-list, plugin-detail (root and `/core`) and i18n add no
name. Added members: `ObjectGridComponentProps` / `ObjectGridProps`
`onBulkChangeOwner`, `bulkChangeOwnerOffered`; `ListViewProps`
`onBulkChangeOwner`, `bulkChangeOwnerOffered`; `RecordOperation`
`"delete"|"update"` to `"delete"|"transfer"|"update"`. Removed: none.
Re-read on the BUILT declarations of head `7a1cdd56` (the five packages'
`dist/*.d.ts`, built under `os-verify-lock`): the same added names on
every entry, and the same added members (`ObjectGridComponentProps` /
`ObjectGridProps` / `ListViewProps` `onBulkChangeOwner` and
`bulkChangeOwnerOffered`, `RecordOperation` with `'transfer'`, the
`FormOwner*` members). The built and source lists differ only in
declarations this diff does not touch (`ColumnSummarySetting`,
`ActivityFilterType`, `RecordStageMenuProps`, a symbol id). The i18n
surface is the locale packs' new keys: `grid.changeOwner` and the
`console.changeOwner.*` block, in all 11.
- **S1.** `ObjectGrid` turns multi-select on where `onBulkChangeOwner`
is wired, and draws the entry only while `bulkChangeOwnerOffered !==
false`; the Console wires the prop from facts 1 and 2 and passes the
verdict asked once a selection is open. New pin
`ObjectView.bulkChangeOwnerReach-35403.test.tsx`, through the real
`ObjectView` and grid, for a user who may edit but not delete (`can(…,
'delete')` false) on an object with no authored bulk actions: checkboxes
on open and no object-level `transfer` request; ticking both rows asks
once and the bar carries `sys_change_owner` and no `delete`. A refused
verdict leaves the rows selectable and the bar without Change Owner.
Control: an `ownership: 'none'` object draws no checkboxes and asks
nothing. 3/3.
- Ablations on committed `7a1cdd56`, through
`scripts/ablation-replace.mjs`, each restore proved by blob == HEAD and
an empty `git diff HEAD`. Dropping `|| onBulkChangeOwner` from the
multi-select arm (blob `ba88537d73a0` to `1d7490f81be0`) gave 2 failed,
1 passed: the transfer case and the refused case found no checkboxes,
and the control stayed green. Dropping `&& bulkChangeOwnerOffered !==
false` (to `9d540e94f35b`) gave 1 failed, 2 passed: the refused case
drew Change Owner.
- **N3.** The `onBulkChangeOwner` doc now says when the entry is drawn:
at any count, except on a list page, where one selected record shows
that record's own actions and the bulk entries start at two. That is
what the bar does (`singleRowMenu` for one row on a list page); the code
is unchanged.
- Re-runs on `7a1cdd56`, under `os-verify-lock`: every app-shell suite
naming `ObjectView` or `AppContent`, plus `changeOwner-35403`,
`bulkChangeOwner-35403` and the payload pin: Test Files 289 passed
(289), Tests 2639 passed (2639).
**Earlier round, head `5d4ddea3`:**
Final head `5d4ddea3`.
- **The six suites the object-level read had turned red, cause read.**
`ObjectView.sharedViewSave-35955`, `ObjectView.objectBoundActions-7234`,
`ObjectView.footerCalculationDraft-36194`,
`ObjectView.readOnlyPackageViewSaves-35974`,
`ObjectView.viewRefusal-12112` and `AppContent.draftSaveKeepsList-35932`
failed with the network-escape guard's `Network escape: this test
reached a REAL socket at http://localhost:3000/api/v1/security/explain`.
Every list open asked the explain engine. That was a product cost, not a
missing double: the list now asks only once a selection is open, and
these suites pass unchanged.
- `RecordDetailView.recordPagePayload-27627`: the pin on the page
request's `explain` list now reads `['update', 'delete', 'transfer']`;
the fixture object carries an owner, so the transfer verdict rides the
same single read. The pin's intent (one request opens a record page) is
unchanged.
- `ObjectView.phoneFabSelecting-35883` opens a selection, so it now gets
an explain double answering no; any other request throws.
- Runs, all under `os-verify-lock`:
- every `ObjectView.*` suite plus AppContent, the payload pin and the
card file, on `0e97ce47`: Test Files 105 passed, 1 failed (the phone
selection suite, fixed in `df44c1a3`);
- every other app-shell suite naming `ObjectView` or `AppContent`, plus
the phone selection suite, on `df44c1a3`: Test Files 188 passed (188),
Tests 1720 passed (1720);
- the whole `@object-ui/i18n` suite (with `count-families-11445`,
`de-quote-pairing-3876`, `untranslated-identity-4376`,
`zh-hant-generated`, `all-locales-key-parity`), the plugin-form
`affordanceGrantMap-12082` census, `bulkChangeOwner-35403` and
`changeOwner-35403`, on `5d4ddea3`: Test Files 109 passed (109), Tests
2065 passed, 13 skipped. The first run of this set on `a37c0ac5` was red
in `all-locales-key-parity` (the two counted families had no base key in
any of the 11 packs); `5d4ddea3` adds them.
- Card pins, all in `changeOwner-35403.test.tsx` and
`bulkChangeOwner-35403.test.tsx`: no action on `ownership: 'none'`,
`managedBy` and `sys_*` objects even for a platform admin; a
`controlled_by_parent` detail shows none by default and shows it with
`userActions.transfer: true`; a switched-off `private` object shows none
for a `modifyAllRecords` holder; edit without transfer sees `owner_id`
read-only and no action; the bulk report renders per-row failures. The
five list-gate cases (allow asked once at object grain, refusal, refused
read, no open selection asks nothing, ineligible object asks nothing)
pass.
- Ablation on committed `5d4ddea3`, through
`scripts/ablation-replace.mjs`: `const asks = enabled && !!name &&
wanted;` changed to drop `&& wanted`, anchor 1 to 0, blob `293da7c28c7d`
to `8cae616fd61b`; `changeOwner-35403.test.tsx` went 1 failed, 29 passed
(the no-open-selection case); restore proved by blob `293da7c28c7d` ==
HEAD and an empty `git diff HEAD`. The earlier visibility-leg ablations
are on the previous dev's heads (structural 3 red, switch 2 red, verdict
3 red).
- Type-check on `5d4ddea3`: `@object-ui/app-shell` and `@object-ui/i18n`
`type-check` (after building the `@object-ui/app-shell^...` closure):
VERDICT command-exit 0.
## Acceptance notes
- L2 S2 and N2 carried by #36395.
- **Seat reading 2026-11-22 08:01Z: Q1 A, Q2 A.** The list reads the
explain engine's object-level `transfer` verdict, as the ruling words
it. The #30205 row cap stays server-only: over 500 rows the dialog shows
the server's own `VALIDATION_ERROR` sentence.
- **N1 (the echo): a row whose owner already was the person picked reads
"already had this owner", not "moved".** On one record the dialog leaves
the current owner out of the picker and refuses it with the reason
shown. In a bulk report the unchanged count is capped at what the server
counted updated. A queue target has no person to compare, so every
admitted row reads as moved.
- **Change Owner is drawn on a definite allow only**, on the record
page, the form and the list. A deployment whose explain engine answers
nothing shows no Change Owner anywhere, as the queue Claim beside it
does.
- **On the list, Change Owner appears a moment after the selection bar
the first time a selection opens for an object** (one round trip); later
selections read the kept answer at once.
- **Rows of an object that offers Change Owner are selectable for every
user**, the price of asking the verdict only on a selection. A user the
verdict refuses, with no other bulk action, gets a selection bar with
nothing but its count and its clear button.
- On a list page, one ticked record shows that record's own actions, so
the bulk Change Owner starts at two ticked records; that record's page
offers Change Owner itself.
- Not wired here (carrier: none; noted, not filed): the non-grid
`ListView` bulk surfaces. `onBulkChangeOwner` reaches the grid only.
- A dirty edit form saved after a Change Owner may meet the record's
version check (the form re-reads in place only while pristine).
Unchanged here.
## Verification
Read first, by risk:
1. `ui/packages/plugin-grid/src/ObjectGrid.tsx`: `changeOwnerDrawn` and
the multi-select arm `hasBulkActions || onBulkChangeOwner`.
2. `ui/packages/app-shell/src/views/changeOwner.ts`,
`useListChangeOwnerOffered` (the `wanted` hold) and
`useRecordChangeOwnerOffer` (the three-fact gate, `verdict === true`).
3. `ui/packages/app-shell/src/views/recordPagePayload.ts`: `transfer`
now seeds the record verdict as well as the Claim reader.
Two-minute check: `pnpm --dir ui exec vitest run
packages/app-shell/src/views/ObjectView.bulkChangeOwnerReach-35403.test.tsx
packages/app-shell/src/views/changeOwner-35403.test.tsx`. Expected: 33
passed.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds)_
<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jUc3qp6bHKSWijbjds -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 24366ff commit 6a35635
40 files changed
Lines changed: 2318 additions & 20 deletions
File tree
- .changeset
- ui
- apps/console
- packages
- app-shell/src
- console
- views
- i18n/src
- __tests__
- locales
- plugin-detail/src
- plugin-form/src
- plugin-grid/src
- __tests__
- components
- plugin-list/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1541 | 1541 | | |
1542 | 1542 | | |
1543 | 1543 | | |
1544 | | - | |
| 1544 | + | |
1545 | 1545 | | |
1546 | 1546 | | |
1547 | 1547 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
1722 | 1723 | | |
1723 | 1724 | | |
1724 | 1725 | | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
1725 | 1729 | | |
1726 | 1730 | | |
1727 | 1731 | | |
| |||
1824 | 1828 | | |
1825 | 1829 | | |
1826 | 1830 | | |
| 1831 | + | |
1827 | 1832 | | |
1828 | 1833 | | |
1829 | 1834 | | |
| |||
0 commit comments