From 44be453cbbebe47c966b826ddf81ef8bde91bb69 Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Mon, 21 Sep 2026 12:15:58 +0200 Subject: [PATCH] Summarise a plain-value array row by its value A task script is a list of strings, and every row read back as "Item 1", "Item 2": the summary only knew how to read object rows, so the very text being configured was hidden behind its position. A string, number or boolean row now reads as itself, and falls back to the position only when it is blank. Co-Authored-By: Claude Opus 5 (1M context) --- .../shared/nodes/generic-node/generic-node.spec.ts | 11 +++++++++++ src/app/shared/nodes/generic-node/generic-node.ts | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/src/app/shared/nodes/generic-node/generic-node.spec.ts b/src/app/shared/nodes/generic-node/generic-node.spec.ts index d636f29..eb89ded 100644 --- a/src/app/shared/nodes/generic-node/generic-node.spec.ts +++ b/src/app/shared/nodes/generic-node/generic-node.spec.ts @@ -1372,4 +1372,15 @@ describe('GenericNodeComponent', () => { expect(summary(definition, { source: 'INPUT', name: 'planDoc', multiple: true }, 0)) .toBe('INPUT ยท planDoc'); }); + + it('reads back a plain-value row as its value, not as its position', () => { + // A task script is a list of strings: "Item 1 / Item 2" hid the very text being configured. + const definition = { path: 'taskScript', label: 'Steps', itemSchema: { type: 'string' }, uniqueBy: null } as any; + const summary = (component as any).toArrayItemSummary.bind(component); + + expect(summary(definition, 'Sign in with the test account', 0)).toBe('Sign in with the test account'); + expect(summary(definition, ' Create an order ', 1)).toBe('Create an order'); + // An empty string identifies nothing, so the position is all that is left to say. + expect(summary(definition, ' ', 2)).toBe('Item 3'); + }); }); diff --git a/src/app/shared/nodes/generic-node/generic-node.ts b/src/app/shared/nodes/generic-node/generic-node.ts index a46e7fa..8561ee3 100644 --- a/src/app/shared/nodes/generic-node/generic-node.ts +++ b/src/app/shared/nodes/generic-node/generic-node.ts @@ -1956,6 +1956,11 @@ export class GenericNodeComponent implements OnDestroy { } private toArrayItemSummary(definition: ArrayFieldDefinition, item: unknown, index: number) { + // An array of plain values - a task script, a list of names - is its own summary. Reading back + // "Item 1 / Item 2" where the row holds "Sign in" tells the reader nothing they can act on. + if (typeof item === 'string') return item.trim() || `Item ${index + 1}`; + if (typeof item === 'number' || typeof item === 'boolean') return String(item); + if (!item || typeof item !== 'object' || Array.isArray(item)) { return `Item ${index + 1}`; }