From a8b1920fdb5a983eeac9d55a92bdf9ee3a748859 Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Mon, 28 Sep 2026 16:00:20 +0200 Subject: [PATCH] Say what each block is in the palette, from its role The palette knew two kinds of block, a human step and an automated one, so a Storage node, an End and a routing block all read 'Automated step'. It now goes by the role the block's type declares: a resource that is not a step, an end of a path, an automated or a human decision, a rejoin of branches, a human step, an automated step - each with its own icon. The server's BRANCH_REJOIN role is read as the web's MERGE, which it had never matched, so a rejoin was taken for an ordinary activity. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../services/shared/flow-node-mapping.spec.ts | 1 + src/app/services/shared/flow-node-mapping.ts | 4 ++- src/app/shared/blocks-list/blocks-list.css | 13 ++++++++++ src/app/shared/blocks-list/blocks-list.html | 10 +++---- .../shared/blocks-list/blocks-list.spec.ts | 15 ++++++++++- src/app/shared/blocks-list/blocks-list.ts | 26 +++++++++++++++++++ 6 files changed, 61 insertions(+), 8 deletions(-) diff --git a/src/app/services/shared/flow-node-mapping.spec.ts b/src/app/services/shared/flow-node-mapping.spec.ts index e263650..462c7ce 100644 --- a/src/app/services/shared/flow-node-mapping.spec.ts +++ b/src/app/services/shared/flow-node-mapping.spec.ts @@ -148,6 +148,7 @@ describe('toNodeCapabilities', () => { it('reads that a type routes exclusively, which is what lets it guard a loop', () => { expect(toNodeCapabilities({ visualRole: 'DECISION', routesExclusively: true }).routesExclusively).toBe(true); expect(toNodeCapabilities({ visualRole: 'RESOURCE' }).visualRole).toBe('RESOURCE'); + expect(toNodeCapabilities({ visualRole: 'BRANCH_REJOIN' }).visualRole).toBe('MERGE'); }); it('falls back per-field for missing booleans and an unknown visualRole', () => { diff --git a/src/app/services/shared/flow-node-mapping.ts b/src/app/services/shared/flow-node-mapping.ts index 940cd53..062ca4e 100644 --- a/src/app/services/shared/flow-node-mapping.ts +++ b/src/app/services/shared/flow-node-mapping.ts @@ -96,7 +96,9 @@ export function toPorts( const NODE_VISUAL_ROLES: NodeVisualRole[] = ['ACTIVITY', 'DECISION', 'MERGE', 'END', 'CONTAINER', 'RESOURCE']; function toVisualRole(value: unknown): NodeVisualRole { - const candidate = typeof value === 'string' ? value.toUpperCase() : ''; + const raw = typeof value === 'string' ? value.toUpperCase() : ''; + // The server calls a rejoin of branches BRANCH_REJOIN; the web has always called it MERGE. + const candidate = raw === 'BRANCH_REJOIN' ? 'MERGE' : raw; return (NODE_VISUAL_ROLES as string[]).includes(candidate) ? candidate as NodeVisualRole : DEFAULT_NODE_CAPABILITIES.visualRole; diff --git a/src/app/shared/blocks-list/blocks-list.css b/src/app/shared/blocks-list/blocks-list.css index f1cf0e5..1fed6ac 100644 --- a/src/app/shared/blocks-list/blocks-list.css +++ b/src/app/shared/blocks-list/blocks-list.css @@ -107,6 +107,19 @@ color: #0ea5e9; } +.blocks-list-card-kind--resource { + color: #0f766e; +} + +.blocks-list-card-kind--end { + color: #475569; +} + +.blocks-list-card-kind--decision, +.blocks-list-card-kind--merge { + color: #6366f1; +} + .blocks-list-card-kind--container { color: #7c3aed; } diff --git a/src/app/shared/blocks-list/blocks-list.html b/src/app/shared/blocks-list/blocks-list.html index 6eabb00..ffd0baa 100644 --- a/src/app/shared/blocks-list/blocks-list.html +++ b/src/app/shared/blocks-list/blocks-list.html @@ -33,16 +33,14 @@ (dragstart)="onDragStart($event, block)">
+ @let kind = kindOf(block); + [class]="'blocks-list-card-kind blocks-list-card-kind--' + kind.modifier" + [fontIcon]="kind.icon">
{{ block.type }}
-
- {{ block.userInteractive ? 'Human step' : 'Automated step' }} -
+
{{ kind.label }}