Repository navigation
fix(app-showcase): record-action success toasts name the record - #26604
Conversation
Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
Mark Done, Recalculate Estimate, Recalculate Selection, Archive and Submit for Sign-off now name the task title (or invoice number) through a template hole over the dispatched record, falling back to the object wording through the default formatter when the dispatch carries no title. Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
…owcase-action-toasts
… the record Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
The zh-CN bundle entries for Mark Done, Recalculate Estimate, Recalculate Selection and Archive replace the source copy for a zh-CN viewer, so they carry the same record.title hole with a default fallback to the old wording. Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
维护者速读改了什么:showcase 五个记录级动作的成功提示现在点名被改的记录,英文如 "PII access review marked done."、发票 "INV-1002 submitted for finance + legal sign-off.";示例应用自带的中文语言包里四条译文同样点名,如「个人信息访问审查已标记为完成。」。只改 席位核对seat 2 · 2026-10-27T10:29Z · head
|
Fixes #26459
Clause-②: no
Metadata-protocol: none
维护者速读
examples/app-showcase/src/ui/actions/index.ts里的 successMessage 文案,外加一个钉住提示原文的测试和一个 changeset。examples/app-showcase/src/ui/actions/index.ts的五处 successMessage,以及新测试examples/app-showcase/test/record-action-success-names-record.test.ts。pnpm --filter @objectstack/example-showcase exec vitest run test/record-action-success-names-record.test.ts,10 条全绿;或启动 showcase,打开一条 done 为 false 的任务,点 Mark Done,提示应为该任务标题加 "marked done."。What
The showcase's record-level actions now name the record they changed in their success toast:
Why
Ruling C on #25849: a record-level write names the record (its title) or the count. The console renders an authored
successMessageverbatim, so the fix is the showcase's own copy, not the runner.How the hole binds (read from the runner, not changed)
ActionRunner.composeSuccessMessage(objectui core) shows asuccessMessageas written unless it carries a template hole; thenfillTemplateHolesfills it through@objectstack/formula'stemplateEngineover exactly two roots:result(the handler's payload) andrecord(the dispatch's record: the clicked row's_rowRecord, else the page's record). So the record.title hole names a task and the record.name hole names an invoice (its "Invoice Number" field).An unbound path prints EMPTY. A list row whose view does not project
titlewould therefore have read as a sentence with a hole-shaped gap, so every message pipes the hole through the engine'sdefaultformatter, and falls back to the object wording the toast used before. No sentence can render a raw hole or an empty quoted name.The count is not reachable from this copy: the copy's holes bind
recordandresult, never the selection (ctx.selectionis a target-interpolation scope only). It is also not needed. On the selection bar the aggregate dispatch runs with the success toast off (ObjectGrid.runBulkActionAggregatepassesshowOnSuccess: false), and the bulk dialog reports its own count ("Succeeded N / M"). The only placement where Recalculate Selection's toast shows is its declaredrecord_moreentry, a single-record dispatch, so it names that record and keeps "the whole selection" as the fallback.Tests
All at head
6399091d(after mergingorigin/main, closure rebuilt under the verify lock):f9e79460(pin only, copy unchanged):vitest run test/record-action-success-names-record.test.ts, 6 failed / 4 passed (10). The 4 that passed are the fallback cases, which equal today's wording by design. Example:Expected: "PII access review marked done." Received: "Task marked done.".pnpm --filter @objectstack/example-showcase test: Test Files 40 passed (40), Tests 494 passed (494).pnpm --filter @objectstack/example-showcase typecheck: exit 0.pnpm --filter @objectstack/example-showcase validate(objectstack validate, which judges action copy templates): Validation passed.Gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat6399091d: 50 derived; 49 ran with exit 0.pnpm check:dual-build-cjs-loadsexited 3, PREREQUISITE NOT MET (it needs every package'sdist/, and this card builds only the showcase closure), so it is NOT MEASURED locally and is left to CI's build.--ranreconciliation: 50 accounted, 49 run, 1 NOT-MEASURED.node scripts/check-sdui-manifest.mjs: exit 0.Acceptance notes
examples/app-showcase/src/system/translations/index.tsstill carries the old record-less wording for these actions (e.g. 任务已标记为完成。). Locale packs are outside this card's claimed file surface, so a zh-CN viewer still sees no record name.docs/qa/platform-checklist/areas/ux-conventions.jsonquotes the old Mark Done string in its variant text. It is the QA ledger's evidence prose, left to the QA seat.GenerateInvoicePdfAction("The PDF is attached to the invoice.") is also record-level copy, but the card does not name it, so it is unchanged.Generated by Claude Code