Repository navigation
Send for Approval, Start Signing and Activate confirm with the generic 「操作已成功完成」 instead of saying what happened - #167
Merged
Conversation
Submit, Withdraw, Accept for Review, Send for Approval, Start Signing,
Activate and Terminate declared no successMessage, so every press toasted
the console's generic 「操作已成功完成」 / "Action completed successfully".
Each now names the change ("Sent for approval." / 「已送审,进入审批。」),
with the zh-CN sentence under the same _actions key the existing
successMessage translations use.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017nzWFRUo2U7evMkPdVniAn
Contributor
Author
席位核对 — ACCEPT · head
|
| check | reading |
|---|---|
| shape | draft → main, Fixes #158; mergeable clean against the current main |
| CI on the head | both Validate check-runs success on ce953fa = PR head.sha |
| scope | 3 files (+29): transition(…) now requires a successMessage, and terminate_contract gets its own; en and zh-CN strings are under _actions.<name>.successMessage, the existing key. This is within the claim's surface. Nothing governed; lint shows only main's one warning |
| the defect | measured on 18.2.0, before and after, each press made by its own persona in zh-CN. Before: all seven toasts read 「操作已成功完成」. After: 合同已提交。· 草稿已撤回,合同已作废。· 已受理,进入法务审查。· 已送审,进入审批。· 已进入签署。· 合同已生效。· 合同已终止。 In en: 'Contract terminated.' and 'Accepted into legal review.' |
| wording | the three examples in the card are used verbatim. No {{ record.contract_number }}: the template was measured to work, but the toast sits under the contract's own header. Accepted |
| observation | to prepare 发起签署, the records manager could not add the clean version to an approved contract (403, master edit). Legal owns the clean version (§06), so this is as designed. Noted, no card |
Landing: under the maintainer's merge authorization (project thread: 「你可以自己审核的就自己合并」).
Generated by Claude Code
zhuangjianguo
marked this pull request as ready for review
October 27, 2026 09:47
This was referenced Oct 27, 2026
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.
Fixes #158
Clause-②: no
Metadata-protocol: none
Submit, Withdraw, Accept for Review, Send for Approval, Start Signing, Activate and Terminate declared no
successMessage. Each press toasted the console's generic 「操作已成功完成」 ("Action completed successfully"), so the user had to read the status chip to learn what happened. Each now says what changed.What changed
src/actions/contract-lifecycle.actions.ts:transition(…)takes a requiredsuccessMessage(afterdescription) and puts it on the action. Every transition therefore has to say what it did. The six actions it builds get one sentence each.terminate_contractis hand-written rather than built bytransition(…), but the card names it, so it gets its ownsuccessMessage.src/translations/{en,zh-CN}/objects.contract.ts: the same sentences, under each action's_actions.NAME.successMessage. These are the keysstart_renewal,launch_contractandexecuted_uploadalready use.The submit sentence does not say where the contract went next. A type without legal review hops straight to approval, and one with it goes to a lawyer, so any wording that named a destination would be wrong for one of the two.
Measured:
{{ record.contract_number }}renders, but is not shipped18.2 made
successMessagea template slot overresultandrecord(objectstack 384bb7b). I tried it before choosing the wording, as an uncommitted probe once953fawith a fresh DB and the same personas. Terminate becameContract {{ record.contract_number }} terminated./合同 {{ record.contract_number }} 已终止。, and Send for Approval became{{ record.contract_number }} sent for approval./{{ record.contract_number }} 已送审,进入审批。.pnpm validateEXIT=0,pnpm lintEXIT=0 (same 1 warning and 6 suggestions),pnpm lint:i18n-gateEXIT=0.The hole works, but I left it out. These actions sit in the record header only (
locations: ['record_header']), so the toast always shows on the contract's own page, directly under a header that already reads 合同编号 MSA-2026-0016. Without the number the sentence is shorter and matches the existing ones ("Renewal draft created.", "Contract launched."). Adding the number later is a one-line change per key.Browser measurement: @objectstack 18.2.0,
pnpm demo:zh --port 3145, fresh DB before and afterPersonas were set up the README way, as the dev admin.
create-userwas run for Business Requester 1, Legal Counsel 1, Legal Counsel 2, Records Manager and Executive (each 200). The last four gotsys_user_positionrowsclm_legal_counsel×2,clm_records_managerandclm_executive(each 201). Each persona ranchange-password(200), andset-user-managermade Executive the manager of Business Requester 1 (200). Thenpnpm demo:zhwas run again on the same DB to hand over the rows (updated: 209). Each reading was taken in Chromium (/opt/pw-browsers/chromium), signed in as the persona who presses the button, and read from the sonner toast.Before = origin/main
91a79dd. After =ce953fa.terminate_contract)Every press answered
POST /api/v1/actions/clm_contract/ACTION → 200 {"success":true}, and the header then showed the new status. The browser console in every run showed the same two resource errors (one 404, one 401), before and after. Nothing new appeared. No boot loggeddegradedorno such table. Every boot ended with the same seed summary: first bootinserted 830 · errored 404, the re-runupdated 209 · errored 170. The errors are the README's documented unnamed-persona references.The prerequisites for each press were written through the API by the persona who would do that work, before the press:
legal_owneron MSA-2026-0016, then recorded an approved legal review (0 open deviations).final_signedversion.On the before boot, the Records Manager's own attempt to file the clean version (on DPA-2026-0001) answered
403 PERMISSION_DENIED("master 'clm_contract' not editable by this user (row-level security)"), so the legal owner filed it. 发起签署 on DPA-2026-0001 without a clean version toasted the server'sA current clean version is required before signing.(422). The error path is unchanged by this PR.Gates (head ce953fa)
Acceptance notes
approvedcontract (row-level edit on the master). The legal owner can. This was not investigated further here. It is noted, not filed.🤖 Generated with Claude Code
https://claude.ai/code/session_017nzWFRUo2U7evMkPdVniAn