From a21de0fff583ef55652727e59589c875f49dc5b2 Mon Sep 17 00:00:00 2001 From: Alexander Vogt Date: Wed, 9 Sep 2026 11:01:05 +0200 Subject: [PATCH 1/2] fix: only annotations for incomming and propagated labels are shown --- .../webEditor/src/diagram/nodes/annotation.ts | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/frontend/webEditor/src/diagram/nodes/annotation.ts b/frontend/webEditor/src/diagram/nodes/annotation.ts index 02b0f515..32c6aa64 100644 --- a/frontend/webEditor/src/diagram/nodes/annotation.ts +++ b/frontend/webEditor/src/diagram/nodes/annotation.ts @@ -179,30 +179,32 @@ export class DfdNodeAnnotationUI extends AbstractUIExtension { const mode = this.shownLabels.get(); node.annotations.forEach((a) => { - if ( - ((mode === ShownLabels.INCOMING || mode === ShownLabels.ALL) && - a.message.trim().startsWith("Incoming")) || - ((mode === ShownLabels.OUTGOING || mode === ShownLabels.ALL) && - a.message.trim().startsWith("Propagated")) || - a.message.startsWith("Constraint") - ) { - const line = document.createElement("div"); - line.style.display = "flex"; - line.style.alignItems = "center"; - line.style.gap = "6px"; // some spacing between icon and text - - if (a.icon) { - const iconI = document.createElement("i"); - iconI.classList.add("fa", `fa-${a.icon}`); - line.appendChild(iconI); - } - - const textSpan = document.createElement("span"); - textSpan.innerText = a.message; - line.appendChild(textSpan); - - this.annotationParagraph.appendChild(line); + let showAnnotation = true; + if (a.message.trim().startsWith("Incoming")) { + showAnnotation = mode === ShownLabels.INCOMING || mode === ShownLabels.ALL; + } else if (a.message.trim().startsWith("Propagated")) { + showAnnotation = mode === ShownLabels.OUTGOING || mode === ShownLabels.ALL; } + if (!showAnnotation) { + return; + } + + const line = document.createElement("div"); + line.style.display = "flex"; + line.style.alignItems = "center"; + line.style.gap = "6px"; // some spacing between icon and text + + if (a.icon) { + const iconI = document.createElement("i"); + iconI.classList.add("fa", `fa-${a.icon}`); + line.appendChild(iconI); + } + + const textSpan = document.createElement("span"); + textSpan.innerText = a.message; + line.appendChild(textSpan); + + this.annotationParagraph.appendChild(line); }); } } From b6a887f78dc2b73d6410ddb8c3aee0274c2568f5 Mon Sep 17 00:00:00 2001 From: Alexander Vogt Date: Wed, 9 Sep 2026 11:03:08 +0200 Subject: [PATCH 2/2] support html in annotations --- frontend/webEditor/src/diagram/nodes/annotation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/webEditor/src/diagram/nodes/annotation.ts b/frontend/webEditor/src/diagram/nodes/annotation.ts index 32c6aa64..0204952a 100644 --- a/frontend/webEditor/src/diagram/nodes/annotation.ts +++ b/frontend/webEditor/src/diagram/nodes/annotation.ts @@ -201,7 +201,7 @@ export class DfdNodeAnnotationUI extends AbstractUIExtension { } const textSpan = document.createElement("span"); - textSpan.innerText = a.message; + textSpan.innerHTML = a.message; line.appendChild(textSpan); this.annotationParagraph.appendChild(line);