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

davsclaus pushed a commit to branch fix/CAMEL-23698
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 63819cbc20ffd055ee1ba6b7c0c813e834f7b65c
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Jun 5 19:21:44 2026 +0200

    CAMEL-23672: camel-jbang - Fix tree preview sync and waterfall indent in 
TUI History tab
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../dsl/jbang/core/commands/tui/DiagramSupport.java   |  1 +
 .../camel/dsl/jbang/core/commands/tui/HistoryTab.java | 19 ++++++++++++-------
 2 files changed, 13 insertions(+), 7 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 07d18a0ec78a..2f80ee640e0f 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
@@ -1695,6 +1695,7 @@ class DiagramSupport {
         frame.renderWidget(finalWidget, hChunks.get(0));
 
         eipNodeBoxes = new ArrayList<>(finalWidget.getNodeBoxes());
+        selectedEipNodeIndex = selIdx;
 
         vScrollState.contentLength(totalRows);
         vScrollState.viewportContentLength(visibleLines);
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/HistoryTab.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/HistoryTab.java
index 99b23fd4fd60..875e836f618a 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/HistoryTab.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/HistoryTab.java
@@ -840,28 +840,33 @@ class HistoryTab implements MonitorTab {
     }
 
     record WaterfallStep(String nodeId, String processor, String direction, 
boolean first, boolean last,
-            int nodeLevel, long elapsed) {
+            int nodeLevel, long elapsed, int inlineDepth) {
 
         static WaterfallStep fromTrace(TraceEntry e) {
-            return new WaterfallStep(e.nodeId, e.processor, e.direction, 
e.first, e.last, e.nodeLevel, e.elapsed);
+            return new WaterfallStep(
+                    e.nodeId, e.processor, e.direction, e.first, e.last, 
e.nodeLevel, e.elapsed,
+                    e.inlineDepth);
         }
 
         static WaterfallStep fromHistory(HistoryEntry e) {
-            return new WaterfallStep(e.nodeId, e.processor, e.direction, 
e.first, e.last, e.nodeLevel, e.elapsed);
+            return new WaterfallStep(
+                    e.nodeId, e.processor, e.direction, e.first, e.last, 
e.nodeLevel, e.elapsed,
+                    e.inlineDepth);
         }
 
         WaterfallStep withElapsed(long newElapsed) {
-            return new WaterfallStep(nodeId, processor, direction, first, 
last, nodeLevel, newElapsed);
+            return new WaterfallStep(nodeId, processor, direction, first, 
last, nodeLevel, newElapsed, inlineDepth);
         }
 
         String label() {
+            String prefix = inlineDepth > 0 ? "  ".repeat(inlineDepth) : "";
             if (nodeId != null && !nodeId.isEmpty()) {
-                return nodeId;
+                return prefix + nodeId;
             }
             if (processor != null) {
-                return processor.stripLeading();
+                return prefix + processor.stripLeading();
             }
-            return "";
+            return prefix;
         }
     }
 

Reply via email to