Repository navigation
Commit c9741f4
fix(approvals): the Approval Actions list names the step and the platform's own notes in the reader's language (#37623)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuQVQdf3PvoJbKFFCUA4gwJB)_
Fixes #37531
## What changes
`sys_approval_action` read through the generic data door (Setup's
Approval Actions list, views `recent` / `by_actor` / `all_actions`; an
action's record page; the export) now serves a reader with a locale the
text the approvals door's timeline serves:
- **`step_label`**: the step's label from the app's pack,
`flows.<flow>.approvals.<step_name>.label`, the flow named by the parent
request's `process_name` — the key the Approval Requests list is already
translated by (#27041).
- **`comment` on the rows the platform writes** (no actor):
- the administrators' routing note, the submitter exclusion note and the
no-approver note, already stored as data on the request's node-config
snapshot and already rendered on the timeline;
- the record-deleted cancellation ("Auto-cancelled: the … record '…'
this request is about was deleted"), now the catalog sentence
`approvalAutoCancelledRecordDeleted` (all eleven shipped `messages`
locales), composed from the request's own `cancel_reason`, `object_name`
and `record_id`. No stored shape moves: the row's `comment` is the
sentence's `en` rendering with the object's name, byte-identical to what
it stored before.
One render serves both doors: `ApprovalService.localizeActionRows`
replaces the timeline's `localizeRoutingNotes`, and the new engine
middleware `action-locale-middleware.ts` (bound beside
`reader-locale-labels-middleware.ts`, same shape) hands the generic
door's rows to it. A list that selects `step_label` or `comment` without
the columns their text is picked by borrows them for the read and is
served exactly the columns it selected.
Unchanged: storage (the stored step label stays the authored snapshot,
the stored comment the English); a system read, a reader with no locale
and a language the pack does not hold are served the stored text; a
comment a person wrote is served as written.
**Out of scope, by the seat's claim (7196522515):** four other
platform-written comments are still composed as English prose with
parameters nobody stores as data — the revision-limit auto-reject, the
dead-run abandon, the SLA escalation and the out-of-office substitution.
The seat files the follow-up card at ACCEPT.
## Why
The card: in a zh-CN console the Approval Requests list shows 销售经理审核,
the Approval Actions list the same step as "Sales Manager Review", and
the system notes as English sentences. The approvals door already
localized the notes on its timeline (#25576 deliberately left the
generic door on the stored English); this extends the same render to the
generic door, the way #27041 did for the request's labels.
## Verification
- New `action-locale-data-door.integration.test.ts` (real `ObjectQL`
over SQLite, real `AutomationEngine`, real plugin, real in-memory `i18n`
with a zh-CN pack holding the flow's labels and this plugin's zh-CN
`messages`; the door is `ObjectStackProtocolImplementation.findData` /
`getData`): 8 tests green. zh-CN reader: step label and exclusion note
in zh-CN on the `recent` projection, a person's comment as written,
borrowed columns not served; a `step_label,comment`-only projection; the
by-id read; the record-deleted cancellation in zh-CN with its stored
English unchanged; parity with the approvals door's timeline. Fences:
ja-JP / en / no-locale readers and a system read get the stored text;
storage untouched.
- Ablation: with the middleware unbound, 5 of 8 red (every zh-CN pin on
the data door), 3 green (the fences).
- `@objectstack/plugin-approvals` whole suite: 130 files / 1964 tests
green after classifying the new `actor_id` presence test in
`approver-address-readers.test.ts` (it replaced the
`localizeRoutingNotes` entry, same role and reason).
- `typecheck` (incl. `check:test-typecheck`) exit 0; eslint on the
changed files 0 problems; `overlap-check` clean against `origin/main`
54d6726 and 0 PR heads.
Clause-②: no
Metadata-protocol: none
Owed: L1 (seat). L2: none named by me — no contract surface; the served
text of a generic-door read changes for localized readers only, the same
direction #27041 took.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgU7eeqHgQrtv5CeJK6
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgU7eeqHgQrtv5CeJK6)_
<!-- signed: repo:objectstack#2 · os-sales ·
session_01L6bhgU7eeqHgQrtv5CeJK6 -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2eadf56 commit c9741f4
10 files changed
Lines changed: 597 additions & 47 deletions
File tree
- .changeset
- content/docs
- automation
- permissions
- packages/plugins/plugin-approvals/src
- translations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
| 420 | + | |
| 421 | + | |
421 | 422 | | |
422 | 423 | | |
423 | 424 | | |
| |||
750 | 751 | | |
751 | 752 | | |
752 | 753 | | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
753 | 760 | | |
754 | 761 | | |
755 | 762 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
| 575 | + | |
575 | 576 | | |
576 | 577 | | |
577 | 578 | | |
| |||
0 commit comments