This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch feature/CAMEL-23672-tui-diagram
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 25a8dc2f043a9d82b23a535986417be9dded7386
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Jun 3 22:33:41 2026 +0200

    CAMEL-23672: camel-tui - Skip route structural node in route diagram
    
    Remove the route label and route node box from the diagram since the
    route name is already shown in the block title. The from node is now
    the first visible element.
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../dsl/jbang/core/commands/tui/DiagramSupport.java  |  9 ---------
 .../commands/tui/diagram/RouteDiagramWidget.java     | 20 ++++++++------------
 2 files changed, 8 insertions(+), 21 deletions(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramSupport.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramSupport.java
index b6288889e22f..ad352e943e6f 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramSupport.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramSupport.java
@@ -569,15 +569,6 @@ class DiagramSupport {
     }
 
     void selectFromNode(String routeId) {
-        var layout = routeLayouts.get(routeId);
-        if (layout != null) {
-            for (int i = 0; i < layout.nodes.size(); i++) {
-                if ("from".equals(layout.nodes.get(i).type)) {
-                    selectedEipNodeIndex = i;
-                    return;
-                }
-            }
-        }
         selectedEipNodeIndex = 0;
     }
 
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/RouteDiagramWidget.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/RouteDiagramWidget.java
index a2fae9e0de84..925b1549a08f 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/RouteDiagramWidget.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/RouteDiagramWidget.java
@@ -95,24 +95,18 @@ public class RouteDiagramWidget implements Widget {
     public void render(Rect area, Buffer buffer) {
         nodeBoxes.clear();
 
-        // Route label
-        int labelRow = toRow(layoutRoute.labelY);
-        String label = layoutRoute.routeId;
-        if (layoutRoute.source != null && !layoutRoute.source.isEmpty()) {
-            label += " (" + layoutRoute.source + ")";
-        }
-        writeText(buffer, area, labelRow, toCol(PADDING), label, 
ROUTE_ID_STYLE);
-
         // Scope boxes (behind everything)
         for (LayoutNode ln : layoutRoute.nodes) {
-            if (ln.treeNode != null && 
RouteDiagramLayoutEngine.hasScope(ln.treeNode)) {
+            if (!"route".equals(ln.type)
+                    && ln.treeNode != null && 
RouteDiagramLayoutEngine.hasScope(ln.treeNode)) {
                 drawScopeBox(buffer, area, ln);
             }
         }
 
         // Edges
         for (LayoutNode ln : layoutRoute.nodes) {
-            if (ln.parentNode != null) {
+            if (!"route".equals(ln.type) && ln.parentNode != null
+                    && !"route".equals(ln.parentNode.type)) {
                 if (ln.connectFromMerge) {
                     drawMergeArrow(buffer, area, ln);
                 } else {
@@ -121,9 +115,11 @@ public class RouteDiagramWidget implements Widget {
             }
         }
 
-        // Nodes (on top)
+        // Nodes (on top, skip the structural "route" node)
         for (LayoutNode ln : layoutRoute.nodes) {
-            drawNode(buffer, area, ln);
+            if (!"route".equals(ln.type)) {
+                drawNode(buffer, area, ln);
+            }
         }
     }
 

Reply via email to