Skip to content

fix(core): a list bulk Delete with refused records says why, not only "0 deleted, 4 failed" - #37809

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-th9squ
Nov 27, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-th9squ

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #37758

A list bulk Delete whose records were refused said only 「成功 0 条,失败 4 条」 ("0 deleted, 4 failed"). The server gives every refused record a readable, localized reason (a restrict delete says which child records still reference it), and the one-record Delete shows it; the batch summary dropped it.

What changes

  • @object-ui/core (actions/recordDelete.ts). The bulk branch of run keeps each rejected result's reason. The summary toast keeps its count title (objectActions.bulkDeletePartial) and gains a description:
    • one line per distinct reason, in the order the records were handed in;
    • each line led by the names of the records that reason refused (the same ADR-0079 resolver the success toast uses), up to three names and then +N;
    • a reason whose records have no name reads alone (the title already counts them);
    • at most three reasons, then "And N more";
    • an external datasource's refusal reads as the read-only sentence, as the one-record toast reads it;
    • a refusal with no message adds no line, so a batch with no reason at all keeps today's bare count toast.
      The one-record toast is unchanged.
  • @object-ui/i18n. Two keys in all 11 packs: objectActions.bulkDeleteRefusedNamed ({{names}}: {{reason}}, with each pack's own colon) and objectActions.bulkDeleteMoreReasons. The name/reason join is allowlisted in untranslated-identity-4376 as a format string, as detail.fieldChangeLabel is.
  • @object-ui/plugin-view. The two keys join ObjectView's objectActions.* fallback table.

Decisions made here

  • Grouped by the exact reason text, named by record. The card's own restrict example carries each record's dependent count in its sentence ("referenced by 3 records" / "by 1 record"), so records rarely share a byte-identical reason. Naming the records under each reason answers "which", which the acceptance allows ("reason, then how many records or which"); records that do share a reason are one line.
  • No counted noun in either new key. "And {{more}} more" and the name list carry no plural noun, so no pack needs a CLDR plural family for them (plural-categories-11432). The option is more, not count, so i18next does not go looking for one.
  • The description is joined with \n, as writeWarningToast and studioSaveBar do. Each reason the server sends ends in its own punctuation.
  • Not in this PR: the related list's inline bulk-delete outcome line (plugin-detail RelatedList.tsx, bulkDeleteOutcome) has the same count-only shape, and a view-declared operation: 'delete' bulk action (the card's "also seen") was not measured. Both are for the seat to file or fold.

Verification

  • core/src/actions/__tests__/recordDelete.test.ts: 6 new or changed cases, red on main and green here (6 red with recordDelete.ts reverted): an all-refused batch for one reason (names, +1), a mixed batch (two reasons, order kept, the deleted record not named), nameless records (reason alone), five reasons (three listed, "And 2 more"), an external-datasource refusal (read-only sentence), and the existing partial-failure case now with its description. Controls: refusals with no message keep the bare count with no description; the one-record refusal toast is unchanged.
  • plugin-view ObjectView.gridDelete-10383: the registered object-view bulk Delete's partial-failure pin now also asserts the refusal reason rides in the description.
  • vitest over core/src/actions, all plugin-view tests, app-shell useObjectActions* and all of i18n (1,867 passed, including key parity, plural categories and the untranslated-identity gate): green. tsc -p tsconfig.test.json for core: clean. eslint on the changed files: 0 errors.
  • overlap-check: exit 0 (feat(spec,service-knowledge)!: knowledge_source is a governed metadata type with its loader, its registry and two authoring guards #37676 and refactor(spec)!: rename the Studio helper defineForm to defineMetadataForm and its modules to *.metadata-form.ts #37366 share the locale packs and merge cleanly).
  • Premise: static read on main cac93cc (the bulk branch reads no rejected reason), and the red tests above.

Clause-②: no
Metadata-protocol: none
Skills-docs: none

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (No spec change.)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; eslint on the changed files passes (the full pnpm lint runs in CI).
  • 4. One issue, one branch off an up-to-date main, one pull request.

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri

The bulk branch of recordDelete.run settled every delete, counted the
rejections and toasted "N deleted, M failed", dropping each refusal's
reason, which the one-record toast shows as its description.

The summary keeps its counts; its description now lists the reasons:
one line per distinct reason in the order handed in, led by the names of
the records it refused (up to three, then +N), at most three reasons and
then "And N more". An external datasource's refusal reads as the
read-only sentence, as the one-record toast reads it. A refusal with no
message adds no line, so a batch with no reason keeps the bare count.

Two keys join every locale pack (no counted noun, so no plural family);
the name/reason join is allowlisted as a format string.

Claude-Session: https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head e62ffc5 · card #37758 · area s2-ux · 2026-11-27T04:42Z

L1 checklist

  • Shape and checks. l1-face.mjs --pr 37809 is CLEAN. All 45 checks on this head succeeded and 13 were expected skips. mergeable_state is clean. Patch changesets on @object-ui/core, @object-ui/i18n and @object-ui/plugin-view.
  • No contract face. record-recognisers.mjs --brief-template exits 1 on the changed paths, so this seat record at TIER_DEFAULT is the review of record.
  • Diff read. refusalSummary in ui/packages/core/src/actions/recordDelete.ts names the refused records with their reason and folds the rest into a count. The two new keys objectActions.bulkDeleteRefusedNamed and objectActions.bulkDeleteMoreReasons are present in all 11 locales with the same placeholders. The changeset sentences match the diff.
  • Fixes #37758 is right. A bulk delete that the server partly refuses now tells the user which records were refused and why, instead of a bare count, with a pin on the summary.
  • Governance. check-governed-merges.mjs: not governed, 236 changed lines. Tier S.
  • Follow-ups. The two points the PR body left for the seat (RelatedList bulkDeleteOutcome still reports a count only; a view-declared operation: 'delete' action is not measured) go to review follow-ups of PR #37809: related-list bulk delete still reports counts only; view-declared delete bulk action unmeasured #37816.

Tier: S. Landing: ready + auto-merge by this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 27, 2026 04:42
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 2980483 Nov 27, 2026
59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-th9squ branch November 27, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants