Repository navigation
feat(fields, service-messaging): a notification template's record page previews the saved template through the server door - #39707
Conversation
…get yet) Claude-Session: https://claude.ai/code/session_01L9qibyrf8y7cWLVu7DMgBN Co-authored-by: Claude <noreply@anthropic.com>
… row through the server door Claude-Session: https://claude.ai/code/session_01L9qibyrf8y7cWLVu7DMgBN Co-authored-by: Claude <noreply@anthropic.com>
…preview read face Claude-Session: https://claude.ai/code/session_01L9qibyrf8y7cWLVu7DMgBN Co-authored-by: Claude <noreply@anthropic.com>
…census rows and changeset Claude-Session: https://claude.ai/code/session_01L9qibyrf8y7cWLVu7DMgBN Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 6 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 3a11977f40b7d545b21e4e1bee5edf0494d485a7 && git checkout 3a11977f40b7d545b21e4e1bee5edf0494d485a7
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a53022ef4c35a8fee5337170670a34b0582da1e7 2581e965ca2207f6253292081401ef72128690fa && git checkout -B drift-repro a53022ef4c35a8fee5337170670a34b0582da1e7 && git merge --no-ff 2581e965ca2207f6253292081401ef72128690fa
node scripts/docs-audit/affected-docs.mjs --json a53022ef4c35a8fee5337170670a34b0582da1e7 |
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibxZ1DSpavkJARmHCQF 席位核对L1-c · PR #39707 · Verdict: ACCEPT, on green. The zone lands it once every check on this head concludes with none failed. When I read it, 17 checks were still pending, so l1-face's check items were not measured. Its unexpected skip, Face.
Ruling B, executed.
|
…s-assignment) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibyrf8y7cWLVu7DMgBN
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibxZ1DSpavkJARmHCQF 席位核对L1-c · PR #39707 · Verdict: ACCEPT (delta), on green. This carries the ACCEPT 7413797377 at Delta. One line changes, at |
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibyrf8y7cWLVu7DMgBN Landing · ot-ux2 · 2026-12-04T15:31Z · PR #39707 at
|
Requested by Tesla · project thread
Fixes #39569
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
POST /api/v1/messaging/notification-templates/ID/preview, the door Notifications: a render-only door that previews a saved notification template against sample values #39565 added) and shows the subject and body exactly as that door answers. The door renders with the same function the email and SMS channels use. There is no browser-side rendering; nothing is sent and nothing is written.amountandpayload.amountare one input.topicis filled by the server from the template's own topic, so it gets no input. Typing asks nothing; Preview with these values asks again with what was typed.updated_atmoves (falling back to its content when a row carries no stamp). An inline draft does not trigger a request.role=alert); a network failure shows its message; a row with no id shows "Save the template to preview it."; a host with no API fetch shows "The preview is not available here."notification-template-previewonsys_notification_template.body. It is promoted over the markdown base type inresolveCellRendererTypeand registered lazily (recoverableLazy), so it stays off the eager closure. The edit form is unchanged: the spec degrades an unregistered field widget to the type editor, so the body keeps its markdown editor. A grid cell draws the body alone. The edit-face route was not taken because the edit modal closes on save and never holds a saved render; the record page re-reads the row after a save.fields.notificationTemplatePreviewgroup (12 keys) in all 11 locale packs, with real translations; zh-Hant generated by the pack's own script.fit, soCHIP_UNFIT_RENDERER_TYPESis unchanged.@object-ui/fields,@object-ui/i18n,@objectstack/service-messaging).Read first
ui/packages/fields/src/widgets/NotificationTemplatePreviewField.tsx: the saved-row snapshot (setState during render keyed on the saved key) and the effect's dependency list carry the refresh-on-save rule; the envelope parse inaskDoordecides what a refusal shows.ui/packages/fields/src/index.tsx: the markdown promotion inresolveCellRendererTypeand theNotificationTemplatePreviewCellwrapper (grid cell and row-less host draw the body alone).packages/services/service-messaging/src/objects/notification-template.object.ts: the one-line widget hint onbody.Two-minute verification
Boot any app that loads service-messaging, open Setup → Notification Templates, open a template whose body names a placeholder (e.g.
customer.name), and look under Body: a Preview pane shows the rendered subject and body with an empty value where the placeholder was, plus one input per placeholder. Type a value and press Preview with these values: the body shows the typed value.Tests
ui/packages/fields/src/widgets/__tests__/NotificationTemplatePreviewField-39569.test.tsx(21 tests; the ablation below ran at 19, before the two words tests were added): placeholder and payload units; the mount request (URL, method, body); one input per placeholder; no request per keystroke; html through the sanitizer; 403 / 404 / 400 refusals; network failure; a saved-row change asks again; an unsaved draft does not; no id; no fetch; resolver promotion; record-page face; grid cell; row-less host; English and zh-CN words from the packs.resolveCellRendererType, 2 failed / 17 passed (the resolver pin and the record-page face pin).Local readings at 8aae95d (after merging origin/main with os-regen-merge.sh)
uiscripts suite under the lock (vitest run scripts/ --maxWorkers=2): 5161 passed, 2 skipped, VERDICT command-exit 0.@object-ui/fields,@object-ui/plugin-detail,@object-ui/i18n,@objectstack/service-messaging(ui closure built first).check-i18n-call-site-keys(uipnpm check:i18n-keys): exit 0.check:i18n: exit 0 (after building the CLI closure; first attempt exit 3 prerequisite).check:generated: all 14 artifacts up to date. Ratchets (type-check-coverage, type-check-debt), nul-bytes, changeset gates: exit 0.dispatch-gates.mjs --commandsderived 76 families;--ranreconciliation: 76 run, 0 missing. All exit 0 exceptcheck:dual-build-cjs-loads(exit 3, PREREQUISITE NOT MET: needs a fullpnpm build), NOT MEASURED locally, left to CI.Acceptance notes
template-renderer.ts. A cross-package drift pin would need new turbo / cross-package-test-inputs declarations, so it is not pinned here. If the renderer's grammar changes, the inputs drift; the render itself stays correct because the server renders.useFieldTranslationFIELD_DEFAULTS carries no rows for these keys, so a host with no i18n provider renders the keys themselves; every console host has the provider.ui/AGENTS.mdrule 2 docs (package README,content/docs/frontend) are outside this claim's surface and were not edited.check:dual-build-cjs-loadsNOT MEASURED locally (prerequisite), CI owns it.Verification
Browser check on the real record page (CRM example backend + Console dev server)
invoice.paid.body./apps/com.objectstack.setup/sys_notification_template/record/IDthe pane drew under Body with three inputs:number,customer.name,amount.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibyrf8y7cWLVu7DMgBN