Repository navigation
feat(ui): undo a business-record delete from its toast through the recycle bin - #31795
Conversation
…cycle bin The data source tells the delete's recycleBinEntryId and can restore an entry; the record-delete core offers Undo when the host passes a restore (the caller holds allowRestoreOwnDeleted), and a business object's confirm asks the question alone. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jR7jBcj3r4Rii4HA82
…ms, restore toasts Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jR7jBcj3r4Rii4HA82
…ly delete copy Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jR7jBcj3r4Rii4HA82
… pin the adapter and grant reads Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jR7jBcj3r4Rii4HA82
… copy Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jR7jBcj3r4Rii4HA82
|
domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo Contract reviewServed-tier: This is the lane seat's own review of record. It is owed by the ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
… census Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jR7jBcj3r4Rii4HA82
|
domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo Contract reviewServed-tier: This is the delta review of record on the new head. The earlier record is 6732144296, PASS on ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo 席位核对 · ACCEPT · 2026-11-09T04:54Z · head
|
…n, or empty it (objectstack-ai#31835) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbPnyAMycuSU2XHXgpgorGJU)_ Fixes objectstack-ai#30239 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 改了什么:Setup → 配置 下新增「回收站」页面。左侧列出调用者有 `manageRecycleBin` 权限的业务对象(不发任何回收站读取),选中一个对象后读它的回收站,每页 50 条,可以「加载更多」。每行显示记录名、连带删除的相关记录数、删除人、删除时间和保留期限。「恢复」复用 objectstack-ai#31795 删除提示里的撤销逻辑:按原 id 恢复,被拒时按原因给出带对象和字段标签的句子。「清空回收站」会先确认并说明不可撤销,完成后报告移除了多少条。导航项由 `@objectstack/platform-objects` 的 Setup 导航贡献提供(`componentRef: 'data:recycle-bin'`),11 个翻译包都加了标签。 - 为什么改:ADR-0148 之后业务对象删除会进回收站,但管理员在控制台里看不到回收站,也没有办法恢复或清空。objectstack-ai#31795 只覆盖了删除者本人在提示里的撤销。 - 风险与回滚:新增页面和一个导航项,不改已有页面的行为。`CatalogAssignmentPage` 加了一个可选的 `select` 属性,`renderSection` 多传第二个参数,两个已有调用方不受影响。没有任何对象回收站管理权限的用户看到说明文字,不发读取。回滚即撤销本 PR。 - 先看:`ui/packages/app-shell/src/views/setup/RecycleBinPage.tsx`(`RecycleBinSection` 的读取、加载更多、恢复和清空),再看 `setup/recycleBin.ts`(`managesRecycleBin` 权限判断和 SDK 门的取法)。 - 两分钟验证:在 `ui/` 下跑 `pnpm exec vitest run packages/app-shell/src/views/setup/RecycleBinPage.test.tsx`,预期 20 个用例全绿。实机截图见下方 Verification。 - 需要你做的:无,席位落地。 ## What changes - **`@object-ui/app-shell`, the page** (`views/setup/RecycleBinPage.tsx`, registered as `data:recycle-bin` in `builtinComponents.tsx`): - **The object list costs no bin read.** It is the `object` catalog narrowed to the business objects whose `manageRecycleBin` the caller holds. The gate is `managesRecycleBin` in `setup/recycleBin.ts`: the effective map from `/auth/me/permissions`, read as `MePermissionsProvider` reads it (the lowercase key, the key as given, then `'*'`), and folded by `objectPermissionGrants`, so `modifyAllRecords` grants it. A platform object (`hasPlatformObjectPrefix`) never enters the bin, so it is never listed. - A caller who manages no object's bin is told so ("No recycle bin to manage"), and no bin read is sent. The picked object rides the page-scoped `?object=` param. A link to an object the caller does not manage reads nothing. - **One object:** one `recycleBin.list(object, { limit: 50, offset: 0 })`. "Load more" reads `offset` = the rows held, while the door answers `hasMore`. - Each row shows the record's name: `getRecordDisplayName` over the served snapshot row, which the door masks to the fields the caller may read. - "and N related records" (`recordCount − 1`, a count family) shows when the delete cascaded. - Who deleted it is resolved by one batched `sys_user` read per page; a refused read leaves the id. - Also shown: when it was deleted, and the day it is kept until (`purgeAfter`). - **Restore** is `recordDelete.undo`, the same restore the delete toast's Undo runs (objectstack-ai#31795). It restores under the original ids, never creates, and drops the row. A refusal toasts `restoreFailed` with `recycleBinRestoreRefusalText`, on the labelled path (`recycleBinRefusalLabelsOf`): a field is named by its label, the object by the page's label, and a parent object by its definition's label. Review nit N2 asked for exactly this path. - **Empty recycle bin** opens a destructive confirm that names the object and says the removal is permanent. It then calls `recycleBin.empty(object)` and toasts `emptied` (a count family) with the door's `removed`. A failed list or empty shows the door code's sentence (for example `NOT_IMPLEMENTED`), else the server message. - The SDK doors come from the adapter's client (`recycleBinDoorsOf(adapter)` → `getClient().recycleBin`), and restore from the adapter's `restoreRecycleBinEntry` (objectstack-ai#31795). No `DataSource` change. - **`CatalogAssignmentPage`**: an optional `select(entries)` narrows the catalog, and `renderSection(name, entry)` now also receives the picked entry. Both existing callers (Position holders, Permission set assignment) are unchanged. - **`@objectstack/platform-objects`**: `nav_recycle_bin` (`type: 'component'`, `componentRef: 'data:recycle-bin'`, icon `trash-2`) in the Setup app's `group_configuration`, after Data Lifecycle, beside the `sys_recycle_bin` store this package registers. It has no `requiredPermissions`, because the grant is per object. The label is added in all 11 `apps/translations/*.ts`, with its source digest recorded in the 10 `*.source-hashes.ts`. - **`@object-ui/i18n`**: `recycleBin.page.*` in every pack (title, subtitle, list and filter labels, the no-object state, pick, column heads, Restore, Load more, the empty action, dialog and failure lines), plus two count families, `related` and `emptied`. zh-Hant is generated with `gen:zh-hant`. Shared wording reuses `setupAssignments.{noMatch, notFound, retry, refresh}` and `common.cancel`. - Changeset: `.changeset/30239-recycle-bin-setup-page.md`. It also names `RecordDeleteToastAction`, the type objectstack-ai#31795 exported from `@object-ui/core` (review nit N1). ## Tests - `app-shell/src/views/setup/RecycleBinPage.test.tsx` (20 cases). It runs through a real `I18nProvider` with the shipped packs and a real `MePermissionsProvider`; the stand-ins are the adapter, the metadata store and sonner. - **The object list:** only the managed business objects are listed, with no bin read. A member who manages none sees the no-object state, with no bin read. CONTROL: `'*'` `modifyAllRecords` lists every business object and no platform object. A link to an unmanaged object reads nothing. - **One object:** - One read at `{ limit: 50, offset: 0 }`, which names the record, the related count and who deleted it, through one `sys_user` read. - Load more reads at offset 50, appends, and stops when the door says there is no more. - An empty bin says so, and Empty is disabled. - `NOT_IMPLEMENTED` reads its own sentence, and Retry reads again. - **Restore and empty, en and zh:** - Restore calls `restoreRecycleBinEntry('crm_lead', 'rb_1')`, never `create`, toasts `restoredNamed` and drops the row with no re-read. - `RESTORE_UNIQUE_VALUE_TAKEN` names the field by label ("Email"). `RESTORE_PARENT_IN_RECYCLE_BIN` names the parent object by label ("Account"). In both, the row stays. - CONTROL: an unknown code keeps the server message. - Empty asks with the title and body, then calls `empty('crm_lead')` and toasts `emptied`. CONTROL: Cancel empties nothing. - `app-shell/src/views/setup/RecycleBinPage.navContribution.test.tsx`: the ref is registered by the production module, owned by app-shell, addresses `component/data/recycle-bin`, and mounts through `ComponentNavView`. - **Two existing census files are edited**, both because the new entry moved a count they keep. The seat approved both after CI found them. - `packages/cli/test/connect-agent-both-halves-wire.pin.test.ts` counts the Setup tree the platform admin is served. `nav_recycle_bin` makes it 33, where it said 32. Both `toHaveLength(32)` become 33, and the history comment and the "24 entries `SETUP_NAV_CONTRIBUTIONS` carries" line move by one. A new `toContain('nav_recycle_bin')` ties the bump to this entry. - `app-shell/src/console/__tests__/openPathObjectReaders-12811.test.ts` gains one `OBJECTS_READERS` row. `RecycleBinPage.tsx` reads `useMetadata().objects`, and it is classified `off` (Setup → Recycle Bin, not mounted on an app object-list open). ## Acceptance notes - **Out of v1, per the amendment:** per-entry purge, a "restore the parent first" button, and a cross-object listing. Entries of an uninstalled package's object are unreachable from this page until the TTL reap. - **A formula `nameField` reads its fallback in the list.** The bin's snapshot holds stored columns, so a formula title is absent from the served row. The row falls to the next name-ish field: in dev:crm, a contact reads "Alan" rather than "Alan Turing". After a restore, the record and its toasts read the full title. - The live run was done as the organization admin. The member's no-object state is pinned in the test above and was not run live. ## Verification Head `701e095b`: the page `59cc82e1`, the tests, the changeset, the collection-time linter import `test(ui)`, origin/main merged at `4ed20928`, and two commits for reds that CI found after the PR opened. `425681c5` renames the page's local served-entry type to `RecycleBinListEntry`, because `@objectstack/spec/data` already exports `RecycleBinEntry` (`check:spec-symbols`, a Type Check UI step outside dispatch-gates). `701e095b` holds the two census edits named under Tests. The merge of origin/main at `4ed20928` (11 incoming commits; none touches this diff's files, and no parallel fix was found). Branch restarted from `56cac5eb`, the landing of objectstack-ai#31795. <details><summary>Tests (ui vitest from ui/, under the verify lock)</summary> - `packages/app-shell/src/views/setup/` (13 files): `Tests 159 passed (159)`, including the 20 new page cases and the 3 nav cases. - `packages/i18n/` plus every app-shell test importing `builtinComponents`: `Test Files 120 passed (120)`, `Tests 1946 passed | 13 skipped`. This covers `de-quote-pairing-3876`, `all-locales-key-parity`, `count-families-11445` and the census pins; the new de keys carry no „…“ pair. - `@objectstack/platform-objects`, whole package: `Test Files 120 passed (120)`, `Tests 1932 passed (1932)`. `service-settings` `settings-branding-posture.pin`: 15 passed. - At `701e095b`, after the CI reds, each whole package was run: - `@object-ui/app-shell` in 8 locked `--shard=k/8` runs: 2221 files (2220 passed, 1 skipped), `Tests 20310 passed | 9 skipped`. - `@objectstack/cli`: `Test Files 616 passed | 2 skipped (618)`, `Tests 7692 passed | 10 skipped`. - `@objectstack/platform-objects`: 1932 passed. - `service-settings` `setup-nav-hub-parity`: 23 passed. - `pnpm --dir ui run check:spec-symbols`: 0 untriaged collisions. - `turbo run type-check --filter=@object-ui/app-shell --filter=@object-ui/i18n`: `Tasks: 70 successful, 70 total`. </details> <details><summary>Ablation (scripts/ablation-replace.mjs, anchor x1 -> x0, restored blob == HEAD f34b237 and git diff HEAD empty)</summary> The manage gate in `setup/recycleBin.ts`, `entries.filter((e) => managesRecycleBin(effectiveObjects, e.name))`, was replaced by `entries.filter(() => true)`. `RecycleBinPage.test.tsx`: `Tests 4 failed | 16 passed (20)`. The 4 are every object-list pin: the managed-only list, the member's no-object state, the `'*'` CONTROL's platform exclusion, and the unmanaged link. The restore, refusal, paging and empty pins stay green, as they should. </details> <details><summary>Live run on dev:crm (en and zh, as the organization admin; scripts and shots in the project folder issue-30239/live-pr2/)</summary> Workspace built (`pnpm build` 119/119, `pnpm console:build` 76/76), `pnpm dev:crm`. Setup through the data door: an account, an opportunity with two line items (a master-detail cascade), and three contacts. The opportunity and two contacts were then deleted. Each answer carried `recycleBinEntryId`, and the opportunity's entry has `recordCount: 3`. - **Record page (objectstack-ai#31795):** Delete asks "Are you sure you want to delete this record?" with no permanence sentence; zh: 确定要删除此记录吗?. The toast reads `Contact "Ada Lovelace" deleted · Undo`; zh: 联系人“Ada Lovelace”已删除 · 撤销. Undo answers `POST …/crm_contact/recycle-bin/:entryId/restore` 200, toasts `Contact "Ada Lovelace" restored`, and returns to the record's URL. - **Setup → Recycle Bin:** the nav entry is present. The object list sent no bin read (the only `/recycle-bin` requests before the pick were the record-page restore and the page's own HTML). Picking Opportunity sent `GET …/crm_opportunity/recycle-bin?limit=50&offset=0` once and showed "Acme renewal · and 2 related records · Dev Admin · 11/9/2026, 6:17:40 AM · 12/9/2026". - **Restore:** `POST …/restore` 200, toast `Opportunity "Acme renewal" restored`, and the row left the list. - **Empty:** Contact listed two entries. The dialog reads "Empty the recycle bin of Contact? Every deleted Contact record in it is removed for good. This cannot be undone." Confirming sent `DELETE …/crm_contact/recycle-bin` 200, toasted "2 deleted records removed for good", and the list read empty. - **The same in zh:** 及 2 条相关记录; 商机“Acme renewal”已恢复; 清空联系人的回收站?; 已永久移除 2 条已删除的记录. </details> <details><summary>Gates</summary> `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`: 67 derived commands, each exit 0 (`check:type-check-debt` under the verify lock, `check:query-options-erasure` alone). - `check-plugin-teardown-shape --self-test` needed its pinned fixture fetched into the shallow clone, then passed. - `check:test-source-alias` first flagged the new nav pin, which reaches `celAuthoring.ts`'s dynamic `@objectstack/lint` import through `builtinComponents`. The fix, a module-top `import '@objectstack/lint'` in that pin, is commit `test(ui)`. That gate and `check:undeclared-dep-imports` were re-run after it. - `--ran` reconciliation: `67 derived, 67 run, 0 NOT-MEASURED, 0 UNRUN`. `--tier`: no path-derived mandate. - Changed lines 1278 (+1269 / -9): implementation about 517, tests about 399, locale packs about 326, platform-objects nav and translations 27. - The body gates (`check-changeset-no-major`, `check-adr-0087-registration`, `check-closing-keyword-parity`, `check-partof-closing-keyword`) were run on this body. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jR7jBcj3r4Rii4HA82)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jR7jBcj3r4Rii4HA82 <!-- signed: domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steedos · project thread
Part of #30239
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
POST {data}/:object/recycle-bin/:entryId/restore,按原 id 恢复,不会重新创建记录;恢复被拒时按原因给出七句之一(唯一值被占、父记录已彻底删除、包已卸载、父记录也在回收站、条目不存在、无权限、本部署没有回收站)。业务对象的删除确认改成只问“确定要删除这条记录吗?”,不再说“此操作无法撤销”;平台对象(sys_、cloud_、ai_)保持原文。recycleBinEntryId(适配器丢了它),确认框还在说“无法撤销”,这和服务端的实际行为不一致。allowRestoreOwnDeleted(经objectPermissionGrants读取,manageRecycleBin、modifyAllRecords也算)。缺任一项时提示与今天逐字相同;批量删除的提示不变。DataSource只做加法(delete仍返回 boolean)。回滚即撤销本 PR。ui/packages/core/src/actions/recordDelete.ts的successToast和undo,再看core/src/actions/recycleBinRestore.ts(拒绝码到语言包键的映射)和app-shell/src/utils/recycleBinRestore.ts(权限判断)。ui/下跑pnpm exec vitest run packages/app-shell/src/hooks/__tests__/useObjectActions.deleteDialog-11695.test.tsx -t 30239,预期 8 个用例全绿(en、zh 各四个:往返、拒绝原因、无权限对照、无条目对照)。Fixes #30239),它复用本 PR 的拒绝原因映射。What changes
@object-ui/typesDataSource, additive only:delete(resource, id, opts?)options gainonRecycleBinEntry?: (entryId: string) => void, andDataSourcegains an optionalrestoreRecycleBinEntry?(resource, entryId).deletestill resolves to a boolean.@object-ui/data-objectstack:deletecallsonRecycleBinEntrywith the server'srecycleBinEntryId, after the delete's mutation event, only when the delete succeeded and the answer carries a non-empty id.restoreRecycleBinEntryis the SDK'srecycleBin.restore. It emits no mutation event (the vocabulary has no restore, and a restore is never a create), and a refusal is normalised as every write's is, so a 409RESTORE_*keeps itscodeanddetailsand is not aConcurrentUpdateError.@object-ui/core:recycleBinRestoreRefusalText(t, error, labels)withRECYCLE_BIN_RESTORE_REFUSAL_KEYS. It maps the door's seven codes (the spec's fourRECYCLE_BIN_RESTORE_REFUSAL_CODESplusRECORD_NOT_FOUND,PERMISSION_DENIED,NOT_IMPLEMENTED) to onerecycleBin.refusal.*sentence each, naming objects and fields by label with the machine name as fallback. An unknown code answersundefined, so the caller keeps its generic copy. The admin page in PR 2 reuses it.recordDelete: the host passes an optionalrestore(andrefusalLabels). With both an entry id andrestore, the success toast carries anactions.undoaction. Undo restores, refreshes, and toastsrestoredNamed/restoreSuccess; a refusal toastsrestoreFailedwith the refusal sentence, or the server message for an unknown code. With neither,toast.success(message)is called with exactly one argument, as today. The entry id is asked for only whenrestoreis present, so a host without it callsdelete(object, id)exactly as before.recordDelete.entersRecycleBin(name)is the engine's own predicate (!hasPlatformObjectPrefix). It picks the confirm copy:objectActions.deleteConfirmQuestionandconsole.objectView.bulkDeleteQuestionfor a business object, today's keys for a platform object.app-shelluseObjectActions(console list) andRecordDetailView(record page) buildrestorethrough the newutils/recycleBinRestore.ts. That util readsusePermissions().effectiveObjectsasMePermissionsProviderdoes (lowercase key, the key as given, then'*') and folds it withobjectPermissionGrants(…, 'allowRestoreOwnDeleted'). On the record page, a successful Undo also navigates back to the record.plugin-viewObjectView(the plugin list) does the same with a local reader, since it cannot import app-shell, and its fallback dictionary gains the new English keys.plugin-detailDetailView: the confirm readsdetail.deleteConfirmQuestionfor a business object, per the amendment. Platform objects and a declaredschema.deleteConfirmationare unchanged.@object-ui/i18n, every pack:objectActions.deleteConfirmQuestion,restoredNamed,restoreSuccess,restoreFailed;detail.deleteConfirmQuestion; theconsole.objectView.bulkDeleteQuestioncount family; andrecycleBin.refusal.{uniqueValueTaken, parentPurged, packageUninstalled, parentInRecycleBin, notFound, permissionDenied, notAvailable}. zh-Hant is generated withgen:zh-hant. Each question is the platform sentence minus its permanence sentence..changeset/30239-recycle-bin-undo-toast.md(seven@object-ui/*packages, patch).Tests
New:
core/src/actions/__tests__/recycleBinRestore.test.ts: the key map covers the spec'sRECYCLE_BIN_RESTORE_REFUSAL_CODES; anit.eachover the seven codes checks the exact key and placeholders; the field label falls back to the machine name; CONTROL: an unknown code and a codeless error answerundefined.core/src/actions/__tests__/recordDelete.test.ts, new describe "recordDelete and the recycle bin": business vs platform confirm copy; a round trip where Undo restores once with(object, entryId), never callscreate, refreshes and names the record; a refusal toasts its sentence, not the server message; CONTROLs for an unknown code, no entry id, norestore, and a batch.i18n/src/__tests__/recycle-bin-delete-copy-30239.test.ts: in every pack, each question equals its platform sentence minus the permanence sentence, the seven refusal sentences are distinct, none equals the generic failure, and each carries en's placeholders; the restore toasts' placeholders; exact en and zh-Hans sentences.app-shell/src/hooks/__tests__/useObjectActions.deleteDialog-11695.test.tsx, newdescribe.eachen/zh "console list Delete undo", through the realMePermissionsProvider: round trip; a refusal in the session language; CONTROL with no grant (deletecalled with two arguments and a one-argument toast); CONTROL with no entry id.app-shell/src/utils/__tests__/recycleBinRestore-30239.test.ts: the grant fold (allowRestoreOwnDeleted,manageRecycleBin,'*'modifyAllRecords, case), plus CONTROLs: no read, no row, permissions not loaded, no restore on the data source.data-objectstack/src/recycleBinEntry-30239.test.ts: the entry id is reported after the mutation event; no report without an id or for an unconfirmed delete; restore callsrecycleBin.restorewith no create and no event; a 409 refusal keepscodeanddetails.Edited pins. Each asserted the permanence sentence or key on a business object, which this card retires; nothing else in them changes and no assertion is removed:
app-shell/src/hooks/__tests__/useObjectActions.test.tsx:objectActions.deleteConfirm→objectActions.deleteConfirmQuestion, andconsole.objectView.bulkDeleteConfirm→console.objectView.bulkDeleteQuestion(crm_product).app-shell/src/hooks/__tests__/useObjectActions.deleteCascade-28472.test.tsx:EN/ZH.objectActions.deleteConfirm→deleteConfirmQuestion, andbulkDeleteConfirm_other→bulkDeleteQuestion_other, as the base the cascade line is appended to.app-shell/src/views/RecordDetailView.deleteCascade-28472.test.tsx:EN.objectActions.deleteConfirm→deleteConfirmQuestion, the same base.app-shell/src/views/RecordDetailView.deleteConfirmDialog-11001.test.tsx: the body is found bydeleteConfirmQuestion(en and zh). The Record delete: the confirm dialog never says the delete is permanent, and the toast says "Record deleted" without naming the record #27823 assertion "the body containsThis cannot be undone." becomes "the dialog does not contain it" for this business record (crm_call). The platform-object side is still pinned, unedited, ini18n/src/__tests__/record-delete-permanent-27823.test.ts.plugin-view/src/__tests__/ObjectView.gridDelete-10383.test.tsx: the two literal sentences loseThis cannot be undone., and the docblock bullet says why.core/src/actions/__tests__/recordDelete.test.ts(confirmCopy) andrecordDelete.cascade-28472.test.ts: the business-object cases expect the Question keys.i18n/src/__tests__/record-delete-permanent-27823.test.ts: docblock only, saying the sentence is now the platform keys'.Acceptance notes
member_defaultholds neitherallowRestoreOwnDeletednormanageRecycleBin, so a default member sees no Undo until an admin grants it. The restore door would refuse them anyway, and the toast never offers an action the runtime refuses.Verification
Head
e6d5861b. Branch cut fromc2bb879f, with origin/main merged ate253f3ab(five incoming commits; none touches this diff's files, and no parallel fix was found).Tests (ui vitest from ui/, under the verify lock)
Tests 155 passed (155).useObjectActions.deleteDialog-11695,useObjectActions,useObjectActions.deleteCascade-28472,RecordDetailView.deleteConfirmDialog-11001,RecordDetailView.deleteCascade-28472,ObjectView.gridDelete-10383,DetailView,DetailView.permissions):Test Files 8 passed (8),Tests 78 passed (78).recycleBinRestore-30239,recycleBinEntry-30239,onMutation,bulkDelete: all passed (52 tests).pnpm exec turbo run type-checkon types, core, data-objectstack, app-shell, plugin-view, plugin-detail and i18n:Tasks: 75 successful, 75 total.Ablation (scripts/ablation-replace.mjs, anchor x1 -> x0, restored blob == HEAD 1283125320a4 and git diff HEAD empty)
The undo attach line in
recordDelete.ts,if (!entryId || !restore) {, replaced byif (true) {, so no toast ever carries Undo.recordDelete.test.tswithuseObjectActions.deleteDialog-11695.test.tsx:Tests 7 failed | 29 passed (36). The 7 are the core round trip, the refusal and unknown-code cases, and the app-shell round trip and refusal in en and zh. The no-grant and no-entry CONTROLs stay green, as they should. The core module is imported fromsrc, so there is no dist leg.Gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 40 derived commands, each run ate6d5861bwith exit 0 (check:type-check-debtunder the verify lock,check:query-options-erasurealone).--ranreconciliation:40 derived, 40 run, 0 NOT-MEASURED, 0 UNRUN.--tier: no path-derived mandate.check-governed-merges --branch: 0 of 36 paths hit the register, not governed. Examples census (git grepof the touched copy, keys and members inui/examples/**andui/e2e/**): no hit that reads the changed copy.eslinton the touched sources and new tests: 0 errors. Changed lines 1432 (+1369 / -63): implementation about 420, tests about 690, locale packs about 235. The body gates (check-changeset-no-major,check-adr-0087-registration,check-closing-keyword-parity,check-partof-closing-keyword) were run on this body.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jR7jBcj3r4Rii4HA82