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

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

commit 2702234cb01178800fec549fa3290711a2ac2a46
Author: Claus Ibsen <[email protected]>
AuthorDate: Sat May 16 18:54:48 2026 +0200

    TUI: fix info panel not visible in diagram view
    
    Add missing renderDiagramInfoPanel call at the end of the text diagram
    path, and extract helper method shared by both image and text paths.
    Panel renders last so it draws on top of any diagram overflow.
    
    Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
---
 .../dsl/jbang/core/commands/tui/CamelMonitor.java  | 46 ++++++++++++----------
 1 file changed, 25 insertions(+), 21 deletions(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java
index 396b6ac35a00..7f27d0da2b73 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java
@@ -1635,32 +1635,13 @@ public class CamelMonitor extends CamelCommand {
     private void renderDiagram(Frame frame, Rect area) {
         IntegrationInfo sel = findSelectedIntegration();
 
-        // Split: diagram (fill) + info panel (22 cols)
+        // Split: diagram (fill) + info panel (24 cols)
         List<Rect> hSplit = Layout.horizontal()
-                .constraints(Constraint.fill(), Constraint.length(22))
+                .constraints(Constraint.fill(), Constraint.length(24))
                 .split(area);
         Rect diagramArea = hSplit.get(0);
         Rect infoArea = hSplit.get(1);
 
-        // Info panel: heap and threads
-        List<Line> infoLines = new ArrayList<>();
-        if (sel != null) {
-            infoLines.add(Line.from(Span.styled("HEAP", Style.EMPTY.bold())));
-            String heap = formatMemory(sel.heapMemUsed, sel.heapMemMax);
-            long pct = sel.heapMemMax > 0 ? sel.heapMemUsed * 100 / 
sel.heapMemMax : 0;
-            infoLines.add(Line.from(heap.isEmpty() ? "-" : heap + " (" + pct + 
"%)"));
-            infoLines.add(Line.from(""));
-            infoLines.add(Line.from(Span.styled("THREADS", 
Style.EMPTY.bold())));
-            infoLines.add(Line.from("Current: " + sel.threadCount));
-            infoLines.add(Line.from("Peak:    " + sel.peakThreadCount));
-        }
-        frame.renderWidget(
-                Paragraph.builder()
-                        .text(Text.from(infoLines))
-                        
.block(Block.builder().borderType(BorderType.ROUNDED).title(" Info ").build())
-                        .build(),
-                infoArea);
-
         Rect area2 = diagramArea;
         Block block = Block.builder()
                 .borderType(BorderType.ROUNDED)
@@ -1669,6 +1650,7 @@ public class CamelMonitor extends CamelCommand {
 
         if (diagramFullImageData != null) {
             renderImageDiagram(frame, area2, block);
+            renderDiagramInfoPanel(frame, infoArea, sel);
             return;
         }
 
@@ -1735,6 +1717,28 @@ public class CamelMonitor extends CamelCommand {
                     Scrollbar.horizontal(),
                     vChunks.get(1), diagramHScrollState);
         }
+
+        renderDiagramInfoPanel(frame, infoArea, sel);
+    }
+
+    private void renderDiagramInfoPanel(Frame frame, Rect area, 
IntegrationInfo sel) {
+        List<Line> infoLines = new ArrayList<>();
+        if (sel != null) {
+            infoLines.add(Line.from(Span.styled("HEAP", Style.EMPTY.bold())));
+            String heap = formatMemory(sel.heapMemUsed, sel.heapMemMax);
+            long pct = sel.heapMemMax > 0 ? sel.heapMemUsed * 100 / 
sel.heapMemMax : 0;
+            infoLines.add(Line.from(Span.raw(heap.isEmpty() ? "-" : heap + " 
(" + pct + "%)")));
+            infoLines.add(Line.from(Span.raw("")));
+            infoLines.add(Line.from(Span.styled("THREADS", 
Style.EMPTY.bold())));
+            infoLines.add(Line.from(Span.raw("Current: " + sel.threadCount)));
+            infoLines.add(Line.from(Span.raw("Peak:    " + 
sel.peakThreadCount)));
+        }
+        frame.renderWidget(
+                Paragraph.builder()
+                        .text(Text.from(infoLines))
+                        
.block(Block.builder().borderType(BorderType.ROUNDED).title(" Info ").build())
+                        .build(),
+                area);
     }
 
     private void renderImageDiagram(Frame frame, Rect area, Block block) {

Reply via email to