This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit ff14e29
fix(plugin-view): the grid's row and bulk Delete delete on the registered object-view path (#10424)
Fixes #10383
Clause-②: yes
## What was wrong
On the registered `object-view` renderer path (`ObjectView` with no host
`renderListView`), `ObjectGrid` hands the clicked row, or the selection,
to `onDelete` / `onBulkDelete` and performs no delete of its own: its
own comments say the consumer's delete flow "owns the confirmation, the
toast and the refresh". `ObjectView`'s `handleDelete` /
`handleBulkDelete` ignored their argument and only bumped `refreshKey`.
Delete is offered by default (`operations.delete` defaults to true), so
the click deleted nothing and the row came back after the refresh.
Reproduced on `origin/main` `a70719765` before any edit, through the
REAL `ObjectGrid` (a temporary probe, never committed): row Delete and
bulk Delete each gave `dataSource.delete` 0 calls, `bulkDelete` 0,
`bulk` 0, and the row was still shown (`AssertionError: expected 0 to be
greater than 0`, 2 of 2 failed).
## Measured first: how the console's own list deletes (read only)
- Host: the `app-shell` object page renders `ListView`, which forwards
`onDelete` / `onBulkDelete` to the same `ObjectGrid`.
- Row: `actions.deleteRecord(String(record.id), record)`, skipping a row
with no `id`, which runs `execute({ type: 'delete', confirmText:
t('objectActions.deleteConfirm'), params })`. The confirm goes through
the console runtime's `confirmHandler`, which opens
`ActionConfirmDialog`: a Shadcn AlertDialog titled
`actionConfirm.title`, buttons `actionConfirm.cancel` /
`actionConfirm.confirm`, the question as the description.
- Bulk: keeps the rows that have an `id`, then `execute({ type:
'delete', confirmText: t('console.objectView.bulkDeleteConfirm', { count
}), params: { records } })`, so there is one confirm for the batch.
- Data call: `useObjectActions`' registered `delete` handler. More than
one record: `Promise.allSettled(records.map(r =>
dataSource.delete(objectName, r.id)))`. One record:
`dataSource.delete(objectName, recordId)`. It does not use the optional
`DataSource.bulkDelete`.
- After: bulk refreshes, then toasts `objectActions.bulkDeleteSuccess`
or `objectActions.bulkDeletePartial`. Single: on success it refreshes
and toasts `objectActions.deleteSuccess`; on failure it toasts
`objectActions.deleteFailed` with the error message as the description,
and does not refresh.
- Permission: the console list's handlers read no permission. Whether
Delete is offered at all is decided by `ObjectGrid`:
`operations.delete`, AND the principal's `perms.can(object, 'delete')`,
AND the object's bucket / `userActions` / effective API operations, AND
the per-record explain verdict. It is the same component on both paths,
so it is the same gate.
## The fix: ONE record-delete core, and both hosts bind to it
The first head (`ea0c5c627`) copied the console's delete steps into
`plugin-view`. The seat sent it back: that was a second implementation
of the same operation, and it already diverged on consent. It asked a
package-owned `sys_permission_set` row the plain delete question, where
the console asks the ADR-0094 reset question. The seat's rule for one
operation with two diverging implementations: the governed side wins and
the other re-binds to it. ⛔ No copying, ⛔ no double-writing.
- **`recordDelete` in `@object-ui/core`**
(`packages/core/src/actions/recordDelete.ts`, exported through
`actions/index.ts`). It is the one new public export (hence `Clause-②:
yes`): a frozen `{ confirmText, run }`.
- `confirmText(deps, record?)` picks `objectActions.deleteConfirm`, or
`objectActions.resetPackageSetConfirm` for a `sys_permission_set` row
with `managed_by: 'package'`.
- `run(deps, request)` is the console's former inline `delete` handler,
moved statement for statement: the id chain, the single delete with the
ADR-0094 detection (the row first, then a best-effort `findOne`), the
bulk `allSettled`, the four toasts, and the runner-shaped returns
(`silent` on success, no `error` key, so no double toast).
- `t`, `toast`, `dataSource`, `onRefresh` and the label are INJECTED, so
core gains no i18n or toast dependency. Core is the lowest package both
hosts already depend on: no new dependency edge, and nothing is
inverted.
- **Console re-bind** (`app-shell` `useObjectActions`): the `delete`
handler is `recordDelete.run(...)`, and `deleteRecord`'s question is
`recordDelete.confirmText(...)`. The behaviour is byte-identical;
`useObjectActions.test.tsx` is unchanged (a 0-line diff) and green.
- **plugin-view re-bind** (`ObjectView`): `performDelete` and the local
question are gone. The `AlertDialog` stays as this host's confirm UI
(`actionConfirm.*` chrome, the exit-animation `open` guard). The
question and the delete come from the core, with the same request shapes
the console hands its runner. So a package-owned permission set on this
path now gets the reset question and the reset toast.
- Whether Delete is offered at all is unchanged: it is `ObjectGrid`'s
verdict on both paths (`operations.delete`, the delete grant, the
object's lifecycle, `userActions` and API operations, and the per-record
verdict).
- No new i18n key: every key is already in the ten packs. The en
defaults sit in `VIEW_DEFAULT_TRANSLATIONS` for the provider-less path,
byte-identical to `en`.
- `ObjectGrid.tsx`, `RowActionMenu.tsx`, `useConsoleActionRuntime.tsx`
and `ActionRunner.ts` are untouched. The grid branch's
remount-to-refresh is untouched.
## Pins
- `packages/core/src/actions/__tests__/recordDelete.test.ts`, 13 cases:
- the question (plain, reset, and env-owned or no row);
- single success and single refused (no refresh, no `error` key);
- the id chain, and no id (the `error` goes to the runner);
- bulk success and bulk partial;
- reset via the passed row and reset via `findOne`;
- the env-owned and failed-lookup controls;
- an ordinary object is never looked up.
- `packages/app-shell/src/hooks/__tests__/useObjectActions.test.tsx`,
UNCHANGED: toast de-duplication and the ADR-0094 reset copy, including
the `findOne` fallback.
-
`packages/plugin-view/src/__tests__/ObjectView.gridDelete-10383.test.tsx`,
9 cases through the real `ObjectGrid` against an in-memory source:
- row confirm then delete, and the row is gone;
- Cancel;
- a refused row delete;
- bulk (2 `delete`, 0 `bulkDelete`) and partial bulk;
- the permission pair;
- a package-owned permission set asks the RESET question and toasts the
reset, and its env-owned control keeps the plain copy.
- `scripts/__tests__/check-i18n-call-site-keys.test.ts`: the
objectui#3845 pin follows the call site into `recordDelete.ts`, with the
same absent / present pair, plus one added sister assertion
(`deleteSuccess` still interpolates `label`).
## Reverse verification (`ablation-replace.mjs`, WRAP mode, at
`e9668789f`; expectations pre-registered)
| Leg | Mutation | Result | Restore |
|:--|:--|:--|:--|
| A | plugin-view's `handleDelete` / `handleBulkDelete` back to their
refresh-only bodies | `Tests 7 failed \| 2 passed (9)`: the 5 delete
cases and the 2 ADR-0094 cases red; the permission pair, which pins
`ObjectGrid`, green | blob `a8eb765b` == HEAD, `git diff HEAD` empty |
| B | the core's reset branch removed (`isPackageOwned` → `return
false`) | `Tests 6 failed \| 22 passed (28)` across core, console and
plugin-view: every reset case red on all three, every env-owned control
green | blob `bc25ece0` == HEAD, `git diff HEAD` empty |
## Gates (head `473c86933`; code identical to `e9668789f`, which adds
only changesets on top)
- CI on `473c86933`: 43 check-runs, 40 success and 3 skipped, 0
failures. On the intermediate head `6c374d382`, shard 4/8 was red in
`check-i18n-call-site-keys` (the pin still pointed at
`useObjectActions.ts`). `e9668789f` fixed it by re-pointing the pin,
without weakening it.
- `turbo run build --filter='@object-ui/app-shell^...'`: 28/28.
Type-check exits 0 for core, plugin-view and app-shell.
- `vitest run packages/plugin-view/ packages/core/`: 215 files, 3951
passed. `packages/app-shell/` in 6 shards: 775 files, 7624 passed, 9
skipped, 0 failed. `scripts/__tests__/`: 179 files, 5306 passed, 2
skipped by design. The 17 other text readers of the touched sources:
1111 passed.
- `check:control-bytes` OK. `check:new-line-citations` 0 new.
`check-changeset-presence`: 2 changesets over 3 released packages, and
it demands no app-shell entry. `check-changeset-no-major` OK.
`check:changeset-claims` exits 0 (the same 5 pending changesets,
re-read, still true). `check:i18n-keys` OK. Governed guard: NOT
GOVERNED.
- eslint per-rule counts: `ObjectView.tsx` equal to base;
`useObjectActions.ts` `no-explicit-any` 8 → 4; the new files have 0.
- Changesets: `@object-ui/core: minor` (the new export) and
`@object-ui/plugin-view: minor` (the behaviour change). ⛔ No `major`.
## Acceptance notes
- `packages/core/README.md` does not document `recordDelete`. None of
the sibling action-module exports is documented there either, and the
README export gate checks only README→code. Surfaced to the maintainer
on the card; not added here.
- plugin-view resolves the console's
`console.objectView.bulkDeleteConfirm` key. There is precedent on main
(`console.objectView.new` in plugin-view, and nine
`console.objectView.viewType*` keys in plugin-list). Reusing it is what
keeps both paths word-for-word in every language.
- `void recordDelete.run(...)` in plugin-view has no `.catch`. A
synchronous throw inside the bulk map would surface as an unhandled
rejection, but no in-tree adapter throws synchronously
(`DataSource.delete` is `Promise`-returning everywhere). Left as is.
- Bulk ids are forwarded raw, as the console's handler always did. Row
ids are stringified at each host, as before.
- With an adapter that emits `onMutation`, a delete refreshes twice (the
handler bump plus the subscription). The console list behaves the same.
- `check:changeset-claims` listed 5 pending changesets naming
`plugin-view/src/ObjectView.tsx` (6726, 7070, 7499, 8653, 7779). None
describes the delete handlers, and all are still true.
- Observation, not filed: plugin-detail's `DetailView.handleDelete`
comment says the `ActionProvider`'s `onConfirm` "will intercept" a
native `window.confirm`; nothing does.
Session: `https://claude.ai/code/session_01BA3nKVUwKQJf8DBxrSVtNC`
(domain:ui seat 1). Body updated by the seat at `473c86933` after the
contract review; the code is the dev's.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01BA3nKVUwKQJf8DBxrSVtNC)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 36e27db commit ff14e29
9 files changed
Lines changed: 1054 additions & 118 deletions
File tree
- .changeset
- packages
- app-shell/src/hooks
- core/src/actions
- __tests__
- plugin-view/src
- __tests__
- scripts/__tests__
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
182 | 101 | | |
183 | 102 | | |
184 | 103 | | |
| |||
202 | 121 | | |
203 | 122 | | |
204 | 123 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
211 | 128 | | |
212 | 129 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 130 | + | |
220 | 131 | | |
221 | 132 | | |
222 | 133 | | |
| |||
| 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 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
0 commit comments