Repository navigation
fix(core, plugin-grid): show the handler's userMessage on the failure toast and a per-record failed row - #34313
Merged
Conversation
… toast and a per-record failed row The failure toast reads the action's authored errorMessage, then the refusal's userMessage, then the error. The per-record bulk runner carries userMessage on its rejection; the executor attaches it to the row as BulkRowError.userMessage, the dialog lists it, and the error CSV keeps the whole message. Claude-Session: https://claude.ai/code/session_01ADHkmSKHw9YYY8V6nVNVFk Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi 维护者速读
席位意见三处读同一个标记、同一条非空规则,和聚合路径一致,是根修。作者声明的 席位核对 — ACCEPT · domain:ui#2 · head dcc5978 · 2026-11-16T05:47Z |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steve · project thread
Fixes #34215
Clause-②: no
Metadata-protocol: none
维护者速读
errorMessage,没有就用处理器写给用户的userMessage,再没有才用平台报错原文。逐条执行的批量动作(bulkActions: ['NAME'])结果框里,失败那一行也显示userMessage;下载的错误 CSV 仍保留整句平台报错,便于排查。errorMessage的动作显示不变,没有userMessage的拒绝显示不变。BulkRowError多一个可选字段userMessage。回滚即 revert 本 PR。ui/packages/core/src/actions/ActionRunner.ts(失败提示的取字顺序);ui/packages/plugin-grid/src/hooks/useBulkExecutor.ts(逐行拒绝带上userMessage);ui/packages/plugin-grid/src/components/BulkActionDialog.tsx(行显示userMessage,CSV 仍写整句)。pnpm --dir ui exec vitest run packages/core/src/actions/__tests__/ActionRunner.test.ts packages/plugin-grid/src/__tests__/objectBulkActionDispatch.test.tsx -t 34215,预期 7 条全绿。What changes
ActionRunner,@object-ui/core): the message is the action's authorederrorMessage, else the refusal's producer-markedActionResult.userMessage, elseresult.error(seat ruling on the card's delta: authored first, because the spec declareserrorMessagethe override of the raw error). A blankuserMessageis no marking, the same non-empty ruledeclaredUserMessageand@objectstack/clientapply; the existing non-string coercion is unchanged.@object-ui/plugin-grid):ObjectGrid's per-record runner (runBulkActionRecord) attaches the refusal'suserMessageto the rejection, as the aggregate runner below it already does.useBulkExecutorreadsdeclaredUserMessageoff each per-record rejection of the custom runner and sets it on that row as a new optionalBulkRowError.userMessage;errorstays the whole text. The sharedexecuteBulkBatch(bulkFastPath.ts) is untouched.BulkActionDialoglistsuserMessagefor the row when present, elseerror; the error CSV still writeserror.content/docs/ui/actions.mdxstates the toast's order;content/docs/ui/views.mdxstates what a per-record run's row and error CSV show..changeset/34215-failure-toast-row-user-message.md(patch:@object-ui/core,@object-ui/plugin-grid).Why
A handler that refuses with a
userMessagewrote that sentence for the end user. #34213 carried it toActionResult.userMessageand showed it on the aggregate outcome; the single-record toast and the per-record failed row still showed the platform text.Tests
New block in
ui/packages/core/src/actions/__tests__/ActionRunner.test.ts, "the failure toast shows the refusal's userMessage (objectstack#34215)":userMessageof a refusal that carries one;/actionsdoor: a realcreateServerActionHandlerover a refusal envelope reaches the toast;userMessagekeeps the error;userMessageis no marking;errorMessagekeeps its text even when the refusal carries auserMessage.New block in
ui/packages/plugin-grid/src/__tests__/objectBulkActionDispatch.test.tsx, "a per-record failed row shows the refusal's userMessage (objectstack#34215)", driving the realObjectGridthroughcreateServerActionHandler:userMessage(not the platform text), and the downloaded error CSV's row keeps the platform text (not theuserMessage);userMessagekeeps the platform text on the row.Declared forced test edit: the #34213 CONTROL "a per-record dispatch with one failing row still lists that row" asserted
PLATFORM_TEXTonbulk-error-row-r2for a refusal carryinguserMessage; it now assertsUSER_TEXT, which is the behaviour this card asks for. Its comment says so.Ablations (each read removed, its pin red; every leg restored to the HEAD blob)
Run through
scripts/ablation-replace.mjsunder the verify lock,-t 34215, on head e19178c (before the main merge; the merge touched none of these files):authored || declared || result.errortoauthored || result.errordeclaredahead ofauthored.trim()to.length > 0runBulkActionRecordthrows the bare erroruserMessagee.errore.userMessage ?? e.errorui tests resolve
@object-ui/*fromsrc, so no dist leg applies.Acceptance notes
userMessageread is scoped to the promoted custom runner (the card's surface). A data-doorupdate/deleterow whose rejection carried auserMessagestill shows its message; no producer of that shape was measured, so it is noted here, not filed.Verification
All on head
dcc5978a(this branch withorigin/maina00b422 merged in), afterpnpm install --frozen-lockfile --offlineand a fullpnpm build --concurrency=2(lock VERDICT command-exit 0).pnpm --dir ui exec vitest run packages/core/ packages/plugin-grid/— Test Files 521 passed (521), Tests 6882 passed, 27 skipped; lock VERDICT command-exit 0.pnpm --filter @object-ui/core type-check && pnpm --filter @object-ui/plugin-grid type-check(each runstsc --noEmitandtsc -p tsconfig.test.json) — VERDICT command-exit 0.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstacklisted 72 families for the 9 changed paths; all 72 ran, each exit 0;--ranreconciliation: 72 derived, 72 run, 0 NOT-MEASURED, 0 UNRUN.pnpm --dir ui run check:new-line-citations: 0 new citations.!in the title and no(narrowing)arm.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses. (No formatter ran; the repo-wide lint is CI's run, read from this PR's checks.)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code