Repository navigation
Commit b8c9590
fix(plugin-approvals): the approval request Timeline shows each step by its label, not the node id (#25526)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuACdPWFJTLDcTrByFCHLzqb)_
Fixes #25501
Clause-②: no
Metadata-protocol: none
## What was wrong
The `sys_approval_request` record page
(`packages/plugins/plugin-approvals/src/sys-approval-request.page.ts`)
has a Timeline tab. That tab is a `record:related_list` over
`sys_approval_action`, and its columns asked for `step_name`. Every
action row stores two step fields, both declared on
`sys-approval-action.object.ts`:
- `step_name`: "Machine name of the step at the time of the action".
Every writer in `approval-service.ts` sets it to the Approval node id
(`step_name: nodeId`, or `raw.flow_node_id ?? raw.current_step`).
- `step_label`: "Label of the step at the time of the action".
`ApprovalService.actionRow` writes it on every row from the request's
`current_step_label`, and `display-label-backfill.ts` fills it on older
rows.
So every Timeline row showed the node id (`dual_signoff`), while the
highlights strip right above it showed the label (`current_step_label`).
The object's own list views (`recent`, `by_actor`, `all_actions`)
already use `step_label`.
The card's premise holds with one correction: `step_name` is not
missing. It is a declared, stored field that holds the machine id, so
the column named a real field. It was the wrong one of the two.
## The change
- The Timeline column `step_name` is now `step_label`. Nothing else on
the page changes, and the page's doc comment says why the step column is
`step_label`.
- Landing: the file the claim names. `packages/spec` is not touched.
- I checked every other field the page names against its object. The
Timeline columns `created_at`, `action`, `actor_id`, `comment` and
`attachments` and its sort field `created_at` are all
`sys_approval_action` fields. The highlights strip's `process_label`,
`status`, `current_step_label`, `submitter_id` and `updated_at` are all
`sys_approval_request` fields, and none of them is a machine id where a
label exists.
## Tests
`src/sys-approval-request-page.test.ts` gains `names each Timeline step
by its label, step_label, never by the node's machine id, step_name`. It
reads the page's Timeline columns and asserts two things: `step_label`
is listed and `step_name` is not, and `step_label` is the declared
`Approval Step` text field. A control asserts that `step_name` stays a
declared field.
The file's existing test `every field the page names exists on its
object` already checks that each Timeline column names a field of
`sys_approval_action`. It stayed green on the defect, because
`step_name` is a declared field. That is why this test pins the choice,
the way the strip's `current_step_label` is already pinned.
Ablation, at head `4e80cfeeaf`, under the verify lock. `node
scripts/ablation-replace.mjs --file
packages/plugins/plugin-approvals/src/sys-approval-request.page.ts
--anchor "'actor_id', 'step_label', 'comment'" --replacement
"'actor_id', 'step_name', 'comment'" -- pnpm --filter
@objectstack/plugin-approvals exec vitest run --maxWorkers=2
src/sys-approval-request-page.test.ts`:
- `mutation landed: anchor 1 -> 0, blob 1b31bf2 -> 48f41780fd75`
- `× names each Timeline step by its label, step_label, never by the
node's machine id, step_name` and `Tests 1 failed | 19 passed (20)`.
Only the new test went red, and the existence test stayed green, as
described above.
- `restored: blob == HEAD (1b31bf2) and git diff HEAD is empty`
The test imports the page from `src` through a relative import, so the
ablation needs no `dist/` rebuild.
## Local verification (head `4e80cfeeaf`)
- `pnpm --filter '@objectstack/plugin-approvals^...' build` (dependency
closure): VERDICT command-exit 0.
- `pnpm --filter @objectstack/plugin-approvals test`: `Test Files 95
passed (95)`, `Tests 1234 passed (1234)`.
- `pnpm --filter @objectstack/plugin-approvals typecheck`: exit 0, and
`check:test-typecheck: OK`.
- `node scripts/pm/dispatch-gates.mjs --commands` derived 69 commands.
68 exit 0. `pnpm check:i18n` exited 3 at first because its prerequisite
build was missing; after its named build closure it gave
`check-i18n-bundles: OK`.
- `pnpm check:dual-build-cjs-loads` exited 3: PREREQUISITE NOT MET,
because it needs a whole-workspace `pnpm build`. NOT MEASURED locally;
CI runs it.
- `--ran`: `69 derived famil(ies) accounted for — 68 run, 1 NOT-MEASURED
(1 DERIVED from a recorded exit 3)`.
## Acceptance notes
- The `sys_approval_action` object itself still names the step by
`step_name` in three places that this card does not cover:
- its `titleFormat` (`'{action} · {step_name}'`);
- its `display_title` formula, the record title (`nameField`);
- its `highlightFields`.
So an action record's own title and strip read for example `approve ·
dual_signoff`. This is not filed: it is a separate surface (the action
record's own page and title, not the request page's Timeline), and
changing a formula's record title has a wider reach than one column.
Carrier: none.
---
_Generated by [Claude
Code](https://claude.ai/code/session_016g7nYP9wdNx1GDa5XDr7Uy)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_016g7nYP9wdNx1GDa5XDr7Uy
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1ff43b6 commit b8c9590
3 files changed
Lines changed: 32 additions & 2 deletions
File tree
- .changeset
- packages/plugins/plugin-approvals/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
220 | 237 | | |
221 | 238 | | |
222 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
123 | | - | |
| 126 | + | |
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
| |||
0 commit comments