Repository navigation
fix(ui): record delete says it cannot be undone and the toast names the record - #27850
Conversation
…he record Fixes the one-record delete question on the list, the record page and the object-view grid, and plugin-detail's own confirm, in all ten packs; the success toast names the record through recordDelete.successText. Claude-Session: https://claude.ai/code/session_01Utp6CbDAucNyQ4UtzCJKyh Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CYTT4mayn9WzbCF7tz Co-authored-by: Claude <noreply@anthropic.com>
|
domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh |
|
domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh Contract reviewServed-tier: Face: declaration only. The PR body, the changeset and claim 6512214417 each say ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
|
domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh 席位核对ACCEPT · head
Generated by Claude Code |
Requested by Bill · project thread
维护者速读
Task "Website Relaunch" deleted,批量删除仍报条数。十个语言包都有。objectActions.deletedNamed。回滚就是 revert 本 PR。ui/packages/core/src/actions/recordDelete.ts(successText与run的单条分支)、ui/packages/app-shell/src/views/RecordDetailView.tsx(记录页删除段)、ui/packages/i18n/src/locales/zh.ts。pnpm --dir ui exec vitest run packages/core/src/actions/__tests__/recordDelete.test.ts packages/i18n/src/__tests__/record-delete-permanent-27823.test.ts,预期全绿。Fixes #27823
Clause-②: yes (widening)
Metadata-protocol: none
What changes
Measured on
origin/mainat359e935dbefore the edit. Every one-record delete entry point asks through the sharedrecordDelete.confirmCopyin@object-ui/core, and the copy question isobjectActions.deleteConfirm:RecordDetailView)objectActions.deleteConfirmdetail.deleted"Record deleted"useObjectActions.deleteRecord)objectActions.deleteConfirmobjectActions.deleteSuccess"{{label}} deleted successfully"useObjectActions.deleteRecords)console.objectView.bulkDeleteConfirm(already "This cannot be undone.")objectActions.bulkDeleteSuccess(count)plugin-viewObjectView)DetailViewhandleDeletedetail.deleteConfirmation(native confirm)onDelete)After:
objectActions.deleteConfirmanddetail.deleteConfirmationend with the pack's own permanence sentence, the exact sentenceconsole.objectView.bulkDeleteConfirmalready ends with, in all ten packs (en "This cannot be undone.", zh "此操作无法撤销。"). The inline fallback maps inplugin-viewandplugin-detailmatchen.recordDelete.successText(deps, record): the object label plus the record's display name fromgetRecordDisplayName(the resolver the confirm title already uses). The resolver'sRecord #idfloor is not a name, so a nameless record keepsobjectActions.deleteSuccess, the same rule the record-save toasts (form.createdNamed) follow.recordDelete.runuses it for one record (the row fromparams.record, or the singleparams.recordsentry) and takes an optionalobjectDefso the name follows the declarednameField; the console list and the object-view grid now pass it. The record page uses the same helper over the same readable row its confirm title reads.@object-ui/i18ngainsobjectActions.deletedNamed({{label}} "{{name}}" deleted, each pack in itsform.createdNamedstyle, sodeuses „…“).Overlap: none. Seat 4's PR #27793 edits
RecordDetailView.tsxapiHandleronly; this PR edits only the header DeleteonClickthere.origin/mainwas merged before the PR (14 commits, no file in common).Tests
core/src/actions/__tests__/recordDelete.test.ts:successTextnames the record by its declared name field; a nameless record (Record #idfloor) and a missing row keep the object-label toast;runnames theparams.recordrow; control: the batch toast keeps its count.i18n/src/__tests__/record-delete-permanent-27823.test.ts: in each of the ten packs both one-record questions end with that pack's batch permanence sentence (read from the pack, not written out), anddeletedNamedinterpolates exactly{{label}}and{{name}}.RecordDetailView.deleteConfirmDialog-11001.test.tsx: the record page's dialog body carries the permanence sentence and the success toast is the named one.ObjectView.gridDelete-10383.test.tsx: the grid row Delete's question and named toast.residue-namespaces-3546(detail.deletedleft the inline-default table because its call site is gone, accounted for likekanban.columns),de-quote-pairing-3876(one more „…“ pair: 100 → 101).Ablations (two legs, through scripts/ablation-replace.mjs, restored to HEAD blob)
recordDelete.successTextreturnsobjectActions.deleteSuccessunconditionally (anchor 1 → 0, blob5dc54382→c23705e9): 4 failed / 23 passed acrossrecordDelete.test.ts,ObjectView.gridDelete-10383,RecordDetailView.deleteConfirmDialog-11001. The nameless-record case and the batch control stayed green, as they should. Restored: blob == HEAD,git diff HEADempty.enobjectActions.deleteConfirmwithout the sentence (blobbec64d03→ffdb6618): 2 failed / 23 passed (record-delete-permanent-27823en case,RecordDetailView.deleteConfirmDialog-11001dialog case). Restored: blob == HEAD.Local runs
Final head
6ff4636e(branch tipc92450e9+ a merge oforigin/main, 14 commits, no file in common).Targeted, pre-merge: 97 files, 1448 passed / 13 skipped (core recordDelete, all of
i18n/src/__tests__/, the object-view grid delete, the record page delete dialog and confirm parity, bothuseObjectActionssuites).Neighbours, pre-merge:
core/src/actions/,plugin-view/,plugin-detail/and the other files that pin these keys: 468 files, 4579 passed / 18 skipped.Derived gates (
dispatch-gates --commands): 33 of 34 run, every one exit 0; the 34th,pnpm --dir ui exec vitest run scripts/, ran alone after the merge (below).After the merge, on
6ff4636e:pnpm install --frozen-lockfile, rebuilt the@object-ui/app-shellclosure (lock VERDICT exit 0), thentype-checkexit 0 for@object-ui/core,@object-ui/i18n,@object-ui/plugin-view,@object-ui/plugin-detailand@object-ui/app-shell;pnpm --dir ui exec vitest run scripts/171 files, 4902 passed / 2 skipped; the targeted set again 97 files, 1448 passed / 13 skipped.dispatch-gates --ran: 34 derived families accounted for, 0 NOT-MEASURED. The 33check:*/ node gates ran onc92450e9(pre-merge; the merge touched none of this diff's files).pnpm check:new-line-citations: 0 new citations.Acceptance notes
detail.deleted("Record deleted") has no call site after this PR. The key is left in the packs: retiring it is the dead-key sweep's call (check-i18n-dead-keys.mjs, report-only), the same dispositionkanban.columnsgot.operation: 'delete'inObjectGrid'sBulkActionDialogshows its own declared copy; the built-in Delete paths above are the ones the card names.DetailViewdelete still asks throughwindow.confirm; only its copy changed here.Verification
CI runs the full ui battery (Type Check UI, Test UI, Build & E2E UI, Live E2E UI).
🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CYTT4mayn9WzbCF7tz
Generated by Claude Code