From 7799f8ce5fb0a1f9bd16665066bdb2bccebe4066 Mon Sep 17 00:00:00 2001 From: Kamil Patryk Kozakowski Date: Tue, 14 Jul 2026 06:38:57 +0200 Subject: [PATCH] Align HTML SVG link keys with export enum formats HtmlExporter now propagates event/state formats into PlantUML anchors and template.js buildLinkKey, with layered-dispatcher and fqn regression tests guarding endpoint highlight consistency. Co-authored-by: Cursor --- .../html/exporter/HtmlExporter.java | 6 +- .../src/main/resources/html/template.html | 16 ++- .../html/HtmlExporterTest.java | 3 +- .../HtmlTransitionLinkConsistencyTest.java | 136 ++++++++++++++++-- 4 files changed, 146 insertions(+), 15 deletions(-) diff --git a/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/exporter/HtmlExporter.java b/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/exporter/HtmlExporter.java index cfe2ee5..1ca84c3 100644 --- a/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/exporter/HtmlExporter.java +++ b/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/exporter/HtmlExporter.java @@ -40,6 +40,8 @@ public class HtmlExporter implements StateMachineExporter { .useLambdaGuards(options.isUseLambdaGuards()) .renderChoicesAsDiamonds(options.isRenderChoicesAsDiamonds()) .embedIdentifiers(true) // Force identifying classes in SVG + .eventFormat(options.getEventFormat()) + .stateFormat(options.getStateFormat()) .build(); String puml = pumlExporter.export(result, enrichedOptions); @@ -82,7 +84,9 @@ public class HtmlExporter implements StateMachineExporter { String finalHtml = template .replace("{{MACHINE_NAME}}", result.getName()) .replace("{{SVG_CONTENT}}", decoratedSvg) - .replace("{{METADATA_JSON}}", metadataJson); + .replace("{{METADATA_JSON}}", metadataJson) + .replace("{{LINK_EVENT_FORMAT}}", options.getEventFormat().name()) + .replace("{{LINK_STATE_FORMAT}}", options.getStateFormat().name()); if (shouldRenderPane) { // If template.html uses {{SIDEBAR_HTML}} and {{TOGGLE_BUTTON_HTML}}, replace with actual HTML diff --git a/state_machine_exporter_html/src/main/resources/html/template.html b/state_machine_exporter_html/src/main/resources/html/template.html index 30e3aab..dfe6d97 100644 --- a/state_machine_exporter_html/src/main/resources/html/template.html +++ b/state_machine_exporter_html/src/main/resources/html/template.html @@ -309,6 +309,8 @@