Skip to content

fix(plugin-detail): a related list's bulk delete with refused rows says why, not only how many - #37836

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 #37816

PR #37809 made the list page's bulk Delete say why records were refused. The related list on a record page has its own bulk delete, and its outcome line still gave only "2 deleted, 1 failed". The user could not tell which rows were refused or why.

Premise, measured

  • Item 1 (related list): holds. On main, handleConfirmBulkDelete in RelatedList.tsx kept { succeeded, failed } only. When the batch call answered with named errors, they were dropped. A batch call that threw only went to console.error. A rejected row delete counted as one failure and nothing more. RelatedList.tab-35892.test.tsx pinned 2 deleted, 1 failed for a batch answer that names q3 with the reason refused.
  • Item 2 (view-declared operation: 'delete'): does not hold. A bulkActionDefs[] entry with operation: 'delete' does not go through recordDelete. It runs in BulkActionDialog, through useBulkExecutor and executeBulkBatch. That dialog's result panel already lists every refused record by its title, with its own reason (userMessage ?? error). This holds on the batch path (the ids the data source names, objectui#13442) and on the row-by-row fallback. A new pin on the real ObjectGrid measures both paths; it passes on main unchanged. No fix is needed there.

What changes

  • @object-ui/core:
    • The grouping rule behind the list page's refusalSummary is exported as bulkDeleteRefusalLines(deps, refused). It returns the lines: one per distinct reason, led by up to three row names and then +N, at most three reasons and then "And N more". An external-datasource refusal reads as the read-only sentence. refusalSummary now joins these lines, so the list page's toast is byte-identical.
    • err may be the reason's text itself, because a batch call names each failed id's error as a string.
  • @object-ui/plugin-detail (RelatedList):
    • The outcome now keeps each refused row's reason, from one of three sources:
      • the ids the batch call names (a plain count names none);
      • a batch call that throws, whose error is given for every row;
      • each rejected row delete.
    • Under the count it lists the grouped lines (data-related-bulk-delete-reasons), inside the same role="status" region. The count keeps its own <p>. A long reason wraps ([overflow-wrap:anywhere]).
    • The two line keys join the plugin's fallback table. They already exist in every locale pack (fix(core): a list bulk Delete with refused records says why, not only "0 deleted, 4 failed" #37809).

Decisions made here

  • Reuse the rule, not copy it. The related list calls core's export, so the two surfaces cannot drift.
  • Lines inline, not a toast. The related list's outcome is an on-screen status line that stays after the re-read (objectstack#35892). The reasons go under it rather than into a new toast.
  • A thrown batch call is a reason for every row. On main that path showed "0 deleted, N failed" with nothing else. Its error is the one answer the user has. The rows are named because the whole batch was refused.
  • Item 2 gets a pin, not a change. It already does what the card asks. The pin keeps that measured.

Verification

  • RelatedList.tab-35892.test.tsx gains three cases, and the existing partial-failure case reads the count's <p>:
    • A refused batch names three rows with two reasons. Expected: Quote 2, Quote 4: <restrict> and Quote 3: Record is locked, in input order.
    • Row by row, two rejections with the same reason make one line. A batch call that throws lists Quote 1, Quote 2: Service unavailable under 0 deleted, 2 failed.
    • CONTROL: a batch that answers with a plain count (2 of 3) keeps the bare 2 deleted, 1 failed, with no reason list.
  • plugin-grid/src/__tests__/declaredBulkDeleteReasons-37816.test.tsx (2) is the item 2 measurement: batch path with named errors, and row by row.
  • vitest over @object-ui/plugin-detail, @object-ui/i18n, core/src/actions, app-shell's defaults-maps-mirror-en-pack, and the new grid pin: 591 files, 6,679 passed. The core recordDelete tests are unchanged and green.
  • tsc -p tsconfig.test.json for core, plugin-detail and plugin-grid: clean. eslint on the changed files: 0 errors.
  • overlap-check: exit 0.

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

…ys why

The related list's bulk delete outcome kept only the two counts. Each
refused row's reason (the ids a batch delete names, an error that refuses
the whole batch, each rejected row delete) is now listed under the count,
grouped by reason and led by the rows' names, by the list page's rule,
which core exports as bulkDeleteRefusalLines. A batch that names no reason
keeps the bare count. A view-declared operation: 'delete' bulk action was
measured: its result panel already names each refused record and its
reason; a pin holds that.

Claude-Session: https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head 35a5e9f · card #37816 · area s2-ux · 2026-11-27T06:40Z

L1 checklist

  • Shape and checks. l1-face.mjs --pr 37836 flags one item, changeset. The one @object-ui/plugin-grid file is a new test, declaredBulkDeleteReasons-37816.test.tsx, which does not ship, so no entry is owed. 45 checks succeeded and 13 were expected skips, none failed. Patch changesets on @object-ui/core and @object-ui/plugin-detail. Clause-②: no, Metadata-protocol: none.
  • 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.
    • bulkDeleteRefusalLines is refusalSummary's grouping, exported. refusalSummary now joins its lines, so the list page's toast is unchanged.
    • The related list collects refused rows from three sources: the ids a batch answer names, every row when the batch call throws, and each rejected row delete. It lays out one line per reason under the count.
    • A batch answering a bare number keeps the bare count, and a control pins it.
    • The two keys the lines use get English defaults in DETAIL_DEFAULT_TRANSLATIONS. The locales already carry them from fix(core): a list bulk Delete with refused records says why, not only "0 deleted, 4 failed" #37809.
  • Fixes #37816 is right.
    • Item 1 is built.
    • Item 2's premise does not hold. A view-declared operation: 'delete' goes through BulkActionDialog, whose result panel already lists each record and reason. The new plugin-grid test pins that measurement, with no code change.
  • Changeset read sentence by sentence. It matches the diff.
  • Governance. check-governed-merges.mjs: not governed, 254 changed lines. Tier S.
  • Follow-ups. None from this PR. For the next card (review follow-ups of PR #37714: swimlane kanban changelog line reads backwards; stale jsdocs; unpinned later-page gate and aggregates #37718), its N5 is split to Kanban swimlanes: row counts and per-cell figures are page floors on a windowed board; read them whole with one grouped query #37844: swimlane figures read whole with a grouped query.

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 06:41
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 1f97fce Nov 27, 2026
59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-th9squ branch November 27, 2026 07:06
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 tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

review follow-ups of PR #37809: related-list bulk delete still reports counts only; view-declared delete bulk action unmeasured

2 participants